Data transfers functions. More...
Functions | |
void | hal_exflash_timing_set (exflash_timing_param_t *p_time) |
Configure flash electrical characteristic parameters. More... | |
void | hal_exflash_get_info (uint32_t *id, uint32_t *size) |
Get flash id and size. More... | |
uint32_t | hal_exflash_config (uint32_t configure, uint32_t value) |
flash parameter configuration More... | |
uint32_t | hal_exflash_enable_quad (ll_xqspi_hp_init_t hp_init) |
Enable Quad mode to allow Quad operation. More... | |
uint32_t | hal_exflash_write (uint32_t addr, uint8_t *p_data, uint32_t size) |
Write an amount of data with specified instruction and address to flash. More... | |
uint32_t | hal_exflash_read (uint32_t addr, uint8_t *p_data, uint32_t size) |
Read an amount of data with specified instruction and address from flash. More... | |
uint32_t | hal_exflash_erase (uint32_t erase_type, uint32_t addr, uint32_t size) |
Erase flash region. More... | |
uint32_t | hal_exflash_block_protect (uint32_t cmp, uint32_t bp) |
Lock area of flash to be software protected against Write and Erase operation.. More... | |
uint32_t | hal_exflash_deepsleep (void) |
the exFlash will go to the Deep Power-Down Mode. More... | |
uint32_t | hal_exflash_wakeup (void) |
exFlash will be released from Deep Power-Down Mode. More... | |
uint32_t | hal_exflash_sr_erase (uint32_t addr) |
Erase single flash security register. More... | |
uint32_t | hal_exflash_sr_program (uint32_t addr, uint8_t *p_data, uint32_t size) |
Write an amount of data into flash security register. More... | |
uint32_t | hal_exflash_sr_read (uint32_t addr, uint8_t *p_data, uint32_t size) |
Read an amount of data from flash security register. More... | |
uint32_t | hal_exflash_sr_protect (uint32_t lb) |
This function provide the write protect control and status to the Security Registers. 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... | |
hal_status_t | hal_exflash_wait_busy (uint32_t retry) |
This function wait for the flash (in qspi mode) to exit the busy state. More... | |
Data transfers functions.
============================================================================== ##### IO operation functions ##### =============================================================================== [..] This subsection provides a set of functions allowing to manage the exFlash data transfers. [..] The exFlash supports XIP and QSPI mode: (#) There are only one modes of transfer: (++) Blocking mode: The communication is performed in polling mode. The HAL status of all data processing is returned by the same function after finishing transfer.
uint32_t hal_exflash_block_protect | ( | uint32_t | cmp, |
uint32_t | bp | ||
) |
Lock area of flash to be software protected against Write and Erase operation..
[in] | cmp | It is used in conjunction the BPs bits to provide more flexibility for the array protection. |
[in] | bp | Specifies the value to be written to the selected bit. This parameter can be one of the EXFLASH_PROTECTED_AREA_SIZE values:
|
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_config | ( | uint32_t | configure, |
uint32_t | value | ||
) |
flash parameter configuration
[in] | configure | flash parameter configuration item |
[in] | value | flash parameter configuration value |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_deepsleep | ( | void | ) |
the exFlash will go to the Deep Power-Down Mode.
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_enable_quad | ( | ll_xqspi_hp_init_t | hp_init | ) |
Enable Quad mode to allow Quad operation.
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_erase | ( | uint32_t | erase_type, |
uint32_t | addr, | ||
uint32_t | size | ||
) |
Erase flash region.
[in] | erase_type | Erase flash with page/sector/chip. |
[in] | addr | Address to erased data in flash, start at EXFLASH_START_ADDR. |
[in] | size | Size of erased bytes. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
void hal_exflash_get_info | ( | uint32_t * | id, |
uint32_t * | size | ||
) |
Get flash id and size.
[out] | id | Pointer to flash id |
[out] | size | Pointer to flash size |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_read | ( | uint32_t | addr, |
uint8_t * | p_data, | ||
uint32_t | size | ||
) |
Read an amount of data with specified instruction and address from flash.
[in] | addr | Address to read data in flash, start at EXFLASH_START_ADDR. |
[out] | p_data | Pointer to data buffer |
[in] | size | Size of buffer bytes |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_exflash_read_status_reg | ( | uint16_t * | p_reg_status | ) |
This function reads the status register of a flash.
[in] | p_reg_status | Pointer of status register. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_exflash_read_uid | ( | uint8_t * | uid | ) |
This function serves to read UID of flash.
[out] | uid | store 8 Byte flash UID |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_sr_erase | ( | uint32_t | addr | ) |
Erase single flash security register.
[in] | addr | Security Registers address of flash |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_sr_program | ( | uint32_t | addr, |
uint8_t * | p_data, | ||
uint32_t | size | ||
) |
Write an amount of data into flash security register.
[in] | addr | Security Registers address of flash |
[out] | p_data | Pointer to data buffer |
[in] | size | Size of data buffer bytes, and need be smaller than single security register |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_sr_protect | ( | uint32_t | lb | ) |
This function provide the write protect control and status to the Security Registers.
[in] | lb | Locked security registers. This parameter can be a combination of the following values: |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_sr_read | ( | uint32_t | addr, |
uint8_t * | p_data, | ||
uint32_t | size | ||
) |
Read an amount of data from flash security register.
[in] | addr | Security Registers address of flash |
[out] | p_data | Pointer to data buffer |
[in] | size | Size of data buffer bytes, and need be smaller than single security register |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
void hal_exflash_timing_set | ( | exflash_timing_param_t * | p_time | ) |
Configure flash electrical characteristic parameters.
[in] | p_time | flash timing characteristics |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_exflash_wait_busy | ( | uint32_t | retry | ) |
This function wait for the flash (in qspi mode) to exit the busy state.
[out] | retry | try times. |
HAL_OK | Operation is OK. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_wakeup | ( | void | ) |
exFlash will be released from Deep Power-Down Mode.
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
uint32_t hal_exflash_write | ( | uint32_t | addr, |
uint8_t * | p_data, | ||
uint32_t | size | ||
) |
Write an amount of data with specified instruction and address to flash.
[in] | addr | Address to write data in flash, start at EXFLASH_START_ADDR. |
[in] | p_data | Pointer to data buffer |
[in] | size | Size of buffer bytes |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_exflash_write_status_reg | ( | uint16_t | reg_status | ) |
This function writes the status register of a flash.
reg_status | An integer value representing the content to be written to the flash status register. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |