Skip to content

SPI Protocol

Serial Peripheral Interface (SPI) is a synchronous serial bus for short-distance communication between a controller and one or more targets. With AQPXLIB you create a bus, attach a controller and targets, and run clocked transfers.

Supported Features

  • Bus creation: Initialize SPI buses with configurable CLK, MISO, MOSI, and CS pins.
  • Controller: Full-duplex send_data and multi-segment send_transactions, with SCLK low and high time in ticks.
  • Targets: 32-bit register target and FIFO target with host enqueue and bus events.

Classes

Bus creation

Default channel mapping:

Channel Signal
CH0 CLK
CH1 MISO
CH2 MOSI
CH3 CS
from aqpxlib import AqProtocolExerciser
from aqpxlib.spi import PxSPIBus

with AqProtocolExerciser.connect(port=60600) as px:
    spi_bus = PxSPIBus(px)

Pass clk, miso, mosi, and cs to override individual channels.