Go to the source code of this file.
◆ ACK
◆ DATA
define the i2c DATA value
◆ NACK
define the i2c NACK value
◆ READ
◆ SLA
◆ START
define the i2c START value
◆ STOP
define the i2c STOP value
◆ WRITE
◆ i2c_init()
◆ i2c_master_read_b()
| uint8_t i2c_master_read_b |
( |
const uint8_t |
addr, |
|
|
uint8_t * |
byte |
|
) |
| |
i2c master read byte.
Read a byte from the slave with a stop at the end.
- Parameters
-
| addr | address of the slave. |
| byte | ptr to a pre-allocated byte. |
- Returns
- 1 - value OK, 0 - Error.
◆ i2c_master_read_w()
| uint8_t i2c_master_read_w |
( |
const uint8_t |
addr, |
|
|
uint16_t * |
code |
|
) |
| |
Read a word (2 byte) from the slave.
- Parameters
-
| addr | address of the slave. |
| code | ptr to a pre-allocated word. |
- Returns
- 1 - value OK, 0 - Error.
◆ i2c_master_send_b()
| uint8_t i2c_master_send_b |
( |
const uint8_t |
addr, |
|
|
const uint8_t |
data |
|
) |
| |
Send a byte to the i2c slave.
- Parameters
-
| addr | address of the slave. |
| data | byte to send. |
◆ i2c_master_send_w()
| uint8_t i2c_master_send_w |
( |
const uint8_t |
addr, |
|
|
const uint8_t |
msb, |
|
|
const uint8_t |
lsb |
|
) |
| |
i2c master send a word. Send a word to the i2c slave with stop at the end.
- Parameters
-
| addr | address of the slave. |
| msb | byte to send first. |
| lsb | byte to send last. |
- Returns
- 0 - OK, 1 - Error
◆ i2c_send()
| uint8_t i2c_send |
( |
const uint8_t |
code, |
|
|
const uint8_t |
data |
|
) |
| |
Send the i2c status to the bus.
- Parameters
-
| code | the i2c code to send. |
| data | the byte to send. |
◆ i2c_shut()