Peripheral State and Errors 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_dspiPointer to a DSPI handle which contains the configuration information for the specified DSPI module.
[in]modeThe DSPI transmission mode. This parameter can be one of the following values:
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_dspi_get_error()

uint32_t hal_dspi_get_error ( dspi_handle_t p_dspi)

Return the DSPI error code.

Parameters
[in]p_dspiPointer 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_dspiPointer to a DSPI handle which contains the configuration information for the specified DSPI module.
Return values
HAL_DSPI_STATE_RESETPeripheral not initialized.
HAL_DSPI_STATE_READYPeripheral initialized and ready for use.
HAL_DSPI_STATE_BUSYPeripheral in indirect mode and busy.
HAL_DSPI_STATE_BUSY_INDIRECT_TXPeripheral in indirect mode with transmission ongoing.
HAL_DSPI_STATE_ABORTPeripheral with abort request ongoing.
HAL_DSPI_STATE_ERRORPeripheral 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_dspiPointer to a DSPI handle which contains the configuration information for the specified DSPI module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout 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_dspiPointer to a DSPI handle which contains the configuration information for the specified DSPI module.
[in]timeoutInternal process timeout value.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout 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_dspiPointer to a DSPI handle which contains the configuration information for the specified DSPI module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.