CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
ci130x_spiflash.h
浏览该文件的文档.
1 
12 #ifndef _CI130X_SPIFLASH_H_
13 #define _CI130X_SPIFLASH_H_
14 
15 #include "ci130x_system.h"
16 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #ifndef SPI0FIFO_BASE
29 #define SPI0FIFO_BASE 0x60000000
30 #endif
31 
32 #define FLASH_MSF (0)
37 typedef enum
38 {
41 
45 typedef enum
46 {
80 
84 typedef enum
85 {
90 
91 int32_t flash_init(spic_base_t spic);
92 int32_t spic_read_unique_id(spic_base_t spic,uint8_t* unique);
93 int32_t spic_read_jedec_id(spic_base_t spic,uint8_t* jedec);
96  uint32_t buf,uint32_t addr,uint32_t size);
98  uint32_t buf,uint32_t addr,uint32_t size);
100 int32_t flash_erase(spic_base_t spic,uint32_t addr,uint32_t size);
101 int32_t flash_write(spic_base_t spic,uint32_t addr,uint32_t buf,uint32_t size);
102 int32_t flash_read(spic_base_t spic,uint32_t buf,uint32_t addr,uint32_t size);
103 //int32_t dnn_mode_config(spic_base_t spic,uint32_t start_addr,uint32_t size);
104 //int32_t flash_dnn_mode(spic_base_t spic,FunctionalState cmd);
105 //uint32_t flash_check_mode(spic_base_t spic);
106 //int32_t spic_quad_mode(spic_base_t spic);
107 //int32_t spic_erase(spic_base_t spic,spic_cmd_code_t code,uint32_t addr);
108 int32_t spic_protect(spic_base_t spic,FunctionalState cmd);
109 //int32_t flash_is_dnn_mode(spic_base_t spic);
110 //int32_t spic_reset(spic_base_t spic);
111 int32_t spic_xipconfig(spic_base_t spic);
112 int32_t flash_clk_div_init(spic_base_t spic);
113 
114 #ifdef __cplusplus
115 }
116 #endif
117 
122 #endif
Definition: ci130x_spiflash.h:74
Definition: ci130x_spiflash.h:57
int32_t spic_erase_security_reg(spic_base_t spic, spic_security_reg_t reg)
擦除FLASH安全寄存器
Definition: ci130x_spiflash.c:561
Definition: ci130x_spiflash.h:49
Definition: ci130x_spiflash.h:71
Definition: ci130x_spiflash.h:50
int32_t flash_clk_div_init(spic_base_t spic)
FLASH时钟初始化
Definition: ci130x_spiflash.c:929
Definition: ci130x_spiflash.h:59
Definition: ci130x_spiflash.h:77
Definition: ci130x_spiflash.h:53
Definition: ci130x_spiflash.h:78
Definition: ci130x_spiflash.h:58
Definition: ci130x_spiflash.h:75
Definition: ci130x_spiflash.h:88
Definition: ci130x_spiflash.h:60
Definition: ci130x_spiflash.h:86
Definition: ci130x_spiflash.h:65
Definition: ci130x_spiflash.h:61
Definition: ci130x_spiflash.h:73
Definition: ci130x_spiflash.h:52
Definition: ci130x_spiflash.h:69
int32_t flash_init(spic_base_t spic)
FLASH普通模式初始化
Definition: ci130x_spiflash.c:949
#define HAL_DTRFLASH_BASE
Definition: ci130x_system.h:479
Definition: ci130x_spiflash.h:64
Definition: ci130x_spiflash.h:67
int32_t spic_xipconfig(spic_base_t spic)
FLASH的XIP模式初始化
Definition: ci130x_spiflash.c:894
int32_t spic_write_security_reg(spic_base_t spic, spic_security_reg_t reg, uint32_t buf, uint32_t addr, uint32_t size)
写FLASH的安全寄存器
Definition: ci130x_spiflash.c:605
int32_t spic_protect(spic_base_t spic, FunctionalState cmd)
FLASH保护设置
Definition: ci130x_spiflash.c:468
Definition: ci130x_spiflash.h:56
Definition: ci130x_spiflash.h:66
int32_t spic_read_unique_id(spic_base_t spic, uint8_t *unique)
读取Unique ID
Definition: ci130x_spiflash.c:304
Definition: ci130x_spiflash.h:39
Definition: ci130x_spiflash.h:63
Definition: ci130x_spiflash.h:87
int32_t spic_security_reg_lock(spic_base_t spic, spic_security_reg_t reg)
FLASH的安全寄存器上锁,慎用:上锁之后将导致该安全寄存器不可再次编程
Definition: ci130x_spiflash.c:690
spic_base_t
SPI控制器定义
Definition: ci130x_spiflash.h:37
chip级定义
int32_t flash_write(spic_base_t spic, uint32_t addr, uint32_t buf, uint32_t size)
写FLASH,兼容32M以上Flash
Definition: ci130x_spiflash.c:1384
spic_security_reg_t
FLASH安全寄存器定义
Definition: ci130x_spiflash.h:84
int32_t spic_read_jedec_id(spic_base_t spic, uint8_t *jedec)
读取Jedec ID
Definition: ci130x_spiflash.c:327
Definition: ci130x_spiflash.h:62
int32_t flash_erase(spic_base_t spic, uint32_t addr, uint32_t size)
FLASH擦除,兼容32M以上Flash
Definition: ci130x_spiflash.c:1353
Definition: ci130x_spiflash.h:70
FunctionalState
Definition: ci130x_system.h:86
Definition: ci130x_spiflash.h:47
int32_t spic_read_security_reg(spic_base_t spic, spic_security_reg_t reg, uint32_t buf, uint32_t addr, uint32_t size)
读FLASH的安全寄存器
Definition: ci130x_spiflash.c:650
Definition: ci130x_spiflash.h:51
int32_t flash_read(spic_base_t spic, uint32_t buf, uint32_t addr, uint32_t size)
读FLASH,兼容32M以上Flash
Definition: ci130x_spiflash.c:1470
Definition: ci130x_spiflash.h:55
Definition: ci130x_spiflash.h:48
Definition: ci130x_spiflash.h:76
Definition: ci130x_spiflash.h:68
spic_cmd_code_t
FLASH命令定义
Definition: ci130x_spiflash.h:45
Definition: ci130x_spiflash.h:54
Definition: ci130x_spiflash.h:72