Data transfers functions.
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 Mirror Mode.
- Return values
-
◆ hal_exflash_enable_quad()
Enable Quad mode to allow Quad operation.
- Note
- This function is used only in Mirror Mode.
- Parameters
-
hp_init | HP Mode structure definition |
- Return values
-
◆ hal_exflash_erase()
hal_status_t hal_exflash_erase |
( |
uint32_t |
erase_type, |
|
|
uint32_t |
addr, |
|
|
uint32_t |
size |
|
) |
| |
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] | 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_get_security()
Read the security mode of flash interface.
- Return values
-
◆ hal_exflash_lock()
Lock area of flash to be software protected against Write and Erase operation.
- Note
- This function is used only in Mirror Mode.
- Parameters
-
[in] | lock_type | Area need to lock |
- Return values
-
◆ hal_exflash_operation_protection()
hal_status_t hal_exflash_operation_protection |
( |
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.
- Parameters
-
[in] | base_priority | Base Priority value to set. |
- Return values
-
◆ hal_exflash_page_configure()
hal_status_t hal_exflash_page_configure |
( |
uint32_t |
size_type | ) |
|
Configure page programming buffer size.
- Note
- This function provides a 256/512/1024 Byte page programming buffer that can increase programming performance. However, in encrypted mode, only support 256 Byte page programming.
- Parameters
-
size_type | This parameter can be one of the following values:
- EXFLASH_SINGLE_PAGE_TYPE
- EXFLASH_DUAL_PAGE_TYPE
- EXFLASH_QUAD_PAGE_TYPE
|
◆ hal_exflash_read()
hal_status_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.
- Note
- This function is used only in non-encrypted Indirect Read Mode.
- Parameters
-
[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_uid()
This function serves to read UID of flash.
- Parameters
-
[out] | uid | store 16 Byte flash UID |
- 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.
- Return values
-
◆ hal_exflash_set_security()
Configure the security mode of flash interface.
- Note
- If the security mode of flash interface is set to encrypted. the plaintext data will be stored as cipertext when the hal_exflash_write is called. and the cipertext data stored in flash will be read as plaintext data when the hal_exflash_read is called.
- Parameters
-
[in] | mode | Specifies the value to be written to the selected enum.
- HAL_EXFLASH_UNENCRYPTED: Data will be not encrypted and decrypted in write-read operations
- HAL_EXFLASH_ENCRYPTED: Data will be encrypted and decrypted in write-read operations
|
◆ 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.
- Return values
-
◆ hal_exflash_timing_set()
According to the model of internal flash, configure AC parameters to meet the requirements of flash operation timing.
- Note
- If this function is not called, the flash interface will use default parameters.
- Parameters
-
[in] | p_time | Pointer to a timing structure which contains the AC parameters information for the specified exFlash module. |
◆ hal_exflash_unlock()
Unlock write/erase protected in flash.
- Note
- This function is used only in Mirror Mode.
- Return values
-
◆ hal_exflash_wakeup()
exFlash will be released from Deep Power-Down Mode.
- Note
- This function is used only in Mirror Mode.
- Return values
-
◆ hal_exflash_write()
hal_status_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.
- Note
- This function is used only in Indirect Write Mode. In secure mode, address alignment requires 4 bytes.
- Parameters
-
[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
-