## CMSIS SPI Driver Macro Definition Documentation

### ARM_SPI_API_VERSION

#define ARM_SPI_API_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(2,2)

SPI API version.

Location: Driver_SPI.h:69

### ARM_SPI_CONTROL_Pos

#define ARM_SPI_CONTROL_Pos 0

Position of the 0th bit of the SPI Control field in the ARM_SPI structure.

Location: Driver_SPI.h:74

### ARM_SPI_CONTROL_Msk

#define ARM_SPI_CONTROL_Msk (0xFFUL << ARM_SPI_CONTROL_Pos)

Positioning of SPI Control field in the ARM_SPI structure.

Location: Driver_SPI.h:75

### ARM_SPI_MODE_INACTIVE

#define ARM_SPI_MODE_INACTIVE (0x00UL << ARM_SPI_CONTROL_Pos)

SPI Inactive.

Location: Driver_SPI.h:78

### ARM_SPI_MODE_MASTER

#define ARM_SPI_MODE_MASTER (0x01UL << ARM_SPI_CONTROL_Pos)

SPI Master (Output on MOSI, Input on MISO); arg = Bus Speed in bps.

Location: Driver_SPI.h:79

### ARM_SPI_MODE_SLAVE

#define ARM_SPI_MODE_SLAVE (0x02UL << ARM_SPI_CONTROL_Pos)

SPI Slave (Output on MISO, Input on MOSI).

Location: Driver_SPI.h:80

### ARM_SPI_MODE_MASTER_SIMPLEX

#define ARM_SPI_MODE_MASTER_SIMPLEX (0x03UL << ARM_SPI_CONTROL_Pos)

SPI Master (Output/Input on MOSI); arg = Bus Speed in bps.

Location: Driver_SPI.h:81

### ARM_SPI_MODE_SLAVE_SIMPLEX

#define ARM_SPI_MODE_SLAVE_SIMPLEX (0x04UL << ARM_SPI_CONTROL_Pos)

SPI Slave (Output/Input on MISO).

Location: Driver_SPI.h:82

### ARM_SPI_FRAME_FORMAT_Pos

#define ARM_SPI_FRAME_FORMAT_Pos 8

Position of the 0th bit of the Frame format field in the ARM_SPI structure.

Location: Driver_SPI.h:85

### ARM_SPI_FRAME_FORMAT_Msk

#define ARM_SPI_FRAME_FORMAT_Msk (7UL << ARM_SPI_FRAME_FORMAT_Pos)

Positioning of Frame format field in the ARM_SPI structure.

Location: Driver_SPI.h:86

### ARM_SPI_CPOL0_CPHA0

#define ARM_SPI_CPOL0_CPHA0 (0UL << ARM_SPI_FRAME_FORMAT_Pos)

Clock Polarity 0, Clock Phase 0 (default).

Location: Driver_SPI.h:87

### ARM_SPI_CPOL0_CPHA1

#define ARM_SPI_CPOL0_CPHA1 (1UL << ARM_SPI_FRAME_FORMAT_Pos)

Clock Polarity 0, Clock Phase 1.

Location: Driver_SPI.h:88

### ARM_SPI_CPOL1_CPHA0

#define ARM_SPI_CPOL1_CPHA0 (2UL << ARM_SPI_FRAME_FORMAT_Pos)

Clock Polarity 1, Clock Phase 0.

Location: Driver_SPI.h:89

### ARM_SPI_CPOL1_CPHA1

#define ARM_SPI_CPOL1_CPHA1 (3UL << ARM_SPI_FRAME_FORMAT_Pos)

Clock Polarity 1, Clock Phase 1.

Location: Driver_SPI.h:90

### ARM_SPI_TI_SSI

#define ARM_SPI_TI_SSI (4UL << ARM_SPI_FRAME_FORMAT_Pos)

Texas Instruments Frame Format.

Location: Driver_SPI.h:91

### ARM_SPI_MICROWIRE

#define ARM_SPI_MICROWIRE (5UL << ARM_SPI_FRAME_FORMAT_Pos)

National Microwire Frame Format.

