STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
SPI Exported Macros
Collaboration diagram for SPI Exported Macros:

Macros

#define __HAL_SPI_RESET_HANDLE_STATE(__HANDLE__)
 Reset SPI handle state.
 
#define __HAL_SPI_ENABLE_IT(__HANDLE__, __INTERRUPT__)
 Enable the specified SPI interrupts.
 
#define __HAL_SPI_DISABLE_IT(__HANDLE__, __INTERRUPT__)
 Disable the specified SPI interrupts.
 
#define __HAL_SPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)
 Check whether the specified SPI interrupt source is enabled or not.
 
#define __HAL_SPI_GET_FLAG(__HANDLE__, __FLAG__)
 Check whether the specified SPI flag is set or not.
 
#define __HAL_SPI_CLEAR_CRCERRFLAG(__HANDLE__)
 Clear the SPI CRCERR pending flag.
 
#define __HAL_SPI_CLEAR_MODFFLAG(__HANDLE__)
 Clear the SPI MODF pending flag.
 
#define __HAL_SPI_CLEAR_OVRFLAG(__HANDLE__)
 Clear the SPI OVR pending flag.
 
#define __HAL_SPI_CLEAR_FREFLAG(__HANDLE__)
 Clear the SPI FRE pending flag.
 
#define __HAL_SPI_ENABLE(__HANDLE__)
 Enable the SPI peripheral.
 
#define __HAL_SPI_DISABLE(__HANDLE__)
 Disable the SPI peripheral.
 

Detailed Description

Macro Definition Documentation

◆ __HAL_SPI_RESET_HANDLE_STATE

#define __HAL_SPI_RESET_HANDLE_STATE ( __HANDLE__)

#include <stm32f4xx_hal_spi.h>

Value:
((__HANDLE__)->State = HAL_SPI_STATE_RESET)
@ HAL_SPI_STATE_RESET

Reset SPI handle state.

Parameters
__HANDLE__specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

Definition at line 348 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_ENABLE_IT

#define __HAL_SPI_ENABLE_IT ( __HANDLE__,
__INTERRUPT__ )

#include <stm32f4xx_hal_spi.h>

Value:
SET_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))

Enable the specified SPI interrupts.

Parameters
__HANDLE__specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
__INTERRUPT__specifies the interrupt source to enable. This parameter can be one of the following values:
  • SPI_IT_TXE: Tx buffer empty interrupt enable
  • SPI_IT_RXNE: RX buffer not empty interrupt enable
  • SPI_IT_ERR: Error interrupt enable
Return values
None

Definition at line 361 of file stm32f4xx_hal_spi.h.

Referenced by HAL_SPI_Receive_DMA(), HAL_SPI_Receive_IT(), HAL_SPI_Transmit_DMA(), HAL_SPI_Transmit_IT(), HAL_SPI_TransmitReceive_DMA(), and HAL_SPI_TransmitReceive_IT().

◆ __HAL_SPI_DISABLE_IT

#define __HAL_SPI_DISABLE_IT ( __HANDLE__,
__INTERRUPT__ )

#include <stm32f4xx_hal_spi.h>

Value:
CLEAR_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))

Disable the specified SPI interrupts.

Parameters
__HANDLE__specifies the SPI handle. This parameter can be SPIx where x: 1, 2, or 3 to select the SPI peripheral.
__INTERRUPT__specifies the interrupt source to disable. This parameter can be one of the following values:
  • SPI_IT_TXE: Tx buffer empty interrupt enable
  • SPI_IT_RXNE: RX buffer not empty interrupt enable
  • SPI_IT_ERR: Error interrupt enable
Return values
None

Definition at line 373 of file stm32f4xx_hal_spi.h.

Referenced by HAL_SPI_IRQHandler(), SPI_2linesRxISR_16BIT(), SPI_2linesRxISR_8BIT(), SPI_2linesTxISR_16BIT(), SPI_2linesTxISR_8BIT(), SPI_CloseRx_ISR(), SPI_CloseRxTx_ISR(), SPI_CloseTx_ISR(), SPI_DMAReceiveCplt(), SPI_DMATransmitCplt(), SPI_DMATransmitReceiveCplt(), and SPI_WaitFlagStateUntilTimeout().

◆ __HAL_SPI_GET_IT_SOURCE

#define __HAL_SPI_GET_IT_SOURCE ( __HANDLE__,
__INTERRUPT__ )

#include <stm32f4xx_hal_spi.h>

