Getting Started with PI-SPI Libraries
The PI-SPI series and the PI-SPi-DIN series of modules were designed to allow the user a simple way to create real world applications using the Raspberry Pi. Applications can have a mix of analog inputs and outputs, and digital inputs and outputs. Most of the modules use the SPI bus (Serial Peripheral Interface) and some use the I2C bus (Inter-integrated Circuit).
Widgetlords Electronics (VP Process Inc.) has released updated libraries on GitHub that allows for more than 2 chip selects and makes writing software for the PI-SPI series as easy as using "write" and "read" commands. The updated "libwidgetlords" library allows all modules to be used simultaneously without the user having to write any code for chip select manipulation.
The updated libwidgetlords libraries v2.1.2 now support the latest Raspberry Pi OS releases: "Trixie", "Bookworm" and "Bullseye" for the Raspberry Pi 5, 4 and earlier modules in both 64 bit and 32 bit versions.
Please note: The libwidgetlords libraries for the RPi 5 only support the "Trixie" and "Bookworm" OS.
Let's get started!
Here are the steps required to setup the libwidgetlords libraries:
1. The user is starting with a properly set up SD card and has the OS installed for their application.
2. In the configuration setup, ensure the "SPI", "I2C", and "Serial Port" functions are Enabled.
3. The latest releases can be found here:
https://github.com/
4. Download the libwidgetlords library for your specific Raspberry Pi module and OS
Raspberry Pi 5 32 bit OS
libwidgetlords_2.1.2_armhf_trixie.deb
libwidgetlords_2.1.2_armhf_bookworm.deb
Raspberry Pi 5 64 bit OS
libwidgetlords_2.1.2_arm64_trixie.deb
libwidgetlords_2.1.2_arm64_bookworm.deb
Raspberry Pi 4 and earlier 32 bit OS
libwidgetlords_2.1.2_armhf_trixie.deb
libwidgetlords_2.1.2_armhf_bookworm.deb
libwidgetlords_2.1.2_armhf_bullseye.deb
Raspberry Pi 4 and earlier 64 bit OS
libwidgetlords_2.1.2_arm64_trixie.deb
libwidgetlords_2.1.2_arm64_bookworm.deb
libwidgetlords_2.1.2_arm64_bullseye.deb
5. Install by running this command in a terminal window:
sudo dpkg -i libwidgetlords_2.1.2_armxx.deb
where xx is either "hf" or "64" depending on the 32 or 64 bit version of the library.
NOTE: If you have previously installed the library you must remove it first using
sudo apt remove libwidgetlords
6. Set the appropriate overlay in /boot/config.txt by adding the appropriate dtoverlay to the end of the file. For "Trixie" and "Bookworm" the location of the config.txt file is found in /boot/firmware/config.txt
Open the config file with
sudo nano /boot/firmware/config.txt
Scroll to the bottom of the file.
For the PI-SPI series add the following line:
dtoverlay=pi-spi
For the PI-SPI-DIN series add the following line:
dtoverlay=vpe-2701c
7. Reboot your raspberry pi with
sudo reboot
The libraries are now installed and you are good to go with programming your Widgetlords Electronics modules.