Simultaneous Access I2C from C ++ and C # Application in WEC

I’m using the Toradex I2C-library, which implements a mutex. Does this also work if I run two application, one written in C# and one written in C++?

Yes, mutexes are the right method to synchronize threads of different processes. It doesn’t matter which programming language you are using. The mutex is handled by the kernel, you are just calling an API from your code.

Consider also that single I2C operations (read/write) are synchronized at the driver level so you can’t have bytes from a request mixed with bytes from a different one on the I2C bus, even if mutexes are not locked. It’s anyway a good idea to use those because this will allow you to perform a set of operations (ex write to multiple registers) with no interruptions and avoid issues that could be generated by different components talking with the same device on the bus.

Thank you for the answers.

I took for granted that you were asking about the latest release of libs, the driver point is valid on i.mx6 and vybrid, using mutex would be safe on all platforms.
Sorry for the misunderstanding.