STM32F4xx_HAL_Driver  1.8.3
SPI Exported Types
+ Collaboration diagram for SPI Exported Types:

Data Structures

struct  SPI_InitTypeDef
 SPI Configuration Structure definition. More...
 
struct  __SPI_HandleTypeDef
 SPI handle Structure definition. More...
 

Typedefs

typedef struct __SPI_HandleTypeDef SPI_HandleTypeDef
 SPI handle Structure definition.
 
typedef void(* pSPI_CallbackTypeDef) (SPI_HandleTypeDef *hspi)
 HAL SPI Callback pointer definition. More...
 

Enumerations

enum  HAL_SPI_StateTypeDef {
  HAL_SPI_STATE_RESET = 0x00U , HAL_SPI_STATE_READY = 0x01U , HAL_SPI_STATE_BUSY = 0x02U , HAL_SPI_STATE_BUSY_TX = 0x03U ,
  HAL_SPI_STATE_BUSY_RX = 0x04U , HAL_SPI_STATE_BUSY_TX_RX = 0x05U , HAL_SPI_STATE_ERROR = 0x06U , HAL_SPI_STATE_ABORT = 0x07U
}
 HAL SPI State structure definition. More...
 
enum  HAL_SPI_CallbackIDTypeDef {
  HAL_SPI_TX_COMPLETE_CB_ID = 0x00U , HAL_SPI_RX_COMPLETE_CB_ID = 0x01U , HAL_SPI_TX_RX_COMPLETE_CB_ID = 0x02U , HAL_SPI_TX_HALF_COMPLETE_CB_ID = 0x03U ,
  HAL_SPI_RX_HALF_COMPLETE_CB_ID = 0x04U , HAL_SPI_TX_RX_HALF_COMPLETE_CB_ID = 0x05U , HAL_SPI_ERROR_CB_ID = 0x06U , HAL_SPI_ABORT_CB_ID = 0x07U ,
  HAL_SPI_MSPINIT_CB_ID = 0x08U , HAL_SPI_MSPDEINIT_CB_ID = 0x09U
}
 HAL SPI Callback ID enumeration definition. More...
 

Detailed Description


Data Structure Documentation

◆ SPI_InitTypeDef

struct SPI_InitTypeDef

SPI Configuration Structure definition.

Definition at line 46 of file stm32f4xx_hal_spi.h.

Data Fields
uint32_t BaudRatePrescaler

Specifies the Baud Rate prescaler value which will be used to configure the transmit and receive SCK clock. This parameter can be a value of SPI BaudRate Prescaler

Note
The communication clock is derived from the master clock. The slave clock does not need to be set.
uint32_t CLKPhase

Specifies the clock active edge for the bit capture. This parameter can be a value of SPI Clock Phase

uint32_t CLKPolarity

Specifies the serial clock steady state. This parameter can be a value of SPI Clock Polarity

uint32_t CRCCalculation

Specifies if the CRC calculation is enabled or not. This parameter can be a value of SPI CRC Calculation

uint32_t CRCPolynomial

Specifies the polynomial used for the CRC calculation. This parameter must be an odd number between Min_Data = 1 and Max_Data = 65535

uint32_t DataSize

Specifies the SPI data size. This parameter can be a value of SPI Data Size

uint32_t Direction

Specifies the SPI bidirectional mode state. This parameter can be a value of SPI Direction Mode

uint32_t FirstBit

Specifies whether data transfers start from MSB or LSB bit. This parameter can be a value of SPI MSB LSB Transmission

uint32_t Mode

Specifies the SPI operating mode. This parameter can be a value of SPI Mode

uint32_t NSS

Specifies whether the NSS signal is managed by hardware (NSS pin) or by software using the SSI bit. This parameter can be a value of SPI Slave Select Management

uint32_t TIMode

Specifies if the TI mode is enabled or not. This parameter can be a value of SPI TI Mode

◆ __SPI_HandleTypeDef

struct __SPI_HandleTypeDef

SPI handle Structure definition.

Definition at line 104 of file stm32f4xx_hal_spi.h.

+ Collaboration diagram for __SPI_HandleTypeDef:

Data Fields

SPI_TypeDef * Instance
 
SPI_InitTypeDef Init
 
const uint8_t * pTxBuffPtr
 
uint16_t TxXferSize
 
__IO uint16_t TxXferCount
 
uint8_t * pRxBuffPtr
 
uint16_t RxXferSize
 
__IO uint16_t RxXferCount
 
void(* RxISR )(struct __SPI_HandleTypeDef *hspi)
 
