Macros
SPI Exported Macros
Peripheral Driver » HAL Driver » SPI » Defines
Collaboration diagram for SPI Exported Macros:

## Macros
#define | __HAL_SPI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_SPI_STATE_RESET)
| Reset SPI handle states. More...
#define | __HAL_SPI_ENABLE(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->SSI_EN, SPI_SSI_EN)
| Enable the specified SPI peripheral. More...
#define | __HAL_SPI_DISABLE(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->SSI_EN, SPI_SSI_EN)
| Disable the specified SPI peripheral. More...
#define | __HAL_SPI_ENABLE_DMATX(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->DMA_CTRL, SPI_DMA_CTRL_TX_DMA_EN)
| Enable the SPI DMA TX Request. More...
#define | __HAL_SPI_ENABLE_DMARX(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->DMA_CTRL, SPI_DMA_CTRL_RX_DMA_EN)
| Enable the SPI DMA RX Request. More...
#define | __HAL_SPI_DISABLE_DMATX(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->DMA_CTRL, SPI_DMA_CTRL_TX_DMA_EN)
| Disable the SPI DMA TX Request. More...
#define | __HAL_SPI_DISABLE_DMARX(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->DMA_CTRL, SPI_DMA_CTRL_RX_DMA_EN)
| Disable the SPI DMA RX Request. More...
#define | __HAL_SPI_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BITS((__HANDLE__)->p_instance->INT_MASK, (__INTERRUPT__))
| Enable the specified SPI interrupts. More...
#define | __HAL_SPI_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BITS((__HANDLE__)->p_instance->INT_MASK, (__INTERRUPT__))
| Disable the specified SPI interrupts. More...
#define | __HAL_SPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (READ_BITS((__HANDLE__)->p_instance->INT_STAT, (__INTERRUPT__)) == (__INTERRUPT__))
| Check whether the specified SPI interrupt source is enabled or not. More...
#define | __HAL_SPI_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->STAT, (__FLAG__)) != 0) ? SET : RESET)
| Check whether the specified SPI flag is set or not. More...
#define | __HAL_SPI_CLEAR_FLAG(__HANDLE__, __FLAG__) READ_BITS((__HANDLE__)->p_instance->STAT, (__FLAG__))
| Clear the specified SPI flag. More...

## Detailed Description

## Macro Definition Documentation

## ◆ __HAL_SPI_CLEAR_FLAG

#define __HAL_SPI_CLEAR_FLAG | ( |  | __HANDLE__,
|  |  | __FLAG__
| ) |  | READ_BITS((__HANDLE__)->p_instance->STAT, (__FLAG__))

Clear the specified SPI flag.

Parameters

  <strong>HANDLE</strong> | Specifies the SPI Handle.
  <strong>FLAG</strong> | Specifies the flag to clear. This parameter can be one of the following values: SPI_FLAG_DCOL Data collision error flag SPI_FLAG_TXE Transmission error flag SPI_FLAG_RFF Rx FIFO full flag SPI_FLAG_RFNE Rx FIFO not empty flag SPI_FLAG_TFE Tx FIFO empty flag SPI_FLAG_TFNF Tx FIFO not full flag SPI_FLAG_BUSY Busy flag

Return values

  None |

Definition at line 542 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_DISABLE

#define __HAL_SPI_DISABLE | ( |  | __HANDLE__ | ) | CLEAR_BITS((__HANDLE__)->p_instance->SSI_EN, SPI_SSI_EN)

Disable the specified SPI peripheral.

Parameters

  <strong>HANDLE</strong> | Specifies the SPI Handle.

Return values

  None |

Definition at line 437 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_DISABLE_DMARX

#define __HAL_SPI_DISABLE_DMARX | ( |  | __HANDLE__ | ) | CLEAR_BITS((__HANDLE__)->p_instance->DMA_CTRL, SPI_DMA_CTRL_RX_DMA_EN)

Disable the SPI DMA RX Request.

Parameters

  <strong>HANDLE</strong> | Specifies the SPI Handle.

Return values

  None |

Definition at line 465 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_DISABLE_DMATX

#define __HAL_SPI_DISABLE_DMATX | ( |  | __HANDLE__ | ) | CLEAR_BITS((__HANDLE__)->p_instance->DMA_CTRL, SPI_DMA_CTRL_TX_DMA_EN)

Disable the SPI DMA TX Request.

Parameters

  <strong>HANDLE</strong> | Specifies the SPI Handle.

Return values

  None |

Definition at line 458 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_DISABLE_IT

#define __HAL_SPI_DISABLE_IT | ( |  | __HANDLE__,
|  |  | __INTERRUPT__
| ) |  | CLEAR_BITS((__HANDLE__)->p_instance->INT_MASK, (__INTERRUPT__))

Disable the specified SPI interrupts.