Location: Driver_SPI.h:92

### ARM_SPI_DATA_BITS_Pos

#define ARM_SPI_DATA_BITS_Pos 12

Position of the 0th bit of the Data bits field in the ARM_SPI structure.

Location: Driver_SPI.h:95

### ARM_SPI_DATA_BITS_Msk

#define ARM_SPI_DATA_BITS_Msk (0x3FUL << ARM_SPI_DATA_BITS_Pos)

Positioning of the Data bits field in the ARM_SPI structure.

Location: Driver_SPI.h:96

### ARM_SPI_DATA_BITS

#define ARM_SPI_DATA_BITS (((n) & 0x3F) << ARM_SPI_DATA_BITS_Pos)

Number of Data bits.

Location: Driver_SPI.h:97

### ARM_SPI_BIT_ORDER_Pos

#define ARM_SPI_BIT_ORDER_Pos 18

Position of the 0th bit of the Bit order field in the ARM_SPI structure.

Location: Driver_SPI.h:100

### ARM_SPI_BIT_ORDER_Msk

#define ARM_SPI_BIT_ORDER_Msk (1UL << ARM_SPI_BIT_ORDER_Pos)

Positioning of the Bit order field in the ARM_SPI structure.

Location: Driver_SPI.h:101

### ARM_SPI_MSB_LSB

#define ARM_SPI_MSB_LSB (0UL << ARM_SPI_BIT_ORDER_Pos)

SPI Bit order from MSB to LSB (default).

Location: Driver_SPI.h:102

### ARM_SPI_LSB_MSB

#define ARM_SPI_LSB_MSB (1UL << ARM_SPI_BIT_ORDER_Pos)

SPI Bit order from LSB to MSB.

Location: Driver_SPI.h:103

### ARM_SPI_SS_MASTER_MODE_Pos

#define ARM_SPI_SS_MASTER_MODE_Pos 19

Position of the 0th bit of the Slave Select Master Mode field in the ARM_SPI structure.

Location: Driver_SPI.h:106

### ARM_SPI_SS_MASTER_MODE_Msk

#define ARM_SPI_SS_MASTER_MODE_Msk (3UL << ARM_SPI_SS_MASTER_MODE_Pos)

Positioning of the Slave Select Master Mode field in the ARM_SPI structure.

Location: Driver_SPI.h:107

### ARM_SPI_SS_MASTER_UNUSED

#define ARM_SPI_SS_MASTER_UNUSED (0UL << ARM_SPI_SS_MASTER_MODE_Pos)

SPI Slave Select when Master: Not used (default).

Location: Driver_SPI.h:108

### ARM_SPI_SS_MASTER_SW

#define ARM_SPI_SS_MASTER_SW (1UL << ARM_SPI_SS_MASTER_MODE_Pos)

SPI Slave Select when Master: Software controlled.

Location: Driver_SPI.h:109

### ARM_SPI_SS_MASTER_HW_OUTPUT

#define ARM_SPI_SS_MASTER_HW_OUTPUT (2UL << ARM_SPI_SS_MASTER_MODE_Pos)

SPI Slave Select when Master: Hardware controlled Output.

Location: Driver_SPI.h:110

### ARM_SPI_SS_MASTER_HW_INPUT

#define ARM_SPI_SS_MASTER_HW_INPUT (3UL << ARM_SPI_SS_MASTER_MODE_Pos)

SPI Slave Select when Master: Hardware monitored Input.

Location: Driver_SPI.h:111

### ARM_SPI_SS_SLAVE_MODE_Pos

#define ARM_SPI_SS_SLAVE_MODE_Pos 21

Position of the 0th bit of the Slave Select Slave Mode field in the ARM_SPI structure.

Location: Driver_SPI.h:112

### ARM_SPI_SS_SLAVE_MODE_Msk

#define ARM_SPI_SS_SLAVE_MODE_Msk (1UL << ARM_SPI_SS_SLAVE_MODE_Pos)

Positioning of the Slave Select Slave mode field in the ARM_SPI structure.

Location: Driver_SPI.h:113

### ARM_SPI_SS_SLAVE_HW

