Page 1 of 1

Asyncrhonous I2C transfert

Posted: Wed Sep 25, 2024 2:22 pm
by brebisson
Hello,

I need to send (repeatedly) a pack of 512 bytes using I2C in a non blocking manner...
Something along the lines of:
```
void myLoop()
{
while (true)
{
do stuff
if (done sending through I2C)
start_sendig_I2c(512 bytes buffer)
do more stuff
}
}
```

I have had a look at the I2C driver, and all I can find is the i2c_master_write_to_device function which seems to be blocking..
Is there a i2c_master_write_to_device_async function that will let me start a sending and then return imediately?

I am mostly working in the arduino IDE if it maters...

Thanks,
Cyrille

Re: Asyncrhonous I2C transfert

Posted: Wed Sep 25, 2024 4:34 pm
by MicroController

Code: Select all

do stuff
if (done sending through I2C)
  start_sendig_I2c(512 bytes buffer)
do more stuff
Looks like your typical state machine to simulate multi-tasking. Try using the actual multi-tasking provided by FreeRTOS.