void(* TxISR )(struct __SPI_HandleTypeDef *hspi)
 
DMA_HandleTypeDefhdmatx
 
DMA_HandleTypeDefhdmarx
 
HAL_LockTypeDef Lock
 
__IO HAL_SPI_StateTypeDef State
 
__IO uint32_t ErrorCode
 
void(* TxCpltCallback )(struct __SPI_HandleTypeDef *hspi)
 
void(* RxCpltCallback )(struct __SPI_HandleTypeDef *hspi)
 
void(* TxRxCpltCallback )(struct __SPI_HandleTypeDef *hspi)
 
void(* TxHalfCpltCallback )(struct __SPI_HandleTypeDef *hspi)
 
void(* RxHalfCpltCallback )(struct __SPI_HandleTypeDef *hspi)
 
void(* TxRxHalfCpltCallback )(struct __SPI_HandleTypeDef *hspi)
 
void(* ErrorCallback )(struct __SPI_HandleTypeDef *hspi)
 
void(* AbortCpltCallback )(struct __SPI_HandleTypeDef *hspi)
 
void(* MspInitCallback )(struct __SPI_HandleTypeDef *hspi)
 
void(* MspDeInitCallback )(struct __SPI_HandleTypeDef *hspi)
 

Field Documentation

◆ AbortCpltCallback

void(* __SPI_HandleTypeDef::AbortCpltCallback) (struct __SPI_HandleTypeDef *hspi)

SPI Abort callback

Definition at line 144 of file stm32f4xx_hal_spi.h.

◆ ErrorCallback

void(* __SPI_HandleTypeDef::ErrorCallback) (struct __SPI_HandleTypeDef *hspi)

SPI Error callback

Definition at line 143 of file stm32f4xx_hal_spi.h.

◆ ErrorCode

__IO uint32_t __SPI_HandleTypeDef::ErrorCode

SPI Error code

Definition at line 134 of file stm32f4xx_hal_spi.h.

◆ hdmarx

DMA_HandleTypeDef* __SPI_HandleTypeDef::hdmarx

SPI Rx DMA Handle parameters

Definition at line 128 of file stm32f4xx_hal_spi.h.

◆ hdmatx

DMA_HandleTypeDef* __SPI_HandleTypeDef::hdmatx

SPI Tx DMA Handle parameters

Definition at line 126 of file stm32f4xx_hal_spi.h.

◆ Init

SPI_InitTypeDef __SPI_HandleTypeDef::Init

SPI communication parameters

Definition at line 108 of file stm32f4xx_hal_spi.h.

◆ Instance

SPI_TypeDef* __SPI_HandleTypeDef::Instance

SPI registers base address

Definition at line 106 of file stm32f4xx_hal_spi.h.

◆ Lock

HAL_LockTypeDef __SPI_HandleTypeDef::Lock

Locking object

Definition at line 130 of file stm32f4xx_hal_spi.h.

◆ MspDeInitCallback

void(* __SPI_HandleTypeDef::MspDeInitCallback) (struct __SPI_HandleTypeDef *hspi)

SPI Msp DeInit callback

Definition at line 146 of file stm32f4xx_hal_spi.h.

◆ MspInitCallback

void(* __SPI_HandleTypeDef::MspInitCallback) (struct __SPI_HandleTypeDef *hspi)

SPI Msp Init callback

Definition at line 145 of file stm32f4xx_hal_spi.h.

◆ pRxBuffPtr

uint8_t* __SPI_HandleTypeDef::pRxBuffPtr

Pointer to SPI Rx transfer Buffer

Definition at line 116 of file stm32f4xx_hal_spi.h.

◆ pTxBuffPtr

const uint8_t* __SPI_HandleTypeDef::pTxBuffPtr

Pointer to SPI Tx transfer Buffer

Definition at line 110 of file stm32f4xx_hal_spi.h.

◆ RxCpltCallback

void(* __SPI_HandleTypeDef::RxCpltCallback) (struct __SPI_HandleTypeDef *hspi)

SPI Rx Completed callback

Definition at line 138 of file stm32f4xx_hal_spi.h.

◆ RxHalfCpltCallback

void(* __SPI_HandleTypeDef::RxHalfCpltCallback) (struct __SPI_HandleTypeDef *hspi)

SPI Rx Half Completed callback

Definition at line 141 of file stm32f4xx_hal_spi.h.

◆ RxISR

void(* __SPI_HandleTypeDef::RxISR) (struct __SPI_HandleTypeDef *hspi)

function pointer on Rx ISR

Definition at line 122 of file stm32f4xx_hal_spi.h.

