Since I’m planning on using some of the Adafruit Python libraries for my CHIP project, I decided to add support for the CHIP in their GPIO library.
I forked their repo and added support for GPIO (CSI0-7 and XIOP0-7) and I2C; SPI and PWM are not. I don’t have any devices that use SPI or PWM, nor do they show up in CHIPs Debian GUI image.
Edge detection and GPIO callbacks are not implemented at this moment.
I verified that the GPIO functions work for setup, input, and cleanup. I don’t have anything hooked up to write too, but it should work. I haven’t tested the I2C code, but all I did was add support for getting the default I2C bus.
Repo is here:
You also need to install CHIP_IO: https://github.com/xtacocorex/CHIP_IO
I plan on submitting a pull request to get this merged into Adafruits’ repo.
Scripts created with this library that control the GPIO pins need to be run with root permissions.
- GPIO: Total control of GPIO through CHIP_IO
- I2C: Control of i2c devices through python-smbus (in the future it will be with Adafruits native python i2c library)
The default I2C bus is now i2c-2 as i2c-1 was removed in OS 1.1 (4.4 Kernel)
- SPI: Control of SPI devices through python-spidev (with appropriate DTB setup)
- PWM: Control of the Hardware PWM (with appropriate DTB setup) and Software PWM through CHIP_IO