Prusa MINI Firmware overview
SPI Exported Macros
Collaboration diagram for SPI Exported Macros:

Macros

#define __HAL_SPI_RESET_HANDLE_STATE(__HANDLE__)   ((__HANDLE__)->State = HAL_SPI_STATE_RESET)
 Reset SPI handle state. More...
 
#define __HAL_SPI_ENABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->CR2 |= (__INTERRUPT__))
 Enable or disable the specified SPI interrupts. More...
 
#define __HAL_SPI_DISABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->CR2 &= (~(__INTERRUPT__)))
 
#define __HAL_SPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)   ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
 Check whether the specified SPI interrupt source is enabled or not. More...
 
#define __HAL_SPI_GET_FLAG(__HANDLE__, __FLAG__)   ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))
 Check whether the specified SPI flag is set or not. More...
 
#define __HAL_SPI_CLEAR_CRCERRFLAG(__HANDLE__)   ((__HANDLE__)->Instance->SR = (uint16_t)(~SPI_FLAG_CRCERR))
 Clear the SPI CRCERR pending flag. More...
 
#define __HAL_SPI_CLEAR_MODFFLAG(__HANDLE__)
 Clear the SPI MODF pending flag. More...
 
#define __HAL_SPI_CLEAR_OVRFLAG(__HANDLE__)
 Clear the SPI OVR pending flag. More...
 
#define __HAL_SPI_CLEAR_FREFLAG(__HANDLE__)
 Clear the SPI FRE pending flag. More...
 
#define __HAL_SPI_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 |= SPI_CR1_SPE)
 Enable the SPI peripheral. More...
 
#define __HAL_SPI_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 &= (~SPI_CR1_SPE))
 Disable the SPI peripheral. More...
 

Detailed Description

Macro Definition Documentation

◆ __HAL_SPI_RESET_HANDLE_STATE

#define __HAL_SPI_RESET_HANDLE_STATE (   __HANDLE__)    ((__HANDLE__)->State = HAL_SPI_STATE_RESET)

Reset SPI handle state.

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

◆ __HAL_SPI_ENABLE_IT

#define __HAL_SPI_ENABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)    ((__HANDLE__)->Instance->CR2 |= (__INTERRUPT__))

Enable or disable the specified SPI interrupts.

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
<strong>INTERRUPT</strong>specifies the interrupt source to enable or 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

◆ __HAL_SPI_DISABLE_IT

#define __HAL_SPI_DISABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)    ((__HANDLE__)->Instance->CR2 &= (~(__INTERRUPT__)))

◆ __HAL_SPI_GET_IT_SOURCE

#define __HAL_SPI_GET_IT_SOURCE (   __HANDLE__,
  __INTERRUPT__ 
)    ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)

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

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
<strong>INTERRUPT</strong>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).

◆ __HAL_SPI_GET_FLAG

#define __HAL_SPI_GET_FLAG (   __HANDLE__,
  __FLAG__ 
)    ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))

Check whether the specified SPI flag is set or not.

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
<strong>FLAG</strong>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).

◆ __HAL_SPI_CLEAR_CRCERRFLAG

#define __HAL_SPI_CLEAR_CRCERRFLAG (   __HANDLE__)    ((__HANDLE__)->Instance->SR = (uint16_t)(~SPI_FLAG_CRCERR))

Clear the SPI CRCERR pending flag.

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

◆ __HAL_SPI_CLEAR_MODFFLAG

#define __HAL_SPI_CLEAR_MODFFLAG (   __HANDLE__)
Value:
do{ \
__IO uint32_t tmpreg_modf = 0x00U; \
tmpreg_modf = (__HANDLE__)->Instance->SR; \
(__HANDLE__)->Instance->CR1 &= (~SPI_CR1_SPE); \
UNUSED(tmpreg_modf); \
} while(0U)

Clear the SPI MODF pending flag.

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

◆ __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
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

◆ __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
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

◆ __HAL_SPI_ENABLE

#define __HAL_SPI_ENABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 |= SPI_CR1_SPE)

Enable the SPI peripheral.

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

◆ __HAL_SPI_DISABLE

#define __HAL_SPI_DISABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 &= (~SPI_CR1_SPE))

Disable the SPI peripheral.

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None
UNUSED
#define UNUSED(X)
Definition: stm32f4xx_hal_def.h:74