Tool/software:
Hi, experts,
In SDK, the I2C examples are working in I2C_MODE_BLOCKING mode, that after calling I2C_Transfer(), the execution is blocked and only run out of I2C_Transfer() after transfer completed. Then, the application code can read the received data and prepare new data for sending.
Now, my customer need to use I2C in I2C_MODE_CALLBACK mode, that the execution is not blocked. The application code is notified by callback when the I2C transfer completed. Customer tried to call I2C_Transfer() to trigger the next I2C transfer in the callback but the execution stuck. Then customer tried to set a flag in the callback and polling this flag in main loop. If the flag is set, then call I2C_Transfer() to start the next transfer. It works in this way, but polling in main loop is too inefficiency.
Can you help to share an I2C example for I2C_MODE_CALLBACK transferMode? What is the suggested way to trigger the next I2C transfer when the previous one completed?
AM2612 I2C is working in target mode.
Thanks.