generic<C: SpiChip> struct SpiDevice {
&volatile unsigned int base;
int mode;
C chip;
}Fields
MMIO base address
SPI mode (0-3)
Methods
Initialize an SPI master at base with the given mode; the chip type
comes from the target.
Transfer one byte (full-duplex). Returns the received byte.
Assert chip select (drive low).
Deassert chip select (drive high).
Transfer tx (full-duplex); rx, when given, receives the incoming
bytes (up to rx.len of them).
Fill rx (sends 0xFF as dummy TX).