Parameters

  <strong>HANDLE</strong> | Specifies the SPI handle.
  <strong>INTERRUPT</strong> | Specifies the interrupt source to disable. This parameter can be one of the following values: SPI_IT_MST Multi-Master Contention Interrupt enable SPI_IT_RXF Receive FIFO Full Interrupt enable SPI_IT_RXO Receive FIFO Overflow Interrupt enable SPI_IT_RXU Receive FIFO Underflow Interrupt enable SPI_IT_TXO Transmit FIFO Overflow Interrupt enable SPI_IT_TXE Transmit FIFO Empty Interrupt enable

Return values

  None |

Definition at line 495 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_ENABLE

#define __HAL_SPI_ENABLE | ( |  | __HANDLE__ | ) | SET_BITS((__HANDLE__)->p_instance->SSI_EN, SPI_SSI_EN)

Enable the specified SPI peripheral.

Parameters

  <strong>HANDLE</strong> | Specifies the SPI Handle.

Return values

  None |

Definition at line 430 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_ENABLE_DMARX

#define __HAL_SPI_ENABLE_DMARX | ( |  | __HANDLE__ | ) | SET_BITS((__HANDLE__)->p_instance->DMA_CTRL, SPI_DMA_CTRL_RX_DMA_EN)

Enable the SPI DMA RX Request.

Parameters

  <strong>HANDLE</strong> | Specifies the SPI Handle.

Return values

  None |

Definition at line 451 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_ENABLE_DMATX

#define __HAL_SPI_ENABLE_DMATX | ( |  | __HANDLE__ | ) | SET_BITS((__HANDLE__)->p_instance->DMA_CTRL, SPI_DMA_CTRL_TX_DMA_EN)

Enable the SPI DMA TX Request.

Parameters

  <strong>HANDLE</strong> | Specifies the SPI Handle.

Return values

  None |

Definition at line 444 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_ENABLE_IT

#define __HAL_SPI_ENABLE_IT | ( |  | __HANDLE__,
|  |  | __INTERRUPT__
| ) |  | SET_BITS((__HANDLE__)->p_instance->INT_MASK, (__INTERRUPT__))

Enable the specified SPI interrupts.

Parameters

  <strong>HANDLE</strong> | Specifies the SPI Handle.
  <strong>INTERRUPT</strong> | Specifies the interrupt source to enable. This parameter can be one of the following values: SPI_IT_MST Multi-Master Contention Interrupt enable SPI_IT_RXF Receive FIFO Full Interrupt enable SPI_IT_RXO Receive FIFO Overflow Interrupt enable SPI_IT_RXU Receive FIFO Underflow Interrupt enable SPI_IT_TXO Transmit FIFO Overflow Interrupt enable SPI_IT_TXE Transmit FIFO Empty Interrupt enable

Return values

  None |

Definition at line 480 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_GET_FLAG

#define __HAL_SPI_GET_FLAG | ( |  | __HANDLE__,
|  |  | __FLAG__
| ) |  | ((READ_BITS((__HANDLE__)->p_instance->STAT, (__FLAG__)) != 0) ? SET : RESET)

Check whether the specified SPI flag is set or not.

Parameters

  <strong>HANDLE</strong> | Specifies the SPI Handle.
  <strong>FLAG</strong> | Specifies the flag to check. This parameter can be one of the following values: SPI_FLAG_DCOL Data collision error flag SPI_FLAG_TXE Transmission error flag SPI_FLAG_RFF Rx FIFO full flag SPI_FLAG_RFNE Rx FIFO not empty flag SPI_FLAG_TFE Tx FIFO empty flag SPI_FLAG_TFNF Tx FIFO not full flag SPI_FLAG_BUSY Busy flag

Return values

  The | new state of FLAG (TRUE or FALSE).

Definition at line 526 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_GET_IT_SOURCE

#define __HAL_SPI_GET_IT_SOURCE | ( |  | __HANDLE__,
|  |  | __INTERRUPT__
| ) |  | (READ_BITS((__HANDLE__)->p_instance->INT_STAT, (__INTERRUPT__)) == (__INTERRUPT__))

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

Parameters

  <strong>HANDLE</strong> | Specifies the SPI Handle.
  <strong>INTERRUPT</strong> | Specifies the interrupt source to check. This parameter can be one of the following values: SPI_IT_MST Multi-Master Contention Interrupt enable SPI_IT_RXF Receive FIFO Full Interrupt enable SPI_IT_RXO Receive FIFO Overflow Interrupt enable SPI_IT_RXU Receive FIFO Underflow Interrupt enable SPI_IT_TXO Transmit FIFO Overflow Interrupt enable SPI_IT_TXE Transmit FIFO Empty Interrupt enable

Return values

  The | new state of IT (TRUE or FALSE).

Definition at line 510 of file gr55xx_hal_spi.h.

## ◆ __HAL_SPI_RESET_HANDLE_STATE

#define __HAL_SPI_RESET_HANDLE_STATE | ( |  | __HANDLE__ | ) | ((__HANDLE__)->state = HAL_SPI_STATE_RESET)

Reset SPI handle states.

Parameters

  <strong>HANDLE</strong> | SPI handle.

Return values

  None |

Definition at line 423 of file gr55xx_hal_spi.h.