Ondřej Hruška 6 years ago
parent 89b2cfc1dd
commit ba4bc2bf96
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 3
      README.md
  2. 40
      UNIT_SPI.md

@ -13,6 +13,7 @@ This repository specifies the control protocol implemented by [gex-core](https:/
- [UNIT_DO.md](UNIT_DO.md) - Digital Output
- [UNIT_DI.md](UNIT_DI.md) - Digital Input
- [UNIT_NEOPIXEL.md](UNIT_NEOPIXEL.md) - NeoPixel driver
- [UNIT_SIPO.md](UNIT_SIPO.md) - Multi-cast Shift Register Driver
- [UNIT_SIPO.md](UNIT_SIPO.md) - Shift Register Driver with multicast support
- [UNIT_I2C.md](UNIT_I2C.md) - I2C master
- [UNIT_SPI.md](UNIT_SPI.md) - SPI master up to 16 slaves and multicast support

@ -0,0 +1,40 @@
# SPI master
- Can drive shift registers or communicate with any SPI based devices.
- Configurable speed, polarity and phase
- Up to 16 slave select signals
- Supports multicast (write to multiple slaves at once)
*NOTE:* To use Multicast with bi-directionally connected devices, the MISO pins should be
connected through protection resistors to prevent a short circuit on signal collision.
## Commands
### QUERY (0x00)
Write and read some bytes.
The write and read sections can overlap if needed; some devices use this
to report a status word while the command is being written. 0x00 is output on MOSI while collecting a response.
If the overlap is not desired (first write, then read), set the number of discarded
bytes equal to the number of written bytes.
*Request:*
- u8 - slave number 0-16
- u16 - number of discarded MISO bytes before collecting the response
- u16 - response length (bytes)
- u8[] - bytes to write
*Response:*
- u8[] - received bytes
### MULTICAST (0x01)
*Request:*
- u16 - slaves (packed)
- u8[] - bytes to write
## Events
*No events defined for this unit type.*
Loading…
Cancel
Save