|
struct i2c * | i2c_init (uint32_t index, enum i2c_mode mode) |
|
int32_t | i2c_deinit (struct i2c *i2c) |
|
int32_t | i2c_send (struct i2c *i2c, uint16_t id, uint8_t *data, uint32_t len, TickType_t waittime) |
|
int32_t | i2c_recv (struct i2c *i2c, uint16_t id, uint8_t *data, uint32_t len, TickType_t waittime) |
|
int32_t | i2c_transfer (struct i2c *i2c, uint16_t id, uint8_t *sendData, uint32_t sendLen, uint8_t *recvData, uint32_t recvLen, TickType_t waittime) |
|
int32_t | i2c_sendISR (struct i2c *i2c, uint16_t id, uint8_t *data, uint32_t len) |
|
int32_t | i2c_recvISR (struct i2c *i2c, uint16_t id, uint8_t *data, uint32_t len) |
|
int32_t | i2c_transferISR (struct i2c *i2c, uint16_t id, uint8_t *sendData, uint32_t sendLen, uint8_t *recvData, uint32_t recvLen) |
|
This is the I2C Subsystem for controlling I2C of a SOC.
◆ i2c_mode
I2C Mode / Speed Config
Enumerator |
---|
I2C_SM | Standard Mode (100 Kbit/s)
|
I2C_FM | Fast Mode (400 Kbit/s)
|
I2C_FMP | Fast Mode Plus (1 Mbit/s)
|
I2C_HSM | High Speed Mode (3.4 Mbit/s)
|
i2C_UFM | Ultra Fast-mode (5.0 Mbit/s)
|
◆ i2c_deinit()
int32_t i2c_deinit |
( |
struct i2c * |
i2c | ) |
|
Deinit I2C
- Parameters
-
- Returns
- -1 on error 0 on ok
◆ i2c_init()
struct i2c* i2c_init |
( |
uint32_t |
index, |
|
|
enum i2c_mode |
mode |
|
) |
| |
init I2C instance
- Parameters
-
index | Index of I2C |
mode | I2C Mode |
- Returns
- I2C Instance NULL on Error
◆ i2c_recv()
int32_t i2c_recv |
( |
struct i2c * |
i2c, |
|
|
uint16_t |
id, |
|
|
uint8_t * |
data, |
|
|
uint32_t |
len, |
|
|
TickType_t |
waittime |
|
) |
| |
Recv Bytes
- Parameters
-
i2c | I2C instance |
id | ID if id > 7-Bit Exended IDs is used |
data | Data |
len | len |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error 0 on ok
◆ i2c_recvISR()
int32_t i2c_recvISR |
( |
struct i2c * |
i2c, |
|
|
uint16_t |
id, |
|
|
uint8_t * |
data, |
|
|
uint32_t |
len |
|
) |
| |
Recv Bytes in Interrupt
- Parameters
-
i2c | I2C instance |
id | ID if id > 7-Bit Exended IDs is used |
data | Data |
len | len |
- Returns
- -1 on error 0 on ok
◆ i2c_send()
int32_t i2c_send |
( |
struct i2c * |
i2c, |
|
|
uint16_t |
id, |
|
|
uint8_t * |
data, |
|
|
uint32_t |
len, |
|
|
TickType_t |
waittime |
|
) |
| |
Send Bytes
- Parameters
-
i2c | I2C instance |
id | ID if id > 7-Bit Exended IDs is used |
data | Data |
len | |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error 0 on ok
◆ i2c_sendISR()
int32_t i2c_sendISR |
( |
struct i2c * |
i2c, |
|
|
uint16_t |
id, |
|
|
uint8_t * |
data, |
|
|
uint32_t |
len |
|
) |
| |
Send Bytes in Interrupt
- Parameters
-
i2c | I2C instance |
id | ID if id > 7-Bit Exended IDs is used |
data | Data |
len | |
- Returns
- -1 on error 0 on ok
◆ i2c_transfer()
int32_t i2c_transfer |
( |
struct i2c * |
i2c, |
|
|
uint16_t |
id, |
|
|
uint8_t * |
sendData, |
|
|
uint32_t |
sendLen, |
|
|
uint8_t * |
recvData, |
|
|
uint32_t |
recvLen, |
|
|
TickType_t |
waittime |
|
) |
| |
Transfer Send and Recv
- Parameters
-
i2c | I2C instance |
id | ID if id > 7-Bit Exended IDs is used |
sendData | Send Data |
sendLen | Send len |
recvData | Recv Data |
recvLen | Recv len |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error 0 on ok
◆ i2c_transferISR()
int32_t i2c_transferISR |
( |
struct i2c * |
i2c, |
|
|
uint16_t |
id, |
|
|
uint8_t * |
sendData, |
|
|
uint32_t |
sendLen, |
|
|
uint8_t * |
recvData, |
|
|
uint32_t |
recvLen |
|
) |
| |
Transfer Send and Recv in Interrupt
- Parameters
-
i2c | I2C instance |
id | ID if id > 7-Bit Exended IDs is used |
sendData | Send Data |
sendLen | Send len |
recvData | Recv Data |
recvLen | Recv len |
- Returns
- -1 on error 0 on ok