Peripheral State and Errors functions

exFlash control functions More...

Functions

hal_exflash_state_t hal_exflash_get_state (void)
 Return the exFlash handle state. More...
 
uint32_t hal_exflash_get_error (void)
 Return the exFlash error code. More...
 
hal_status_t hal_exflash_read_status_reg (uint16_t *p_reg_status)
 This function reads the status register of a flash. More...
 
hal_status_t hal_exflash_write_status_reg (uint16_t reg_status)
 This function writes the status register of a flash. More...
 

Detailed Description

exFlash control functions

 ===============================================================================
                      ##### Peripheral State and Errors functions #####
 ===============================================================================
    [..]
    This subsection provides a set of functions allowing to control the exFlash.
     (+) hal_exflash_get_state()API can be helpful to check in run-time the state of the exFlash peripheral.
     (+) hal_exflash_get_error() check in run-time Errors occurring during communication.
     (+) hal_exflash_set_timeout() set the timeout during internal process.

Function Documentation

◆ hal_exflash_get_error()

uint32_t hal_exflash_get_error ( void  )

Return the exFlash error code.

Returns
exFlash error code in bitmap format

◆ hal_exflash_get_state()

hal_exflash_state_t hal_exflash_get_state ( void  )

Return the exFlash handle state.

Return values
HAL_EXFLASH_STATE_RESETPeripheral not initialized.
HAL_EXFLASH_STATE_READYPeripheral initialized and ready for use.
HAL_EXFLASH_STATE_BUSYPeripheral in indirect mode and busy.
HAL_EXFLASH_STATE_BUSY_WRITEPeripheral in indirect mode with transmission ongoing.
HAL_EXFLASH_STATE_BUSY_READPeripheral in indirect mode with reception ongoing.
HAL_EXFLASH_STATE_BUSY_ERASEPeripheral in indirect mode with erase ongoing.
HAL_EXFLASH_STATE_ERRORPeripheral in error.

◆ hal_exflash_read_status_reg()

hal_status_t hal_exflash_read_status_reg ( uint16_t *  p_reg_status)

This function reads the status register of a flash.

Note
The status register is a 16-bit register that provides information about the flash operation status.
Parameters
[in]p_reg_statusPointer of status register.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_exflash_write_status_reg()

hal_status_t hal_exflash_write_status_reg ( uint16_t  reg_status)

This function writes the status register of a flash.

Note
The status register is a 16-bit register that provides information about the flash operation status.
Parameters
reg_statusAn integer value representing the content to be written to the flash status register.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.