结构体 | |
struct | aos_i2c_msg_t |
宏定义 | |
#define | AOS_I2C_MCFG_TX ((uint32_t)0x0 << 0) |
#define | AOS_I2C_MCFG_RX ((uint32_t)0x1 << 0) |
#define | AOS_I2C_MCFG_ADDR_7 ((uint32_t)0x0 << 1) |
#define | AOS_I2C_MCFG_ADDR_10 ((uint32_t)0x1 << 1) |
#define | AOS_I2C_MSG_INIT_VAL |
#define | aos_i2c_msg_init(x) do { *(x) = (aos_i2c_msg_t)AOS_I2C_MSG_INIT_VAL; } while (0) |
类型定义 | |
typedef aos_dev_ref_t | aos_i2c_ref_t |
函数 | |
aos_status_t | aos_i2c_get (aos_i2c_ref_t *ref, uint32_t id) |
Get a I2C device. 更多... | |
void | aos_i2c_put (aos_i2c_ref_t *ref) |
Release a I2C device. 更多... | |
aos_status_t | aos_i2c_transfer (aos_i2c_ref_t *ref, const aos_i2c_msg_t *msgs, size_t num_msgs) |
Synchronous I2C data transfer. 更多... | |
给应用提供I2C操作的AOS API.
#define aos_i2c_msg_init | ( | x | ) | do { *(x) = (aos_i2c_msg_t)AOS_I2C_MSG_INIT_VAL; } while (0) |
#define AOS_I2C_MSG_INIT_VAL |
typedef aos_dev_ref_t aos_i2c_ref_t |
aos_status_t aos_i2c_get | ( | aos_i2c_ref_t * | ref, |
uint32_t | id | ||
) |
Get a I2C device.
[out] | ref | I2C ref to operate |
[in] | id | I2C device ID |
void aos_i2c_put | ( | aos_i2c_ref_t * | ref | ) |
Release a I2C device.
[in] | ref | I2C ref to operate |
aos_status_t aos_i2c_transfer | ( | aos_i2c_ref_t * | ref, |
const aos_i2c_msg_t * | msgs, | ||
size_t | num_msgs | ||
) |
Synchronous I2C data transfer.
[in] | ref | I2C ref to operate |
[in] | msgs | array of messages |
[in] | num_msgs | number of messages |