Data transfers functions. More...
Functions | |
hal_status_t | hal_exflash_operation_protection (exflash_handle_t *p_exflash, uint32_t base_priority) |
During Flash erase/write operation, Disable external interrupts with a priority less than or equal to base_priority in the system. More... | |
hal_status_t | hal_exflash_write (exflash_handle_t *p_exflash, uint32_t addr, uint8_t *p_data, uint32_t size) |
Write an amount of data with specified instruction and address to flash. More... | |
hal_status_t | hal_exflash_read (exflash_handle_t *p_exflash, uint32_t addr, uint8_t *p_data, uint32_t size) |
Read an amount of data with specified instruction and address from flash. More... | |
hal_status_t | hal_exflash_read_align_word (exflash_handle_t *p_exflash, uint32_t addr, uint8_t *p_data, uint32_t size) |
[High speed]Read an amount of data with specified instruction and address from flash. More... | |
hal_status_t | hal_exflash_erase (exflash_handle_t *p_exflash, uint32_t erase_type, uint32_t addr, uint32_t size) |
Erase flash region. More... | |
hal_status_t | hal_exflash_suspend (exflash_handle_t *p_exflash) |
Suspend flash pragram/erase. More... | |
hal_status_t | hal_exflash_resume (exflash_handle_t *p_exflash) |
Resume flash pragram/erase. More... | |
hal_status_t | hal_exflash_lock (exflash_handle_t *p_exflash, uint32_t lock_type) |
Lock area of flash to be software protected against Write and Erase operation. More... | |
hal_status_t | hal_exflash_unlock (exflash_handle_t *p_exflash) |
Unlock write/erase protected in flash. More... | |
hal_status_t | hal_exflash_deepsleep (exflash_handle_t *p_exflash) |
the exFlash will go to the Deep Power-Down Mode. More... | |
hal_status_t | hal_exflash_wakeup (exflash_handle_t *p_exflash) |
exFlash will be released from Deep Power-Down Mode. More... | |
hal_status_t | hal_exflash_reset (exflash_handle_t *p_exflash) |
Reset exFlash. exFlash will return to its default power-on state and lose all the current volatile settings. More... | |
hal_status_t | hal_exflash_encrypt_mode (exflash_handle_t *p_exflash, uint32_t read_offset, uint32_t key_addr) |
Specify the offset address and encrypted KEY address read by XIP. More... | |
hal_status_t | hal_exflash_write_expand (exflash_handle_t *p_exflash, uint32_t addr, uint8_t *p_data, uint32_t size) |
Expand write an amount of data with specified instruction and address to flash. More... | |
hal_status_t | hal_exflash_read_expand (exflash_handle_t *p_exflash, uint32_t addr, uint8_t *p_data, uint32_t size) |
Expand read an amount of data with specified instruction and address from flash. 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.
hal_status_t hal_exflash_deepsleep | ( | exflash_handle_t * | p_exflash | ) |
the exFlash will go to the Deep Power-Down Mode.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
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_encrypt_mode | ( | exflash_handle_t * | p_exflash, |
uint32_t | read_offset, | ||
uint32_t | key_addr | ||
) |
Specify the offset address and encrypted KEY address read by XIP.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
[in] | read_offset | The value must be 0x0 and EXFLASH_ALIAS_OFFSET. |
[in] | key_addr | The value must be FWCODEKEY_BASE_ADDR(0xA00170E0) and AESKEY_BASE_ADDR(0xA0017060). |
hal_status_t hal_exflash_erase | ( | exflash_handle_t * | p_exflash, |
uint32_t | erase_type, | ||
uint32_t | addr, | ||
uint32_t | size | ||
) |
Erase flash region.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
[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. |
hal_status_t hal_exflash_lock | ( | exflash_handle_t * | p_exflash, |
uint32_t | lock_type | ||
) |
Lock area of flash to be software protected against Write and Erase operation.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
[in] | lock_type | Area need to lock |
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_operation_protection | ( | exflash_handle_t * | p_exflash, |
uint32_t | base_priority | ||
) |
During Flash erase/write operation, Disable external interrupts with a priority less than or equal to base_priority in the system.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
[in] | base_priority | Base Priority value to set. |
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 | ( | exflash_handle_t * | p_exflash, |
uint32_t | addr, | ||
uint8_t * | p_data, | ||
uint32_t | size | ||
) |
Read an amount of data with specified instruction and address from flash.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
[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_align_word | ( | exflash_handle_t * | p_exflash, |
uint32_t | addr, | ||
uint8_t * | p_data, | ||
uint32_t | size | ||
) |
[High speed]Read an amount of data with specified instruction and address from flash.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
[in] | addr | Address to read data in flash, start at EXFLASH_START_ADDR.(Aligned with 4 bytes) |
[out] | p_data | Pointer to data buffer.(Pointer aligned with 4 bytes) |
[in] | size | Size of buffer bytes.number of bytes to read.(A multiple of 4) |
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_expand | ( | exflash_handle_t * | p_exflash, |
uint32_t | addr, | ||
uint8_t * | p_data, | ||
uint32_t | size | ||
) |
Expand read an amount of data with specified instruction and address from flash.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
[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_reset | ( | exflash_handle_t * | p_exflash | ) |
Reset exFlash. exFlash will return to its default power-on state and lose all the current volatile settings.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
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_resume | ( | exflash_handle_t * | p_exflash | ) |
Resume flash pragram/erase.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
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_suspend | ( | exflash_handle_t * | p_exflash | ) |
Suspend flash pragram/erase.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
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_unlock | ( | exflash_handle_t * | p_exflash | ) |
Unlock write/erase protected in flash.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
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_wakeup | ( | exflash_handle_t * | p_exflash | ) |
exFlash will be released from Deep Power-Down Mode.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
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 | ( | exflash_handle_t * | p_exflash, |
uint32_t | addr, | ||
uint8_t * | p_data, | ||
uint32_t | size | ||
) |
Write an amount of data with specified instruction and address to flash.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
[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_expand | ( | exflash_handle_t * | p_exflash, |
uint32_t | addr, | ||
uint8_t * | p_data, | ||
uint32_t | size | ||
) |
Expand write an amount of data with specified instruction and address to flash.
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
[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. |