Macros
SPI Exported Macros
Peripheral Driver » HAL Driver » SPI » CS Signal Description » Defines

## 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__)) != 0U) ? 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

  __HANDLE__ | Specifies the SPI Handle.
  __FLAG__ | 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 536 of file 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

  __HANDLE__ | Specifies the SPI Handle.

Return values

  None |

Definition at line 431 of file 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

  __HANDLE__ | Specifies the SPI Handle.

Return values

  None |

Definition at line 459 of file 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

  __HANDLE__ | Specifies the SPI Handle.

Return values

  None |

Definition at line 452 of file 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

  __HANDLE__ | Specifies the SPI handle.
  __INTERRUPT__ | 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 489 of file 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

  __HANDLE__ | Specifies the SPI Handle.

Return values

  None |

Definition at line 424 of file 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

  __HANDLE__ | Specifies the SPI Handle.

Return values

  None |

Definition at line 445 of file 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

  __HANDLE__ | Specifies the SPI Handle.

Return values

  None |

Definition at line 438 of file 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

  __HANDLE__ | Specifies the SPI Handle.
  __INTERRUPT__ | 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 474 of file hal_spi.h.

## ◆ __HAL_SPI_GET_FLAG

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

Check whether the specified SPI flag is set or not.

Parameters

  __HANDLE__ | Specifies the SPI Handle.
  __FLAG__ | 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 520 of file 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

  __HANDLE__ | Specifies the SPI Handle.
  __INTERRUPT__ | 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 504 of file 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

  __HANDLE__ | SPI handle.

Return values

  None |

Definition at line 417 of file hal_spi.h.