Value:
((((__HANDLE__)->Instance->CR2\
& (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)

Check whether the specified SPI interrupt source is enabled or not.

Parameters
__HANDLE__specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
__INTERRUPT__specifies the SPI interrupt source to check. This parameter can be one of the following values:
  • SPI_IT_TXE: Tx buffer empty interrupt enable
  • SPI_IT_RXNE: RX buffer not empty interrupt enable
  • SPI_IT_ERR: Error interrupt enable
Return values
Thenew state of IT (TRUE or FALSE).

Definition at line 385 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_GET_FLAG

#define __HAL_SPI_GET_FLAG ( __HANDLE__,
__FLAG__ )

#include <stm32f4xx_hal_spi.h>

Value:
((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))

Check whether the specified SPI flag is set or not.

Parameters
__HANDLE__specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
__FLAG__specifies the flag to check. This parameter can be one of the following values:
  • SPI_FLAG_RXNE: Receive buffer not empty flag
  • SPI_FLAG_TXE: Transmit buffer empty flag
  • SPI_FLAG_CRCERR: CRC error flag
  • SPI_FLAG_MODF: Mode fault flag
  • SPI_FLAG_OVR: Overrun flag
  • SPI_FLAG_BSY: Busy flag
  • SPI_FLAG_FRE: Frame format error flag
Return values
Thenew state of FLAG (TRUE or FALSE).

Definition at line 402 of file stm32f4xx_hal_spi.h.

Referenced by HAL_SPI_Receive(), HAL_SPI_Transmit(), HAL_SPI_TransmitReceive(), SPI_CloseRx_ISR(), SPI_CloseRxTx_ISR(), SPI_DMAReceiveCplt(), SPI_DMATransmitReceiveCplt(), SPI_EndRxTxTransaction(), and SPI_WaitFlagStateUntilTimeout().

◆ __HAL_SPI_CLEAR_CRCERRFLAG

#define __HAL_SPI_CLEAR_CRCERRFLAG ( __HANDLE__)

#include <stm32f4xx_hal_spi.h>

Value:
((__HANDLE__)->Instance->SR = (uint16_t)(~SPI_FLAG_CRCERR))

Clear the SPI CRCERR pending flag.

Parameters
__HANDLE__specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

Definition at line 409 of file stm32f4xx_hal_spi.h.

Referenced by HAL_SPI_Receive(), HAL_SPI_TransmitReceive(), SPI_CloseRx_ISR(), SPI_CloseRxTx_ISR(), SPI_DMAReceiveCplt(), and SPI_DMATransmitReceiveCplt().

◆ __HAL_SPI_CLEAR_MODFFLAG

#define __HAL_SPI_CLEAR_MODFFLAG ( __HANDLE__)

#include <stm32f4xx_hal_spi.h>

Value:
do{ \
__IO uint32_t tmpreg_modf = 0x00U; \
tmpreg_modf = (__HANDLE__)->Instance->SR; \
CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE); \
UNUSED(tmpreg_modf); \
} while(0U)

Clear the SPI MODF pending flag.

Parameters
__HANDLE__specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

Definition at line 416 of file stm32f4xx_hal_spi.h.

Referenced by HAL_SPI_IRQHandler().

◆ __HAL_SPI_CLEAR_OVRFLAG

#define __HAL_SPI_CLEAR_OVRFLAG ( __HANDLE__)

#include <stm32f4xx_hal_spi.h>

Value:
do{ \
__IO uint32_t tmpreg_ovr = 0x00U; \
tmpreg_ovr = (__HANDLE__)->Instance->DR; \
tmpreg_ovr = (__HANDLE__)->Instance->SR; \
UNUSED(tmpreg_ovr); \
} while(0U)

Clear the SPI OVR pending flag.

Parameters
__HANDLE__specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

Definition at line 429 of file stm32f4xx_hal_spi.h.

Referenced by HAL_SPI_Abort(), HAL_SPI_Abort_IT(), HAL_SPI_IRQHandler(), HAL_SPI_Transmit(), HAL_SPI_TransmitReceive(), SPI_CloseRx_ISR(), SPI_CloseRxTx_ISR(), SPI_CloseTx_ISR(), SPI_DMARxAbortCallback(), SPI_DMATransmitCplt(), and SPI_DMATxAbortCallback().

◆ __HAL_SPI_CLEAR_FREFLAG

#define __HAL_SPI_CLEAR_FREFLAG ( __HANDLE__)

#include <stm32f4xx_hal_spi.h>

Value:
do{ \
__IO uint32_t tmpreg_fre = 0x00U; \
tmpreg_fre = (__HANDLE__)->Instance->SR; \
UNUSED(tmpreg_fre); \
}while(0U)

Clear the SPI FRE pending flag.

Parameters
__HANDLE__specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

Definition at line 442 of file stm32f4xx_hal_spi.h.

Referenced by HAL_SPI_Abort(), HAL_SPI_Abort_IT(), HAL_SPI_IRQHandler(), SPI_DMARxAbortCallback(), and SPI_DMATxAbortCallback().

◆ __HAL_SPI_ENABLE

#define __HAL_SPI_ENABLE ( __HANDLE__)

#include <stm32f4xx_hal_spi.h>

Value:
SET_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE)

Enable the SPI peripheral.

Parameters
__HANDLE__specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

Definition at line 454 of file stm32f4xx_hal_spi.h.

Referenced by HAL_SPI_Receive(), HAL_SPI_Receive_DMA(), HAL_SPI_Receive_IT(), HAL_SPI_Transmit(), HAL_SPI_Transmit_DMA(), HAL_SPI_Transmit_IT(), HAL_SPI_TransmitReceive(), HAL_SPI_TransmitReceive_DMA(), and HAL_SPI_TransmitReceive_IT().

◆ __HAL_SPI_DISABLE

#define __HAL_SPI_DISABLE ( __HANDLE__)

#include <stm32f4xx_hal_spi.h>

Value:
CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE)

Disable the SPI peripheral.

Parameters
__HANDLE__specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

Definition at line 461 of file stm32f4xx_hal_spi.h.

Referenced by HAL_SPI_Abort(), HAL_SPI_DeInit(), HAL_SPI_Init(), HAL_SPI_Receive(), HAL_SPI_Receive_DMA(), HAL_SPI_Receive_IT(), HAL_SPI_Transmit(), HAL_SPI_Transmit_DMA(), HAL_SPI_Transmit_IT(), SPI_AbortRx_ISR(), SPI_AbortTx_ISR(), SPI_DMARxAbortCallback(), SPI_EndRxTransaction(), and SPI_WaitFlagStateUntilTimeout().