HPM SDK
HPMicro Software Development Kit
hpm_romapi.h File Reference

Go to the source code of this file.

Data Structures

union  api_boot_arg_t
 Enter Bootloader API argument. More...
 
struct  exip_region_param_t
 
struct  exip_region_context_t
 
struct  otp_driver_interface_t
 OTP driver interface. More...
 
struct  xpi_driver_interface_t
 XPI driver interface. More...
 
struct  xpi_nor_driver_interface_t
 XPI NOR driver interface. More...
 
struct  exip_driver_interface_t
 EXIP driver interface. More...
 
struct  bootloader_api_table_t
 Bootloader API table. More...
 

Macros

#define HPM_XPI0_BASE   (0xF3000000UL)
 
#define HPM_XPI0   ((XPI_Type *) HPM_XPI0_BASE)
 
#define API_BOOT_TAG   (0xEBU)
 
#define API_BOOT_SRC_OTP   (0U)
 
#define API_BOOT_SRC_PRIMARY   (1U)
 
#define API_BOOT_SRC_SERIAL_BOOT   (2U)
 
#define API_BOOT_SRC_ISP   (3U)
 
#define API_BOOT_PERIPH_AUTO   (0U)
 
#define API_BOOT_PERIPH_UART   (1U)
 
#define API_BOOT_PERIPH_USBHID   (2U)
 
#define ROM_API_TABLE_ROOT   ((const bootloader_api_table_t *)0x2001FF00U)
 

Functions

static hpm_stat_t rom_enter_bootloader (void *ctx)
 Eneter specified Boot mode. More...
 
static hpm_stat_t rom_xpi_nor_get_config (XPI_Type *base, xpi_nor_config_t *nor_cfg, xpi_nor_config_option_t *cfg_option)
 Get XPI NOR configuration via cfg_option. More...
 
static hpm_stat_t rom_xpi_nor_init (XPI_Type *base, xpi_nor_config_t *nor_config)
 Initialize XPI NOR based on nor_config. More...
 
static hpm_stat_t rom_xpi_nor_erase (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t start, uint32_t length)
 Erase specified FLASH region. More...
 
static hpm_stat_t rom_xpi_nor_erase_sector (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t start)
 Erase specified FLASH sector in blocking way. More...
 
static hpm_stat_t rom_xpi_nor_erase_sector_nonblocking (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t start)
 Erase specified FLASH sector in non-blocking way. More...
 
static hpm_stat_t rom_xpi_nor_erase_block (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t start)
 Erase specified FLASH blcok in blocking way. More...
 
static hpm_stat_t rom_xpi_nor_erase_block_nonblocking (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t start)
 Erase specified FLASH blcok in non-blocking way. More...
 
static hpm_stat_t rom_xpi_nor_erase_chip (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config)
 Erase the whole FLASH in blocking way. More...
 
static hpm_stat_t rom_xpi_nor_erase_chip_nonblocking (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config)
 Erase the whole FLASH in non-blocking way. More...
 
static hpm_stat_t rom_xpi_nor_program (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, const uint32_t *src, uint32_t dst_addr, uint32_t length)
 Program data to specified FLASH address in blocking way. More...
 
static hpm_stat_t rom_xpi_nor_page_program_nonblocking (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, const uint32_t *src, uint32_t dst_addr, uint32_t length)
 Page-Program data to specified FLASH address in non-blocking way. More...
 
static hpm_stat_t rom_xpi_nor_read (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t *dst, uint32_t start, uint32_t length)
 Read data from specified FLASH address. More...
 
static hpm_stat_t rom_xpi_nor_auto_config (XPI_Type *base, xpi_nor_config_t *config, xpi_nor_config_option_t *cfg_option)
 Automatically configure XPI NOR based on cfg_option. More...
 
static hpm_stat_t rom_xpi_nor_get_property (XPI_Type *base, xpi_nor_config_t *nor_cfg, uint32_t property_id, uint32_t *value)
 Get XPI NOR properties. More...
 
static hpm_stat_t rom_xpi_nor_get_status (XPI_Type *base, xpi_xfer_channel_t channel, const xpi_nor_config_t *nor_config, uint32_t addr, uint16_t *out_status)
 Return the status register value on XPI NOR FLASH. More...
 
static ATTR_RAMFUNC bool rom_xpi_nor_remap_config (XPI_Type *base, uint32_t start, uint32_t len, uint32_t offset)
 Configure the XPI Address Remapping Logic. More...
 
static ATTR_RAMFUNC void rom_xpi_nor_remap_disable (XPI_Type *base)
 Disable XPI Remapping logic. More...
 
static ATTR_RAMFUNC bool rom_xpi_nor_is_remap_enabled (XPI_Type *base)
 Check whether XPI Remapping is enabled. More...
 
static ATTR_RAMFUNC bool rom_xpi_nor_exip_region_config (XPI_Type *base, uint32_t index, exip_region_param_t *param)
 Configure Specified EXiP Region. More...
 
static ATTR_RAMFUNC void rom_xpi_nor_exip_region_disable (XPI_Type *base, uint32_t index)
 Disable EXiP Feature on specified EXiP Region. More...
 
static ATTR_RAMFUNC void rom_xpi_nor_exip_enable (XPI_Type *base)
 Enable global EXiP logic. More...
 
static ATTR_RAMFUNC void rom_xpi_nor_exip_disable (XPI_Type *base)
 Disable global EXiP logic. More...