Bouffalo SDK  1.0
Bouffalolab Software Development Kit
bflb_flash.h File Reference
#include "bflb_core.h"
#include "bflb_sflash.h"
Include dependency graph for bflb_flash.h:

Go to the source code of this file.

Data Structures

struct  bflb_flash_aes_config_s
 

Macros

#define FLASH_IOMODE_NIO   0
 
#define FLASH_IOMODE_DO   1
 
#define FLASH_IOMODE_QO   2
 
#define FLASH_IOMODE_DIO   3
 
#define FLASH_IOMODE_QIO   4
 
#define FLASH_AES_KEY_128BITS   0
 
#define FLASH_AES_KEY_192BITS   2
 
#define FLASH_AES_KEY_256BITS   1
 
#define FLASH_AES_KEY_DOUBLE_128BITS   3
 

Functions

int bflb_flash_init (void)
 Initialize flash. More...
 
uint32_t bflb_flash_get_jedec_id (void)
 Get flash jedec id. More...
 
uint32_t bflb_flash_get_size (void)
 get flash size More...
 
void bflb_flash_get_cfg (uint8_t **cfg_addr, uint32_t *len)
 Get flash config. More...
 
void bflb_flash_set_iomode (uint8_t iomode)
 Set flash iomode. More...
 
uint32_t bflb_flash_get_image_offset (void)
 Get flash image offset. More...
 
int bflb_flash_erase (uint32_t addr, uint32_t len)
 Erase flash with sectors. More...
 
int bflb_flash_write (uint32_t addr, uint8_t *data, uint32_t len)
 Write data into flash. More...
 
int bflb_flash_read (uint32_t addr, uint8_t *data, uint32_t len)
 Read data from flash. More...
 
int bflb_flash_get_unique_id (uint8_t *data, uint8_t id_len)
 read flash unique id More...
 
int bflb_flash_set_cache (uint8_t cont_read, uint8_t cache_enable, uint8_t cache_way_disable, uint32_t flash_offset)
 Config flash cache. More...
 
void bflb_flash_aes_init (struct bflb_flash_aes_config_s *config)
 Initialize flash aes controller. More...
 
void bflb_flash_aes_enable (void)
 Enable flash decrypt with aes. More...
 
void bflb_flash_aes_disable (void)
 Disable flash decrypt with aes. More...
 
void bflb_flash_jump_encrypted_app (uint8_t index, uint32_t flash_addr, uint32_t len)
 Initialize flash jump to encrypted app. More...