This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I2C.c移入motorware

在i2c.c文件中,void I2C_MasterControl(I2C_Handle i2cHandle, I2C_Control_e action, uint16_t bitCount, uint16_t bytes)函数中,bitCount是用于什么,代表什么?该如何操作这个变量(赋什么值合适)?

void I2C_MasterControl(I2C_Handle i2cHandle, I2C_Control_e action, uint16_t bitCount, uint16_t bytes)
{
// Check the arguments.
assert(I2C_isHandleValid(i2cHandle));
assert(bitCount <= 7);

I2C_Obj *i2c = (I2C_Obj *)i2cHandle;

// Write the number of bytes to send or receive
i2c->I2CCNT = bytes;

// Send the command.
i2c->I2CMDR = action | bitCount;
}