VSF Documented
Data Structures | Macros | Typedefs | Functions
flash.c File Reference
#include "../driver.h"
#include "service/vsf_service.h"
#include "bf0_hal.h"
#include "sifli_bbm.h"
#include "hal/driver/common/flash/flash_template.inc"

Data Structures

struct  vsf_hw_flash_t
 

Macros

#define VSF_HW_FLASH_CFG_MULTI_CLASS   VSF_FLASH_CFG_MULTI_CLASS
 
#define __VSF_HW_FLASH_CFG_PROTECT   interrupt
 
#define __VSF_HW_FLASH_USE_DMA   DISABLED
 
#define BOOT_FROM_SIP_PUYA   1
 
#define BOOT_FROM_SIP_GD   2
 
#define BOOT_FROM_NOR   3
 
#define BOOT_FROM_NAND   4
 
#define BOOT_FROM_SD   5
 
#define BOOT_FROM_EMMC   6
 
#define __vsf_hw_flash_protect    vsf_protect(__VSF_HW_FLASH_CFG_PROTECT)
 
#define __vsf_hw_flash_unprotect    vsf_unprotect(__VSF_HW_FLASH_CFG_PROTECT)
 
#define VSF_FLASH_CFG_REIMPLEMENT_API_CAPABILITY   ENABLED
 
#define VSF_FLASH_CFG_ERASE_ALL_TEMPLATE   ENABLED
 
#define VSF_FLASH_CFG_ERASE_ONE_SECTOR_TEMPLATE   ENABLED
 
#define VSF_FLASH_CFG_WRITE_ONE_SECTOR_TEMPLATE   ENABLED
 
#define VSF_FLASH_CFG_READ_ONE_SECTOR_TEMPLATE   ENABLED
 
#define VSF_FLASH_CFG_IMP_PREFIX   vsf_hw
 
#define VSF_FLASH_CFG_IMP_UPCASE_PREFIX   VSF_HW
 
#define VSF_FLASH_CFG_IMP_LV0(__IDX, __HAL_OP)
 

Typedefs

typedef struct vsf_hw_flash_t vsf_hw_flash_t
 

Functions

uint32_t flash_get_freq (int clk_module, uint16_t clk_div, uint8_t hcpu)
 
vsf_err_t vsf_hw_flash_init (vsf_hw_flash_t *hw_flash_ptr, vsf_flash_cfg_t *cfg_ptr)
 
void vsf_hw_flash_fini (vsf_hw_flash_t *hw_flash_ptr)
 
fsm_rt_t vsf_hw_flash_enable (vsf_hw_flash_t *hw_flash_ptr)
 
fsm_rt_t vsf_hw_flash_disable (vsf_hw_flash_t *hw_flash_ptr)
 
void vsf_hw_flash_irq_enable (vsf_hw_flash_t *hw_flash_ptr, vsf_flash_irq_mask_t irq_mask)
 
void vsf_hw_flash_irq_disable (vsf_hw_flash_t *hw_flash_ptr, vsf_flash_irq_mask_t irq_mask)
 
vsf_err_t vsf_hw_flash_erase_multi_sector (vsf_hw_flash_t *hw_flash_ptr, vsf_flash_size_t offset, vsf_flash_size_t size)
 
vsf_err_t vsf_hw_flash_write_multi_sector (vsf_hw_flash_t *hw_flash_ptr, vsf_flash_size_t offset, uint8_t *buffer, vsf_flash_size_t size)
 
vsf_err_t vsf_hw_flash_read_multi_sector (vsf_hw_flash_t *hw_flash_ptr, vsf_flash_size_t offset, uint8_t *buffer, vsf_flash_size_t size)
 
vsf_flash_status_t vsf_hw_flash_status (vsf_hw_flash_t *hw_flash_ptr)
 
vsf_flash_capability_t vsf_hw_flash_capability (vsf_hw_flash_t *hw_flash_ptr)
 

Macro Definition Documentation

◆ VSF_HW_FLASH_CFG_MULTI_CLASS

#define VSF_HW_FLASH_CFG_MULTI_CLASS   VSF_FLASH_CFG_MULTI_CLASS

◆ __VSF_HW_FLASH_CFG_PROTECT

#define __VSF_HW_FLASH_CFG_PROTECT   interrupt

◆ __VSF_HW_FLASH_USE_DMA

#define __VSF_HW_FLASH_USE_DMA   DISABLED

◆ BOOT_FROM_SIP_PUYA

#define BOOT_FROM_SIP_PUYA   1

◆ BOOT_FROM_SIP_GD

#define BOOT_FROM_SIP_GD   2

◆ BOOT_FROM_NOR

#define BOOT_FROM_NOR   3

◆ BOOT_FROM_NAND

#define BOOT_FROM_NAND   4

◆ BOOT_FROM_SD

#define BOOT_FROM_SD   5

