Classes | Macros | Typedefs | Enumerations | Functions
gr55xx_hal_exflash.h File Reference

Header file containing functions prototypes of EXFLASH HAL library. More...

`#include "gr55xx_ll_xqspi.h"`
`#include "gr55xx_hal_xqspi.h"`
`#include "gr55xx_hal_def.h"`
Include dependency graph for gr55xx_hal_exflash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | _exflash_handle
| exFlash handle Structure definition More...
struct | _exflash_timing_param
| exFlash AC characteristics More...
struct | _hal_exflash_callback
| HAL_EXFLASH Callback function definition. More...

## Macros
#define | HAL_EXFLASH_ERROR_NONE ((uint32_t)0x00000000)
| No error More...
#define | HAL_EXFLASH_ERROR_TIMEOUT ((uint32_t)0x00000001)
| Timeout error More...
#define | HAL_EXFLASH_ERROR_TRANSFER ((uint32_t)0x00000002)
| Transfer error More...
#define | HAL_EXFLASH_ERROR_ID ((uint32_t)0x00000003)
| Flash ID error More...
#define | HAL_EXFLASH_ERROR_QUAD ((uint32_t)0x00000004)
| Quad mode error More...
#define | HAL_EXFLASH_ERROR_INVALID_PARAM ((uint32_t)0x00000008)
| Invalid parameters error. More...
#define | EXFLASH_ERASE_SECTOR 0
| Sector erase. More...
#define | EXFLASH_ERASE_CHIP 1
| Chip erase More...
#define | EXFLASH_SINGLE_PAGE_TYPE 0
| single page More...
#define | EXFLASH_DUAL_PAGE_TYPE 1
| dual page More...
#define | EXFLASH_QUAD_PAGE_TYPE 2
| dual page More...
#define | EXFLASH_SIZE_PAGE_BYTES ((uint32_t)256)
| Page size in Bytes More...
#define | EXFLASH_SIZE_SECTOR_BYTES ((uint32_t)4096)
| Sector size in Bytes More...
#define | EXFLASH_SIZE_CHIP_BYTES ((uint32_t)0x1000000)
| Chip size in Bytes More...
#define | EXFLASH_START_ADDR FLASH_BASE
| Flash start address More...
#define | EXFLASH_SIZE GR55XX_FLASH_SIZE
| Flash size More...
#define | EXFLASH_END_ADDR (EXFLASH_START_ADDR + EXFLASH_SIZE)
| Flash end address More...
#define | EXFLASH_ALIAS_OFFSET (0x02000000UL)
| Alias address offset More...
#define | EXFLASH_ALIAS_ADDR (EXFLASH_START_ADDR + EXFLASH_ALIAS_OFFSET)
| Alias start address More...
#define | EXFLASH_LOCK_AREA_NONE 0
| Offset NONE More...
#define | EXFLASH_LOCK_AREA_UPPER_1_8 1
| Offset 0x070000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_UPPER_1_4 2
| Offset 0x060000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_UPPER_1_2 3
| Offset 0x040000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_LOWER_1_8 9
| Offset 0x000000 - 0x00FFFF. More...
#define | EXFLASH_LOCK_AREA_LOWER_1_4 10
| Offset 0x000000 - 0x01FFFF. More...
#define | EXFLASH_LOCK_AREA_LOWER_1_2 11
| Offset 0x000000 - 0x03FFFF. More...
#define | EXFLASH_LOCK_AREA_ALL 12
| Offset 0x000000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_TOP_4K 17
| Offset 0x07F000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_TOP_8K 18
| Offset 0x07E000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_TOP_16K 19
| Offset 0x07C000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_TOP_32K 20
| Offset 0x078000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_BOTTOM_4K 25
| Offset 0x000000 - 0x000FFF. More...
#define | EXFLASH_LOCK_AREA_BOTTOM_8K 26
| Offset 0x000000 - 0x001FFF. More...
#define | EXFLASH_LOCK_AREA_BOTTOM_16K 27
| Offset 0x000000 - 0x003FFF. More...
#define | EXFLASH_LOCK_AREA_BOTTOM_32K 28
| Offset 0x000000 - 0x007FFF. More...
#define | EXFLASH_LOCK_AREA_LOWER_7_8 33
| Offset 0x070000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_LOWER_3_4 34
| Offset 0x060000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_UPPER_7_8 41
| Offset 0x000000 - 0x00FFFF. More...
#define | EXFLASH_LOCK_AREA_UPPER_3_4 42
| Offset 0x000000 - 0x01FFFF. More...
#define | EXFLASH_LOCK_AREA_LOWER_127_128 49
| Offset 0x000000 - 0x07EFFF. More...
#define | EXFLASH_LOCK_AREA_LOWER_63_64 50
| Offset 0x000000 - 0x07DFFF. More...
#define | EXFLASH_LOCK_AREA_LOWER_31_32 51
| Offset 0x000000 - 0x07BFFF. More...
#define | EXFLASH_LOCK_AREA_LOWER_15_16 52
| Offset 0x000000 - 0x077FFF. More...
#define | EXFLASH_LOCK_AREA_UPPER_127_128 57
| Offset 0x001000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_UPPER_63_64 58
| Offset 0x002000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_UPPER_31_32 59
| Offset 0x004000 - 0x07FFFF. More...
#define | EXFLASH_LOCK_AREA_UPPER_15_16 60
| Offset 0x008000 - 0x07FFFF. More...
#define | HAL_EXFLASH_RETRY_DEFAULT_VALUE ((uint32_t)40000)
| 400000 times More...
#define | __HAL_EXFLASH_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_EXFLASH_STATE_RESET)
| Reset exFlash handle states. More...
#define | __HAL_EXFLASH_POWER_ON() ll_xqspi_enable_exflash_power()
| Enable the specified exFlash power. More...
#define | __HAL_EXFLASH_POWER_OFF() ll_xqspi_disable_exflash_power()
| Disable the specified exFlash power. More...
#define | __HAL_EXFLASH_POWER_IS_ON() ll_xqspi_is_enable_exflash_power()
| Check the specified exFlash power state. More...
#define | IS_EXFLASH_ERASE_TYPE(__TYPE__)
| Check if exFlash erase type is valid. More...
#define | IS_EXFLASH_LOCK_AREA(__AREA__)
| Check if exFlash lock area type is valid. More...

