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

Support named buses #17

Closed
jabdoa2 opened this issue Jan 25, 2018 · 2 comments
Closed

Support named buses #17

jabdoa2 opened this issue Jan 25, 2018 · 2 comments

Comments

@jabdoa2
Copy link

jabdoa2 commented Jan 25, 2018

It would be nice to support named devices for USB-I2C adapters such as tiny-i2c-usb because their bus number will not be consistent between restarts. However, we can create symlinks using udev. Currently, I just symlink to /dev/i2c-my-bus1 and use "my-bus1" as bus id in smbus2. Works as a hack but it is probably not intended this way.

kplindegaard pushed a commit that referenced this issue Sep 1, 2019
* SMBus.__init__(), SMBus.open(): `bus` can be a file path as well (issue #17).
* Whole class i2c_msg_iter replaced by a simple generator function which has the same functionality
* Added enter/exit handler to `SMBus` class.
* Added i2c_write and i2c_read, some very basic and most simple read/write operations.
* Additional test cases
@kplindegaard
Copy link
Owner

Above mentioned PR lets you provide the full path, i.e. you can choose between bus number (int) and a string containing a full path.

@jabdoa2
Copy link
Author

jabdoa2 commented Sep 1, 2019

Awesome thanks!

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