This is a Linux kernel module intended to facilitate communication with the MAX7219 LED controller. I wrote this to learn more about Linux device drivers.
To initialize the spi device in the devicetree on my raspberry pi, I run make
, then sudo cp max7219-spi /boot/overlay/
to copy the generated .dtbo to the /boot/overlays/ directory.
For raspberry pi, the dtoverlay
command loads and unloads overlays during runtime. Also, you can add dtoverlay=spi-max7219
to your /boot/config.txt.
After loading the overlay, you should be able to do sudo insmod max7219-spi-ob.ko
to install the driver. You can remove it with sudo rmmod spi_max7219_ob
.
If you are using another vendor's hardware, do your research on how to load out of tree kernel modules.
- Figure out how to drop all build artifacts into a separate directory
- Figure out the -d command of dtoverlay and flesh out install section with that.