## Typedefs
typedef struct _exflash_handle | exflash_handle_t
| exFlash handle Structure definition More...
typedef struct _exflash_timing_param | exflash_timing_param_t
| exFlash AC characteristics More...
typedef ll_xqspi_hp_init_t | exflash_hp_init_t
| HP Mode structure definition. More...
typedef struct _hal_exflash_callback | hal_exflash_callback_t
| HAL_EXFLASH Callback function definition. More...

## Enumerations
enum | hal_exflash_state_t { HAL_EXFLASH_STATE_RESET = 0x00, HAL_EXFLASH_STATE_READY = 0x01, HAL_EXFLASH_STATE_BUSY = 0x02, HAL_EXFLASH_STATE_BUSY_READ = 0x12, HAL_EXFLASH_STATE_BUSY_WRITE = 0x22, HAL_EXFLASH_STATE_BUSY_ERASE = 0x42, HAL_EXFLASH_STATE_SUSPEND_WRITE = 0x21, HAL_EXFLASH_STATE_SUSPEND_ERASE = 0x41, HAL_EXFLASH_STATE_ERROR = 0x04 }
| HAL exFlash State Enumerations definition. More...
enum | hal_exflash_security_t { HAL_EXFLASH_UNENCRYPTED = 0x00, HAL_EXFLASH_ENCRYPTED = 0x01 }
| HAL exFlash Security Enumerations definition. More...

## Functions
hal_status_t | hal_exflash_init (void)
| Initialize the exFlash according to the specified parameters in the exflash_init_t and initialize the associated handle. More...
hal_status_t | hal_exflash_deinit (void)
| De-initialize the exFlash peripheral. More...
void | hal_exflash_msp_init (void)
| Initialize the exFlash MSP. More...
void | hal_exflash_msp_deinit (void)
| De-initialize the exFlash MSP. More...
void | hal_exflash_timing_set (exflash_timing_param_t *p_time)
| According to the model of internal flash, configure AC parameters to meet the requirements of flash operation timing. More...
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. More...
void | hal_exflash_set_security (hal_exflash_security_t mode)
| Configure the security mode of flash interface. More...
hal_exflash_security_t | hal_exflash_get_security (void)
| Read the security mode of flash interface. More...
hal_status_t | hal_exflash_page_configure (uint32_t size_type)
| Configure page programming buffer size. More...
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. More...
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. More...
hal_status_t | hal_exflash_erase (uint32_t erase_type, uint32_t addr, uint32_t size)
| Erase flash region. More...
hal_status_t | hal_exflash_suspend (void)
| Suspend flash pragram/erase. More...
hal_status_t | hal_exflash_resume (void)
| Resume flash pragram/erase. More...
hal_status_t | hal_exflash_lock (uint32_t lock_type)
| Lock area of flash to be software protected against Write and Erase operation. More...
hal_status_t | hal_exflash_unlock (void)
| Unlock write/erase protected in flash. More...
hal_status_t | hal_exflash_deepsleep (void)
| the exFlash will go to the Deep Power-Down Mode. More...
hal_status_t | hal_exflash_wakeup (void)
| exFlash will be released from Deep Power-Down Mode. More...
hal_status_t | hal_exflash_enable_quad (exflash_hp_init_t *hp_init)
| Enable Quad mode to allow Quad operation. More...
hal_status_t | hal_exflash_read_uid (uint8_t *uid)
| This function serves to read UID of flash. More...
hal_exflash_state_t | hal_exflash_get_state (void)
| Return the exFlash handle state. More...
uint32_t | hal_exflash_get_error (void)
| Return the exFlash error code. 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...

## Detailed Description

Header file containing functions prototypes of EXFLASH HAL library.

Author
  BLE Driver Team

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file gr55xx_hal_exflash.h.