Functions
Peripheral State and Errors functions
Peripheral Driver » HAL Driver » QSPI » Functions

QSPI control functions. More...

Collaboration diagram for Peripheral State and Errors functions:

## Functions
hal_qspi_state_t | hal_qspi_get_state (qspi_handle_t *p_qspi)
| Return the QSPI handle state. More...
uint32_t | hal_qspi_get_error (qspi_handle_t *p_qspi)
| Return the QSPI error code. More...
void | hal_qspi_set_timeout (qspi_handle_t *p_qspi, uint32_t timeout)
| Set the QSPI internal process timeout value. More...
hal_status_t | hal_qspi_set_tx_fifo_threshold (qspi_handle_t *p_qspi, uint32_t threshold)
| Set the TX FIFO threshold. More...
hal_status_t | hal_qspi_set_rx_fifo_threshold (qspi_handle_t *p_qspi, uint32_t threshold)
| Set the RX FIFO threshold. More...
uint32_t | hal_qspi_get_tx_fifo_threshold (qspi_handle_t *p_qspi)
| Get the TX FIFO threshold. More...
uint32_t | hal_qspi_get_rx_fifo_threshold (qspi_handle_t *p_qspi)
| Get the RX FIFO threshold. More...
hal_status_t | hal_qspi_suspend_reg (qspi_handle_t *p_qspi)
| Suspend some registers related to QSPI configuration before sleep. More...
hal_status_t | hal_qspi_resume_reg (qspi_handle_t *p_qspi)
| Restore some registers related to QSPI configuration after sleep. More...

## Detailed Description

QSPI control functions.

     ===============================================================================
                          ##### Peripheral State and Errors functions #####
     ===============================================================================
        [..]
        This subsection provides a set of functions allowing to control the QSPI.
         (+) hal_qspi_get_state() API can be helpful to check in run-time the state of the QSPI peripheral.
         (+) hal_qspi_get_error() check in run-time Errors occurring during communication.
         (+) hal_qspi_set_timeout() set the timeout during internal process.
         (+) hal_qspi_set_tx_fifo_threshold() set the TX FIFO Threshold.
         (+) hal_qspi_set_rx_fifo_threshold() set the RX FIFO Threshold.
         (+) hal_qspi_get_tx_fifo_threshold() get the TX FIFO Threshold.
         (+) hal_qspi_get_rx_fifo_threshold() get the RX FIFO Threshold.

## Function Documentation

## ◆ hal_qspi_get_error()

uint32_t hal_qspi_get_error | ( | qspi_handle_t * | p_qspi | ) |

Return the QSPI error code.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.

Returns
  QSPI error code in bitmap format

## ◆ hal_qspi_get_rx_fifo_threshold()

uint32_t hal_qspi_get_rx_fifo_threshold | ( | qspi_handle_t * | p_qspi | ) |

Get the RX FIFO threshold.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.

Returns
  RX FIFO threshold

## ◆ hal_qspi_get_state()

hal_qspi_state_t hal_qspi_get_state | ( | qspi_handle_t * | p_qspi | ) |

Return the QSPI handle state.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.

Return values

  HAL_QSPI_STATE_RESET | Peripheral not initialized.
  HAL_QSPI_STATE_READY | Peripheral initialized and ready for use.
  HAL_QSPI_STATE_BUSY | Peripheral in indirect mode and busy.
  HAL_QSPI_STATE_BUSY_INDIRECT_TX | Peripheral in indirect mode with transmission ongoing.
  HAL_QSPI_STATE_BUSY_INDIRECT_RX | Peripheral in indirect mode with reception ongoing.
  HAL_QSPI_STATE_ABORT | Peripheral with abort request ongoing.
  HAL_QSPI_STATE_ERROR | Peripheral in error.

## ◆ hal_qspi_get_tx_fifo_threshold()

uint32_t hal_qspi_get_tx_fifo_threshold | ( | qspi_handle_t * | p_qspi | ) |

Get the TX FIFO threshold.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.

Returns
  TX FIFO threshold

## ◆ hal_qspi_resume_reg()

hal_status_t hal_qspi_resume_reg | ( | qspi_handle_t * | p_qspi | ) |

Restore some registers related to QSPI configuration after sleep.

This function must be used in conjunction with the hal_qspi_suspend_reg().

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_qspi_set_rx_fifo_threshold()

hal_status_t hal_qspi_set_rx_fifo_threshold | ( | qspi_handle_t * | p_qspi,
|  | uint32_t | threshold
| ) |  |

Set the RX FIFO threshold.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | threshold | RX FIFO threshold value ranging between 0x0U and 0x7U.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_qspi_set_timeout()

void hal_qspi_set_timeout | ( | qspi_handle_t * | p_qspi,
|  | uint32_t | timeout
| ) |  |

Set the QSPI internal process timeout value.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | timeout | Internal process timeout value.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_qspi_set_tx_fifo_threshold()

hal_status_t hal_qspi_set_tx_fifo_threshold | ( | qspi_handle_t * | p_qspi,
|  | uint32_t | threshold
| ) |  |

Set the TX FIFO threshold.

Parameters

  [in] | p_qspi | Pointer to a QSPI handle which contains the configuration information for the specified QSPI module.
  [in] | threshold | TX FIFO threshold value ranging between 0x0U and 0x7U.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_qspi_suspend_reg()

hal_status_t hal_qspi_suspend_reg | ( | qspi_handle_t * | p_qspi | ) |

Suspend some registers related to QSPI configuration before sleep.

Parameters

  [in] | p_qspi | Pointer to a QSPIhandle which contains the configuration information for the specified QSPI module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.