phatIOs SPI functionality provides ability to transfer data as a master to the SPI bus available on pins marked SCLK, MOSI, MISO.
phatIO uses the SPI bus for internal communication with the SD card, so code must configure the bus correctly before each transfer and devices must ensure they relinquish the bus after use.
There are a number of SPI examples in the Ideas section
(spi_conf <mode> <data direction> <clock divisor>)
Will configure phatIO’s SPI bus according to the arguments:
Because the SPI bus is used for Filesystem access, it must be reconfigured before each use.
(spi <byte> ...)
Evaluates each argument as an unsigned byte and sends on the SPI bus, returns the last byte received.
It is assumed that the bus was configured previously and a pin set high/low to enable a slave device.