SpiSlave
Software implementation of SPI slave mode for Raspberry Pi
Install / Use
/learn @anetczuk/SpiSlaveREADME
SpiSlave
Implementation of slave mode of SPI bus for Raspberry Pi.
Library can be used for example to mock slave node during implementation or testing of master node.
Requirements
- Python 2.7
- Raspberry Pi with RPi.GPIO module
Limitations
- transmission of 8-bit words only,
- no driver support, so high frequencies can be an issue
Details
This is software implementation of SPI bus. As hardware layer it uses Raspberry Pi's GPIO pins.
Module is prepared to operate in two modes: supporting and without SS line. NoSS mode is useful in case when there is only one slave, so SS pin can be used for other purpose.
Unit tests can be run by test_runner.py script. No GPIO module needed.
Classes
- pinaccess.PinAccess - dummy accessor to wires,
- rpigpioaccess.RPiGPIOAccess - accessor to RPi's GPIO pins,
- spidevice.SpiAbstractDevice - abstract representation of device,
- spidevice.SpiDevice - implementation of transmitter,
- protocol.SSProtocol - implementation of SPI 8-bit word transmission prototcol,
- protocol.NoSSProtocol - alternative 8-bit word transmission prototcol without use of SS line
Examples
- examples.echoclient - simple client receiving data from master and sending number sequences,
- examples.gpio - another implementation of client sending sequence of numbers
References
- https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus - description of SPI bus,
- Python Spidev - Python bindings for Linux SPI access through spidev, master mode only
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
