The I2CDevice and SPIDevice helper classes make managing transaction state on a bus easy. For example, they manage locking the bus to prevent other concurrent access. For SPI devices, it manages the chip select and protocol changes such as mode. For I2C, it manages the device address.
This library is NOT built into CircuitPython to make it easy to update. To install it either follow the directions below or install the library bundle.
To install:
- Download and unzip the latest release zip.
- Copy the unzipped
adafruit_bus_deviceto thelibdirectory on theCIRCUITPYdrive.
See examples/read_register_i2c.py and examples/read_register_spi.py for examples of the module's usage.
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
For information on building library documentation, please check out this guide.