Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility of i2c_manager with other components in the project. #173

Open
SinglWolf opened this issue Jan 19, 2022 · 1 comment
Open

Comments

@SinglWolf
Copy link

In my project, I use several devices that are controlled via I2C. The i2cdev component is used to resolve multithreading conflicts.
I decided to implement ssd1306 display support in my project. In this regard, I have a few questions.
The most rational option is to abandon the vanilla i2cdev component and use 1 i2c_manager component in i2cdev compatibility mode.
But, as I understood from the i2c_manager documentation, i2c_manager does not support separate clock frequency settings for each device.
I have devices that operate at 100kHz, 400kHz and 1MHz. What should I do if i2c_manager is used? Set the maximum frequency to 1MHz?
Will devices with a maximum frequency of, for example, 100kHz work?
If I install i2c_manager for the entire project, how do I set the ssd1306 driver to work properly if i2c_manager runs in i2cdev compatibility mode?

@mkfrey
Copy link

mkfrey commented Jan 30, 2022

The I2C drivers of ESP-IDF do not allow for different frequencies on the same I2C port. So if you are using the same port, you will have to use the frequency of the slave with the lowest frequency. Using higher frequencies on the bus doesn't make sense, because it can lead to unspecified behaviour of the devices not supporting the frequency.

If you use a different port (with different GPIO nums), you can act independently of the LVGL driver and implement your own thread safety mechanisms, but you will still need to use the lowest frequency supported by all of the devices on the same port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants