Typedefs | Functions
Peripheral State and Errors functions
Peripheral Driver » HAL Driver » EXFLASH » Functions

exFlash control functions More...

Collaboration diagram for Peripheral State and Errors functions:

## Typedefs
typedef hal_status_t(* | exflash_operation_func) (exflash_handle_t *p_exflash)
| HAL exFlash operation function. More...

## Functions
hal_exflash_state_t | hal_exflash_get_state (exflash_handle_t *p_exflash)
| Return the exFlash handle state. More...
uint32_t | hal_exflash_get_error (exflash_handle_t *p_exflash)
| Return the exFlash error code. More...
void | hal_exflash_set_retry (exflash_handle_t *p_exflash, uint32_t retry)
| Set the exFlash internal process timeout value. More...
hal_status_t | hal_exflash_operation (exflash_handle_t *p_exflash, exflash_operation_func p_func_exflash_operation)
| Call user XIP Flash operation functon. 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...
hal_status_t | hal_exflash_read_uid (uint8_t *uid)
| This function serves to read UID of 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.

## Typedef Documentation

## ◆ exflash_operation_func

typedef hal_status_t(* exflash_operation_func) (exflash_handle_t *p_exflash)

HAL exFlash operation function.

Definition at line 753 of file gr55xx_hal_exflash.h.

## Function Documentation

## ◆ hal_exflash_get_error()

uint32_t hal_exflash_get_error | ( | exflash_handle_t * | p_exflash | ) |

Return the exFlash error code.

Parameters

  [in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module.

Returns
  exFlash error code in bitmap format

## ◆ hal_exflash_get_state()

hal_exflash_state_t hal_exflash_get_state | ( | exflash_handle_t * | p_exflash | ) |

Return the exFlash handle state.

Parameters

  [in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module.

Return values

  HAL_EXFLASH_STATE_RESET | Peripheral not initialized.
  HAL_EXFLASH_STATE_READY | Peripheral initialized and ready for use.
  HAL_EXFLASH_STATE_BUSY | Peripheral in indirect mode and busy.
  HAL_EXFLASH_STATE_BUSY_WRITE | Peripheral in indirect mode with transmission ongoing.
  HAL_EXFLASH_STATE_BUSY_READ | Peripheral in indirect mode with reception ongoing.
  HAL_EXFLASH_STATE_BUSY_ERASE | Peripheral in indirect mode with erase ongoing.
  HAL_EXFLASH_STATE_ERROR | Peripheral in error.

## ◆ hal_exflash_operation()

hal_status_t hal_exflash_operation | ( | exflash_handle_t * | p_exflash,
|  | exflash_operation_func | p_func_exflash_operation
| ) |  |

Call user XIP Flash operation functon.

Parameters

  [in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module.
  [in] | p_func_exflash_operation | HAL exFlash operation function.

## ◆ 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_status | Pointer of status register.

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

hal_status_t hal_exflash_read_uid | ( | uint8_t * | uid | ) |

This function serves to read UID of flash.

Parameters

  [out] | uid | store 16 Byte flash UID

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

void hal_exflash_set_retry | ( | exflash_handle_t * | p_exflash,
|  | uint32_t | retry
| ) |  |

Set the exFlash internal process timeout value.

Parameters

  [in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module.
  [in] | retry | Internal process repeat times value.

## ◆ 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_status | An integer value representing the content to be written to the flash status register.

Return values

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