When working with I2C and SPI-enabled devices, you will encounter the SPIDev and SMBus libraries (or comparable alternatives). SPIDev is a popular lower-level Python library for use with SPI communications, while SMBus2 is a popular lower-level Python library for use with I2C and SMBus communication. These two libraries are not general-purpose libraries—they cannot be used for basic digital I/O pin control.
When starting out, it is unlikely that you will want or need to use I2C or SPI libraries such as these directly. Instead, you will use higher-level Python libraries to work with an SPI- or I2C-enabled device that, underneath, would be using lower-level libraries like these to communicate with the physical device.
Here are the key highlights of SPIDev and SMBus2 in a nutshell:
- Description: These are lower-level libraries for SPI and I2C interfacing.
- Pros: Using a lower-level library...