#define ARM_SPI_SS_SLAVE_HW (0UL << ARM_SPI_SS_SLAVE_MODE_Pos)

SPI Slave Select when Slave: Hardware monitored (default).

Location: Driver_SPI.h:114

### ARM_SPI_SS_SLAVE_SW

#define ARM_SPI_SS_SLAVE_SW (1UL << ARM_SPI_SS_SLAVE_MODE_Pos)

SPI Slave Select when Slave: Software controlled.

Location: Driver_SPI.h:115

### ARM_SPI_SET_BUS_SPEED

#define ARM_SPI_SET_BUS_SPEED (0x10UL << ARM_SPI_CONTROL_Pos)

Set Bus Speed in bps; arg = value.

Location: Driver_SPI.h:119

### ARM_SPI_GET_BUS_SPEED

#define ARM_SPI_GET_BUS_SPEED (0x11UL << ARM_SPI_CONTROL_Pos)

Get Bus Speed in bps.

Location: Driver_SPI.h:120

### ARM_SPI_SET_DEFAULT_TX_VALUE

#define ARM_SPI_SET_DEFAULT_TX_VALUE (0x12UL << ARM_SPI_CONTROL_Pos)

Set default Transmit value; arg = value.

Location: Driver_SPI.h:121

### ARM_SPI_CONTROL_SS

#define ARM_SPI_CONTROL_SS (0x13UL << ARM_SPI_CONTROL_Pos)

Control Slave Select; arg: 0=inactive, 1=active.

Location: Driver_SPI.h:122

### ARM_SPI_ABORT_TRANSFER

#define ARM_SPI_ABORT_TRANSFER (0x14UL << ARM_SPI_CONTROL_Pos)

Abort current data transfer.

Location: Driver_SPI.h:123

### ARM_SPI_SS_INACTIVE

#define ARM_SPI_SS_INACTIVE 0

SPI Slave Select Signal Inactive.

Location: Driver_SPI.h:127

### ARM_SPI_SS_ACTIVE

#define ARM_SPI_SS_ACTIVE 1

SPI Slave Select Signal Active.

Location: Driver_SPI.h:128

### ARM_SPI_ERROR_MODE

#define ARM_SPI_ERROR_MODE (ARM_DRIVER_ERROR_SPECIFIC - 1)

Specified Mode not supported.

Location: Driver_SPI.h:132

### ARM_SPI_ERROR_FRAME_FORMAT

#define ARM_SPI_ERROR_FRAME_FORMAT (ARM_DRIVER_ERROR_SPECIFIC - 2)

Specified Frame Format not supported.

Location: Driver_SPI.h:133

### ARM_SPI_ERROR_DATA_BITS

#define ARM_SPI_ERROR_DATA_BITS (ARM_DRIVER_ERROR_SPECIFIC - 3)

Specified number of Data bits not supported.

Location: Driver_SPI.h:134

### ARM_SPI_ERROR_BIT_ORDER

#define ARM_SPI_ERROR_BIT_ORDER (ARM_DRIVER_ERROR_SPECIFIC - 4)

Specified Bit order not supported.

Location: Driver_SPI.h:135

### ARM_SPI_ERROR_SS_MODE

#define ARM_SPI_ERROR_SS_MODE (ARM_DRIVER_ERROR_SPECIFIC - 5)

Specified Slave Select Mode not supported.

Location: Driver_SPI.h:136

### ARM_SPI_EVENT_TRANSFER_COMPLETE

#define ARM_SPI_EVENT_TRANSFER_COMPLETE (1UL << 0)

SPI Event

Data Transfer completed.

Location: Driver_SPI.h:152

### ARM_SPI_EVENT_DATA_LOST

#define ARM_SPI_EVENT_DATA_LOST (1UL << 1)

Data lost: Receive overflow / Transmit underflow.

Location: Driver_SPI.h:153

### ARM_SPI_EVENT_MODE_FAULT

#define ARM_SPI_EVENT_MODE_FAULT (1UL << 2)

Master Mode Fault (SS deactivated when Master).

Location: Driver_SPI.h:154