下面是I2C的函数说明。我用的是第二个I2C。
void I2C2_Initialize(void);
void I2C2_MasterWrite(
uint8_t *pdata,
uint8_t length,
uint16_t address,
I2C2_MESSAGE_STATUS *pstatus);
void I2C2_MasterRead(
uint8_t *pdata,
uint8_t length,
uint16_t address,
I2C2_MESSAGE_STATUS *pstatus);
void I2C2_MasterTRBInsert(
uint8_t count,
I2C2_TRANSACTION_REQUEST_BLOCK *ptrb_list,
I2C2_MESSAGE_STATUS *pflag);
void I2C2_MasterReadTRBBuild(
I2C2_TRANSACTION_REQUEST_BLOCK *ptrb,
uint8_t *pdata,
uint8_t length,
uint16_t address);
void I2C2_MasterWriteTRBBuild(
I2C2_TRANSACTION_REQUEST_BLOCK *ptrb,
uint8_t *pdata,
uint8_t length,
uint16_t address);
bool I2C2_MasterQueueIsEmpty(void);
bool I2C2_MasterQueueIsFull(void);
|