BeRTOS
|
This is the old and deprecated I2C API. More...
Functions | |
bool | i2c_send (const void *_buf, size_t count) |
Send a sequence of bytes in master transmitter mode to the selected slave device through the I2C bus. | |
bool | i2c_recv (void *_buf, size_t count) |
Receive a sequence of one or more bytes from the selected slave device in master receive mode through the I2C bus. | |
I2C Backends. | |
Sometimes your cpu does not have a builtin i2c driver or you don't want, for some reason, to use that. With this you can choose, at compile time, which backend to use. Set the CONFIG_I2C_BACKEND configuration variable in cfg_i2c.h | |
#define | I2C_BACKEND_BUILTIN 0 |
Uses cpu builtin i2c driver. | |
#define | I2C_BACKEND_BITBANG 1 |
Uses emulated bitbang driver. | |
I2c builtin prototypes. | |
Do NOT use these function directly, instead, you can call the ones named without "_builtin_" and specify in cfg_i2c.h (CONFIG_I2C_BACKEND) that you want the builtin backend. | |
bool | i2c_builtin_start_w (uint8_t id) |
Send START condition and select slave for write. | |
bool | i2c_builtin_start_r (uint8_t id) |
Send START condition and select slave for read. | |
void | i2c_builtin_stop (void) |
Send STOP condition. | |
bool | i2c_builtin_put (uint8_t _data) |
Put a single byte in master transmitter mode to the selected slave device through the TWI bus. | |
int | i2c_builtin_get (bool ack) |
Get 1 byte from slave in master transmitter mode to the selected slave device through the TWI bus. | |
I2c bitbang prototypes. | |
Do NOT use these function directly, instead, you can call the ones named without "_bitbang_" and specify in cfg_i2c.h (CONFIG_I2C_BACKEND) that you want the bitbang backend. | |
bool | i2c_bitbang_start_w (uint8_t id) |
bool | i2c_bitbang_start_r (uint8_t id) |
void | i2c_bitbang_stop (void) |
bool | i2c_bitbang_put (uint8_t _data) |
int | i2c_bitbang_get (bool ack) |
This is the old and deprecated I2C API.
It is maintained for backward compatibility only, don't use it in new projects.
int i2c_builtin_get | ( | bool | ack | ) |
bool i2c_builtin_put | ( | const uint8_t | data | ) |
bool i2c_builtin_start_r | ( | uint8_t | id | ) |
bool i2c_builtin_start_w | ( | uint8_t | id | ) |
bool i2c_recv | ( | void * | _buf, |
size_t | count | ||
) |