Skip to main content

SPI

SPI builtin package that exposes functions to read, write, transfer buffers over SPI.

import { spi } from "@devicescript/spi"

await spi.configure({})

// write a few bytes
await spi.write(hex`abcd`)

// read 8 bytes
const resp = await spi.read(8)

// write and read a buffer
const resp2 = await spi.transfer(hex`abcd`)
caution

SPI is not yet implemented on RP2040.

See also