SPI Constants

This page aggregates all SPI-related constants used by functions and methods from the C and C++ APIs.

group SPI-related constants

SPI Target Mode

Enumerations selecting the behavior of the device while acting as an SPI target.

enum SpiTargetModel

Device emulation model presented on the bus while in SPI target mode.

Values:

enumerator SPI_TARGET_MODEL_MEMORY

Full-duplex arena with an auto-incrementing pointer.

enumerator SPI_TARGET_MODEL_FLASH

25-series SPI-flash command set (opcode + address + data).

enumerator SPI_TARGET_MODEL_REGISTER_MAP

SPI-sensor convention: R/W bit + register address, then streamed.

enum SpiTargetEngine

Service engine for the MEMORY model (ignored by FLASH/REGISTER_MAP, which are always ISR-driven).

Values:

enumerator SPI_TARGET_ENGINE_DMA

Hardware-serviced via a gapless descriptor chain (default, fastest).

enumerator SPI_TARGET_ENGINE_ISR

Interrupt-serviced; frees the DMA channels for other use.

Enums

enum SpiBitOrder

This enum represents the SPI bit transmission order.

Values:

enumerator SPI_BIT_ORDER_MSB

Most Significant Bit first

enumerator SPI_BIT_ORDER_LSB

Least Significant Bit first

enum SpiMode

This enum represents the SPI clock polarity and phase modes.

Values:

enumerator SPI_MODE_0

CPOL = 0, CPHA = 0

enumerator SPI_MODE_1

CPOL = 0, CPHA = 1

enumerator SPI_MODE_2

CPOL = 1, CPHA = 0

enumerator SPI_MODE_3

CPOL = 1, CPHA = 1

enum SpiDataWidth

This enum represents the SPI data word size.

Values:

enumerator SPI_DATA_WIDTH_8_BITS

8-bit data width

enumerator SPI_DATA_WIDTH_16_BITS

16-bit data width

enum SpiChipSelect

This enum represents the available SPI chip select lines.

Values:

enumerator SPI_CHIP_SELECT_0

Chip select line 0

enumerator SPI_CHIP_SELECT_1

Chip select line 1

enumerator SPI_CHIP_SELECT_2

Chip select line 2

enumerator SPI_CHIP_SELECT_3

Chip select line 3

enum SpiChipSelectPolarity

This enum represents the SPI chip select active polarity.

Values:

enumerator SPI_CS_ACTIVE_LOW

Chip select is active low

enumerator SPI_CS_ACTIVE_HIGH

Chip select is active high