◆ RxXferCount

__IO uint16_t __SPI_HandleTypeDef::RxXferCount

SPI Rx Transfer Counter

Definition at line 120 of file stm32f4xx_hal_spi.h.

◆ RxXferSize

uint16_t __SPI_HandleTypeDef::RxXferSize

SPI Rx Transfer size

Definition at line 118 of file stm32f4xx_hal_spi.h.

◆ State

__IO HAL_SPI_StateTypeDef __SPI_HandleTypeDef::State

SPI communication state

Definition at line 132 of file stm32f4xx_hal_spi.h.

◆ TxCpltCallback

void(* __SPI_HandleTypeDef::TxCpltCallback) (struct __SPI_HandleTypeDef *hspi)

SPI Tx Completed callback

Definition at line 137 of file stm32f4xx_hal_spi.h.

◆ TxHalfCpltCallback

void(* __SPI_HandleTypeDef::TxHalfCpltCallback) (struct __SPI_HandleTypeDef *hspi)

SPI Tx Half Completed callback

Definition at line 140 of file stm32f4xx_hal_spi.h.

◆ TxISR

void(* __SPI_HandleTypeDef::TxISR) (struct __SPI_HandleTypeDef *hspi)

function pointer on Tx ISR

Definition at line 124 of file stm32f4xx_hal_spi.h.

◆ TxRxCpltCallback

void(* __SPI_HandleTypeDef::TxRxCpltCallback) (struct __SPI_HandleTypeDef *hspi)

SPI TxRx Completed callback

Definition at line 139 of file stm32f4xx_hal_spi.h.

◆ TxRxHalfCpltCallback

void(* __SPI_HandleTypeDef::TxRxHalfCpltCallback) (struct __SPI_HandleTypeDef *hspi)

SPI TxRx Half Completed callback

Definition at line 142 of file stm32f4xx_hal_spi.h.

◆ TxXferCount

__IO uint16_t __SPI_HandleTypeDef::TxXferCount

SPI Tx Transfer Counter

Definition at line 114 of file stm32f4xx_hal_spi.h.

◆ TxXferSize

uint16_t __SPI_HandleTypeDef::TxXferSize

SPI Tx Transfer size

Definition at line 112 of file stm32f4xx_hal_spi.h.

Typedef Documentation

◆ pSPI_CallbackTypeDef

typedef void(* pSPI_CallbackTypeDef) (SPI_HandleTypeDef *hspi)

HAL SPI Callback pointer definition.

pointer to an SPI callback function

Definition at line 173 of file stm32f4xx_hal_spi.h.

Enumeration Type Documentation

◆ HAL_SPI_CallbackIDTypeDef

HAL SPI Callback ID enumeration definition.

Enumerator
HAL_SPI_TX_COMPLETE_CB_ID 

SPI Tx Completed callback ID

HAL_SPI_RX_COMPLETE_CB_ID 

SPI Rx Completed callback ID

HAL_SPI_TX_RX_COMPLETE_CB_ID 

SPI TxRx Completed callback ID

HAL_SPI_TX_HALF_COMPLETE_CB_ID 

SPI Tx Half Completed callback ID

HAL_SPI_RX_HALF_COMPLETE_CB_ID 

SPI Rx Half Completed callback ID

HAL_SPI_TX_RX_HALF_COMPLETE_CB_ID 

SPI TxRx Half Completed callback ID

HAL_SPI_ERROR_CB_ID 

SPI Error callback ID

HAL_SPI_ABORT_CB_ID 

SPI Abort callback ID

HAL_SPI_MSPINIT_CB_ID 

SPI Msp Init callback ID

HAL_SPI_MSPDEINIT_CB_ID 

SPI Msp DeInit callback ID

Definition at line 155 of file stm32f4xx_hal_spi.h.

◆ HAL_SPI_StateTypeDef

HAL SPI State structure definition.

Enumerator
HAL_SPI_STATE_RESET 

Peripheral not Initialized

HAL_SPI_STATE_READY 

Peripheral Initialized and ready for use

HAL_SPI_STATE_BUSY 

an internal process is ongoing

HAL_SPI_STATE_BUSY_TX 

Data Transmission process is ongoing

HAL_SPI_STATE_BUSY_RX 

Data Reception process is ongoing

HAL_SPI_STATE_BUSY_TX_RX 

Data Transmission and Reception process is ongoing

HAL_SPI_STATE_ERROR 

SPI error state

HAL_SPI_STATE_ABORT 

SPI abort is ongoing

Definition at line 89 of file stm32f4xx_hal_spi.h.