◆ BOOT_FROM_EMMC

#define BOOT_FROM_EMMC   6

◆ __vsf_hw_flash_protect

#define __vsf_hw_flash_protect    vsf_protect(__VSF_HW_FLASH_CFG_PROTECT)

◆ __vsf_hw_flash_unprotect

#define __vsf_hw_flash_unprotect    vsf_unprotect(__VSF_HW_FLASH_CFG_PROTECT)

◆ VSF_FLASH_CFG_REIMPLEMENT_API_CAPABILITY

#define VSF_FLASH_CFG_REIMPLEMENT_API_CAPABILITY   ENABLED

◆ VSF_FLASH_CFG_ERASE_ALL_TEMPLATE

#define VSF_FLASH_CFG_ERASE_ALL_TEMPLATE   ENABLED

◆ VSF_FLASH_CFG_ERASE_ONE_SECTOR_TEMPLATE

#define VSF_FLASH_CFG_ERASE_ONE_SECTOR_TEMPLATE   ENABLED

◆ VSF_FLASH_CFG_WRITE_ONE_SECTOR_TEMPLATE

#define VSF_FLASH_CFG_WRITE_ONE_SECTOR_TEMPLATE   ENABLED

◆ VSF_FLASH_CFG_READ_ONE_SECTOR_TEMPLATE

#define VSF_FLASH_CFG_READ_ONE_SECTOR_TEMPLATE   ENABLED

◆ VSF_FLASH_CFG_IMP_PREFIX

#define VSF_FLASH_CFG_IMP_PREFIX   vsf_hw

◆ VSF_FLASH_CFG_IMP_UPCASE_PREFIX

#define VSF_FLASH_CFG_IMP_UPCASE_PREFIX   VSF_HW

◆ VSF_FLASH_CFG_IMP_LV0

#define VSF_FLASH_CFG_IMP_LV0 (   __IDX,
  __HAL_OP 
)
Value:
vsf_hw_flash_t vsf_hw_flash ## __IDX = { \
.cfg = { \
.isr = { \
.target_ptr = NULL, \
}, \
}, \
.is_enabled = false, \
__HAL_OP \
};
#define NULL
Definition lvgl.h:26
vsf_flash_isr_t isr
Definition vsf_template_flash.h:148
vsf_flash_isr_handler_t * handler_fn
Definition vsf_template_flash.h:143
Definition flash.c:45
vsf_flash_cfg_t cfg
Definition flash.c:49

Typedef Documentation

◆ vsf_hw_flash_t

Function Documentation

◆ flash_get_freq()

uint32_t flash_get_freq ( int  clk_module,
uint16_t  clk_div,
uint8_t  hcpu 
)
extern

◆ vsf_hw_flash_init()

vsf_err_t vsf_hw_flash_init ( vsf_hw_flash_t hw_flash_ptr,
vsf_flash_cfg_t cfg_ptr 
)

◆ vsf_hw_flash_fini()

void vsf_hw_flash_fini ( vsf_hw_flash_t hw_flash_ptr)

◆ vsf_hw_flash_enable()

fsm_rt_t vsf_hw_flash_enable ( vsf_hw_flash_t hw_flash_ptr)

◆ vsf_hw_flash_disable()

fsm_rt_t vsf_hw_flash_disable ( vsf_hw_flash_t hw_flash_ptr)

◆ vsf_hw_flash_irq_enable()

void vsf_hw_flash_irq_enable ( vsf_hw_flash_t hw_flash_ptr,
vsf_flash_irq_mask_t  irq_mask 
)

◆ vsf_hw_flash_irq_disable()

void vsf_hw_flash_irq_disable ( vsf_hw_flash_t hw_flash_ptr,
vsf_flash_irq_mask_t  irq_mask 
)

◆ vsf_hw_flash_erase_multi_sector()

vsf_err_t vsf_hw_flash_erase_multi_sector ( vsf_hw_flash_t hw_flash_ptr,
vsf_flash_size_t  offset,
vsf_flash_size_t  size 
)

◆ vsf_hw_flash_write_multi_sector()

vsf_err_t vsf_hw_flash_write_multi_sector ( vsf_hw_flash_t hw_flash_ptr,
vsf_flash_size_t  offset,
uint8_t buffer,
vsf_flash_size_t  size 
)

◆ vsf_hw_flash_read_multi_sector()

vsf_err_t vsf_hw_flash_read_multi_sector ( vsf_hw_flash_t hw_flash_ptr,
vsf_flash_size_t  offset,
uint8_t buffer,
vsf_flash_size_t  size 
)

◆ vsf_hw_flash_status()

vsf_flash_status_t vsf_hw_flash_status ( vsf_hw_flash_t hw_flash_ptr)

◆ vsf_hw_flash_capability()

vsf_flash_capability_t vsf_hw_flash_capability ( vsf_hw_flash_t hw_flash_ptr)