Hi, i was using I2C controller I2CSPM_Init & I2CSPM_Transfer functions from hal-efr32/i2cspm.c without any RTOS.
Now, i want to use I2C under Micrium. Shall i continue to use the same functions calls without any change ? i don't see any i2c driver files in Micrium project (only files relatives to serial & spi). I have found 1 comment in micrium-os/io/include/serial.h which says something about IO_SERIAL_CTRLR_REG and "i2cX".
So should i use something like "IO_SERIAL_CTRLR_REG("i2c0", &BSP_Serial_SiliconLabs_Bus0_DrvInfo)" + "I2C_BusAdd("i2c0", &err)" [I2C_BusAdd does not exist today, only SPI_BusAdd exists).
Can you provide an example about using i2c with Micrium ?
Thank you !
Unfortunately there is no I2C example with Micrium at the moment. You can use the i2cspm.c file but its important to be aware it is polling-based so it may hold up your task longer than you wish.
Depending on your application it may make more sense to write an RTOS-friendly, interrupt-driven driver using the em_i2c.c file for I2C register control.