Re: multi-thread I2C synchronization
Posted: Sun Feb 14, 2021 4:26 pm
by MikeLemon
2+ Years later...
Is there a proper solution yet?
Re: multi-thread I2C synchronization
Posted: Tue Feb 16, 2021 11:18 pm
by PeterR
Like Wifi says, mutex. May add an extra mutex but cost is low and you can sleep safe.
Its not normal to use a device/driver from multiple threads. If the driver has to cover these RT bases then the driver would get fat and slow.
So best that these particular use/cases are handled at the application level.
Re: multi-thread I2C synchronization
Posted: Sat Nov 08, 2025 4:01 pm
by JakubKral
You could also use i2c manager to handle it for you. See
https://github.com/ropg/i2c_manager
Best regards