qspi-controller

glasgow run qspi-controller

Initiate transactions on the extended variant of the SPI bus with four I/O channels.

This applet can control a wide range of devices, primarily memories, that use multi-bit variants of the SPI bus. Electrically, they are all compatible, with the names indicating differences in protocol logic:

  • “SPI” uses COPI/CIPO for both commands and data;

  • “dual-SPI” uses COPI/CIPO for commands and IO0/IO1 for data;

  • “quad-SPI” uses COPI/CIPO for commands and IO0/IO1/IO2/IO3 for data;

  • “QPI” uses IO0/IO1/IO2/IO3 for both commands and data.

In this list, COPI and CIPO refer to IO0 and IO1 respectively used as fixed direction I/O. Note that vendors often make further distinction between modes, e.g. between “dual output SPI” and “dual I/O SPI”; refer to the vendor documentation for details.

The command line interface only initiates SPI mode transfers. Use the REPL for other modes.

usage: glasgow run qspi-controller [-h] [-V SPEC] [--sck PIN] [--io PINS]
                                   [--cs PIN] [-f FREQ]
                                   DATA [DATA ...]
data

hex bytes to exchange with the device in SPI mode

-h, --help

show this help message and exit

-V <spec>, --voltage <spec>

configure I/O port voltage to SPEC (e.g.: ‘3.3’, ‘A=5.0,B=3.3’, ‘A=SA’)

--sck <pin>

bind the applet I/O line ‘sck’ to PIN (default: A0)

--io <pins>

bind the applet I/O lines ‘copi’, ‘cipo’, ‘io2’, ‘io3’ to PINS (default: A1,A2,A3,A4)

--cs <pin>

bind the applet I/O line ‘cs’ to PIN (default: A5)

-f <freq>, --frequency <freq>

set SCK frequency to FREQ kHz (default: 1000)