wire / wire-format / spi-protocol
SPI is a 4-wire synchronous serial bus: SCLK (clock), MOSI (master out slave in), MISO (master in slave out), CS (chip select). Communication: master asserts CS (low), toggles SCLK, sends data on MOSI, receives data on MISO. No addressing (CS selects the slave). No ACK. Full-duplex (simultaneous send/receive).
aka: SPI (Serial Peripheral Interface) protocol
spec: SPI specification
SPI is a 4-wire synchronous serial bus: SCLK (clock), MOSI (master out slave in), MISO (master in slave out), CS (chip select). Communication: master asserts CS (low), toggles SCLK, sends data on MOSI, receives data on MISO. No addressing (CS selects the slave). No ACK. Full-duplex (simultaneous send/receive).
| field | size | meaning |
|---|---|---|
| SCLK | clock | Serial clock, generated by the master. Frequency up to tens of MHz. |
| MOSI | data | Master Out Slave In: data from master to slave. |
| MISO | data | Master In Slave Out: data from slave to master. |
| CS (SS) | control | Chip Select (Slave Select): active low. Master asserts CS to select a slave. |
| CPOL | mode | Clock Polarity: 0 = clock idle low, 1 = clock idle high. |
| CPHA | mode | Clock Phase: 0 = sample on leading edge, 1 = sample on trailing edge. |
| Mode 0 | CPOL=0, CPHA=0 | Clock idle low, sample on rising edge. |
| Mode 1 | CPOL=0, CPHA=1 | Clock idle low, sample on falling edge. |
| Mode 2 | CPOL=1, CPHA=0 | Clock idle high, sample on falling edge. |
| Mode 3 | CPOL=1, CPHA=1 | Clock idle high, sample on rising edge. |
| MSB/LSB first | config | Most SPI devices use MSB-first. Some use LSB-first. |
example:
00 00
SPI: two zero bytes (no standard wire format; shown as placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/spi-protocol
or /wire-format/spi-protocol.json