This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I2C interrupt or polling

Hi,

I am using NXP LPC1837 controller as a master and it is supposed to talk to other devices over I2C.

The firmware is based on Keil V5.

In the firmware code, I2C was initialized without defining a callback function as follows:

#include "Driver_I2C.h"
#include "cmsis_os.h"

... some code....

ARM_DRIVER_I2C Driver_I2C0;
ARM_DRIVER_I2C * I2C_drv = &Driver_I2C0;

... some code....

I2C_drv->Initialize (NULL);

... some code....

then when master transmits, the following code is used:

... some code....

while (I2C_drv->GetStatus().busy);
ret = I2C_drv->MasterTransmit(slave_addr, data_to_transmit, number_of_bytes, false);
while (I2C_drv->GetStatus().busy);

... some code....

the callback function is not defined but before and after master transmit, the I2C bus busy flag is checked.

Is this approach still considered as I2C interrupt? does this make the I2C communication mode as polling mode?

Thank you