Home Documentation Tutorials API GitHub


The Spi API allows you to communicate over serial SPI interfaces.


Invoke Spi.open to open a SPI interface with a given SpiConfig. Transfer and receive data using the transfer method:

spi  := Spi.open("spidev1.0", SpiConfig {})
data := Buf().writeI4(0x1234_abcd)
resp := spi.transfer(data)

Once you are finished with a port, call close to free the backing native process.