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

DSPI control functions. More...

## Functions
hal_dspi_state_t | hal_dspi_get_state (dspi_handle_t *p_dspi)
| Return the DSPI handle state. More...
uint32_t | hal_dspi_get_error (dspi_handle_t *p_dspi)
| Return the DSPI error code. More...
void | hal_dspi_set_timeout (dspi_handle_t *p_dspi, uint32_t timeout)
| Set the DSPI internal process timeout value. More...
hal_status_t | hal_dspi_config_mode (dspi_handle_t *p_dspi, uint32_t mode)
| Set the DSPI transmission mode. More...
hal_status_t | hal_dspi_suspend_reg (dspi_handle_t *p_dspi)
| Suspend some registers related to DSPI configuration before sleep. More...
hal_status_t | hal_dspi_resume_reg (dspi_handle_t *p_dspi)
| Restore some registers related to DSPI configuration after sleep. This function must be used in conjunction with the hal_dspi_suspend_reg(). More...

## Detailed Description

DSPI control functions.

     ===============================================================================
                          ##### Peripheral State and Errors functions #####
     ===============================================================================
        [..]
        This subsection provides a set of functions allowing to control the DSPI.
         (+) hal_dspi_get_state() API can be helpful to check in run-time the state of the DSPI peripheral.
         (+) hal_dspi_get_error() check in run-time Errors occurring during communication.

## Function Documentation

## ◆ hal_dspi_config_mode()

hal_status_t hal_dspi_config_mode | ( | dspi_handle_t * | p_dspi,
|  | uint32_t | mode
| ) |  |

Set the DSPI transmission mode.

Parameters

  [in] | p_dspi | Pointer to a DSPI handle which contains the configuration information for the specified DSPI module.
  [in] | mode | The DSPI transmission mode. This parameter can be one of the following values: DSPI_PROT_MODE_3W1L DSPI_PROT_MODE_4W1L DSPI_PROT_MODE_4W2L

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_dspi_get_error()

uint32_t hal_dspi_get_error | ( | dspi_handle_t * | p_dspi | ) |

Return the DSPI error code.

Parameters

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

Returns
  DSPI error code in bitmap format

## ◆ hal_dspi_get_state()

hal_dspi_state_t hal_dspi_get_state | ( | dspi_handle_t * | p_dspi | ) |

Return the DSPI handle state.

Parameters

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

Return values

  HAL_DSPI_STATE_RESET | Peripheral not initialized.
  HAL_DSPI_STATE_READY | Peripheral initialized and ready for use.
  HAL_DSPI_STATE_BUSY | Peripheral in indirect mode and busy.
  HAL_DSPI_STATE_BUSY_INDIRECT_TX | Peripheral in indirect mode with transmission ongoing.
  HAL_DSPI_STATE_ABORT | Peripheral with abort request ongoing.
  HAL_DSPI_STATE_ERROR | Peripheral in error.

## ◆ hal_dspi_resume_reg()

hal_status_t hal_dspi_resume_reg | ( | dspi_handle_t * | p_dspi | ) |

Restore some registers related to DSPI configuration after sleep. This function must be used in conjunction with the hal_dspi_suspend_reg().

Parameters

  [in] | p_dspi | Pointer to a DSPI handle which contains the configuration information for the specified DSPI 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_dspi_set_timeout()

void hal_dspi_set_timeout | ( | dspi_handle_t * | p_dspi,
|  | uint32_t | timeout
| ) |  |

Set the DSPI internal process timeout value.

Parameters

  [in] | p_dspi | Pointer to a DSPI handle which contains the configuration information for the specified DSPI 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_dspi_suspend_reg()

hal_status_t hal_dspi_suspend_reg | ( | dspi_handle_t * | p_dspi | ) |

Suspend some registers related to DSPI configuration before sleep.

Parameters

  [in] | p_dspi | Pointer to a DSPI handle which contains the configuration information for the specified DSPI 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.