Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Difference between the bWriteBytes functions in I2CHW and I2Cm user modules

Difference between the bWriteBytes functions in I2CHW and I2Cm user modules

DineshbabuM_66
Employee
Employee
First like received
Question: How does the implementation of bWriteBytes function in I2CHW user module differ from the same API implementation in I2Cm user module?

 

Answer:

In I2Cm, the function is a blocking function which executes in the foreground and returns only after completing the write operation. When the function is executing, the processor is loaded 100% and cannot perform other foreground operations.

Whereas in I2CHW, the bWriteBytes function initializes the buffer, sets the write count and exits. The actual write is performed by and completed in the I2C ISR. The status of the write should be checked in the foreground by reading the I2CHW_bReadI2CStatus function. Since it is a hardware block, when the write is being performed, the CPU is free to do other foreground operations.

0 Likes
285 Views
Contributors