#[0x00, 0x00, 0x00]
import spi
import gpio
main:
bus := spi.Bus
--mosi=(gpio.Pin 23)
--clock=(gpio.Pin 18)
// For many boards GPIO9 is a restricted pin because it acesses the flash
// memory. That's not the case for this device.
device := bus.device
--cs=(gpio.Pin 9 --allow-restricted)
--dc=(gpio.Pin 15)
--frequency=4_000_000
device.write #[0x70]
revision := device.read 3
print "Read $revision"
device.write #[0x71]
status := device.read 1
print "Read $status"