Data transfers functions.
More...
|
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. 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_exflash_deepsleep()
the exFlash will go to the Deep Power-Down Mode.
- Note
- This function is used only in Indirect Write Mode.
- Parameters
-
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
- Return values
-
◆ hal_exflash_erase()
Erase flash region.
- Note
- All sectors that have address in range of [addr, addr+len] will be erased. If addr is not sector aligned, preceding data on the sector that addr belongs to will also be erased. If (addr + size) is not sector aligned, the whole sector will also be erased. If erase_type is EXFLASH_ERASE_CHIP , all data in flash will be erased ignored addr and size.
- Parameters
-
[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. |
- Return values
-
◆ hal_exflash_lock()
Lock area of flash to be software protected against Write and Erase operation.
- Note
- Locked area only to be read.
- Parameters
-
[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 |
- Return values
-
◆ hal_exflash_operation_protection()
During Flash erase/write operation, Disable external interrupts with a priority less than or equal to base_priority in the system.
- Parameters
-
[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. |
- Return values
-
◆ hal_exflash_read()
Read an amount of data with specified instruction and address from flash.
- Note
- This function is used only in non-encrypted Indirect Read Mode.
- Parameters
-
[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 |
- Return values
-
◆ hal_exflash_read_align_word()
[High speed]Read an amount of data with specified instruction and address from flash.
- Note
- This function is used only in non-encrypted Indirect Read Mode. Data content needs to be processed in 4-byte reverse order. And all parameters need to be aligned with 4 bytes.
- Parameters
-
[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) |
- Return values
-
◆ hal_exflash_reset()
Reset exFlash.
exFlash will return to its default power-on state and lose all the current volatile settings.
- Note
- This function is used only in Indirect Write Mode.
- Parameters
-
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
- Return values
-
◆ hal_exflash_resume()
Resume flash pragram/erase.
- Note
- The Resume instruction resumes a suspended Page Program, Sector Erase, or Block Erase operation. Before issuing the Resume instruction to restart a suspended erase operation, make sure that there is no Page Program operation in progress. This function is only used in XIP mode.
- Parameters
-
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
- Return values
-
◆ hal_exflash_suspend()
Suspend flash pragram/erase.
- Note
- The Suspend instruction interrupts a Page Program, Sector Erase, or Block Erase operation to allow access to the memory array. After the program or erase operation has entered the suspended state, the memory array can be read except for the page being programmed or the sector or block being erased. This function is only used in XIP mode.
- Parameters
-
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
- Return values
-
◆ hal_exflash_unlock()
Unlock write/erase protected in flash.
- Note
- This function will unlock all chip.
- Parameters
-
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
- Return values
-
◆ hal_exflash_wakeup()
exFlash will be released from Deep Power-Down Mode.
- Note
- This function is used only in Indirect Write Mode.
- Parameters
-
[in] | p_exflash | Pointer to an exFlash handle which contains the configuration information for the specified exFlash module. |
- Return values
-
◆ hal_exflash_write()
Write an amount of data with specified instruction and address to flash.
- Note
- This function is used only in Indirect Write Mode. In secure mode, address alignment requires 4 bytes.
- Parameters
-
[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 |
- Return values
-