STM32F4xx HAL Driver master
STM32CubeF4 HAL / LL Drivers API Reference
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_CLEAR_CRCERRFLAG

#define __HAL_SPI_CLEAR_CRCERRFLAG ( __HANDLE__)
Value:
((__HANDLE__)->Instance->SR = (uint16_t)(~SPI_FLAG_CRCERR))
#define 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 410 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_CLEAR_FREFLAG

#define __HAL_SPI_CLEAR_FREFLAG ( __HANDLE__)
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 443 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_CLEAR_MODFFLAG

#define __HAL_SPI_CLEAR_MODFFLAG ( __HANDLE__)
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 417 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_CLEAR_OVRFLAG

#define __HAL_SPI_CLEAR_OVRFLAG ( __HANDLE__)
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 430 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_DISABLE

#define __HAL_SPI_DISABLE ( __HANDLE__)
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 462 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_DISABLE_IT

#define __HAL_SPI_DISABLE_IT ( __HANDLE__,
__INTERRUPT__ )
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 374 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_ENABLE

#define __HAL_SPI_ENABLE ( __HANDLE__)
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 455 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_ENABLE_IT

#define __HAL_SPI_ENABLE_IT ( __HANDLE__,
__INTERRUPT__ )
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 362 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_GET_FLAG

#define __HAL_SPI_GET_FLAG ( __HANDLE__,
__FLAG__ )
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 403 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_GET_IT_SOURCE

#define __HAL_SPI_GET_IT_SOURCE ( __HANDLE__,
__INTERRUPT__ )
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 386 of file stm32f4xx_hal_spi.h.

◆ __HAL_SPI_RESET_HANDLE_STATE

#define __HAL_SPI_RESET_HANDLE_STATE ( __HANDLE__)
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 349 of file stm32f4xx_hal_spi.h.