XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
SPI Flash W25QXX 的协作图:

结构体

struct  xwds_w25qxx_cmd
 W25QXX Flash 命令 更多...
 
struct  xwds_w25qxx_parameter
 W25QXX Flash 参数 更多...
 
struct  xwds_w25qxx
 W25QXX Flash 设备 更多...
 
struct  xwds_w25qxx_driver
 W25QXX驱动函数表 更多...
 

宏定义

#define XWDS_W25QXX_CMD_MAX_PAYLOAD   256U
 

枚举

enum  xwds_w25qxx_cmd_em {
  XWDS_W25QXX_CMD_WRITE_DISABLE , XWDS_W25QXX_CMD_WRITE_ENABLE , XWDS_W25QXX_CMD_READ_STATUS_REG_1 , XWDS_W25QXX_CMD_READ_STATUS_REG_2 ,
  XWDS_W25QXX_CMD_READ_STATUS_REG_3 , XWDS_W25QXX_CMD_WRITE_STATUS_REG_1 , XWDS_W25QXX_CMD_WRITE_STATUS_REG_2 , XWDS_W25QXX_CMD_WRITE_STATUS_REG_3 ,
  XWDS_W25QXX_CMD_READ_DATA , XWDS_W25QXX_CMD_FAST_READ_DATA , XWDS_W25QXX_CMD_SET_READ_PARAMETERS , XWDS_W25QXX_CMD_PAGE_PROGRAM ,
  XWDS_W25QXX_CMD_32KBLOCK_ERASE , XWDS_W25QXX_CMD_64KBLOCK_ERASE , XWDS_W25QXX_CMD_SECTOR_ERASE , XWDS_W25QXX_CMD_CHIP_ERASE ,
  XWDS_W25QXX_CMD_POWER_DOWN , XWDS_W25QXX_CMD_RELEASE_POWER_DOWN , XWDS_W25QXX_CMD_UNIQUE_ID , XWDS_W25QXX_CMD_MANUFACTURER_DEVICE_ID ,
  XWDS_W25QXX_CMD_JEDEC_DEVICE_ID , XWDS_W25QXX_CMD_ENTER_4BYTE_ADDR_MODE , XWDS_W25QXX_CMD_EXIT_4BYTE_ADDR_MODE , XWDS_W25QXX_CMD_ENTER_QPI_MODE ,
  XWDS_W25QXX_CMD_EXIT_QPI_MODE , XWDS_W25QXX_CMD_ENABLE_RESET , XWDS_W25QXX_CMD_RESET , XWDS_W25QXX_CMD_NUM
}
 W25QXX Flash 指令枚举 更多...
 
enum  w25q_mid_em {
  XWDS_W25Q80_MID = 0xEF13 , XWDS_W25Q16_MID = 0xEF14 , XWDS_W25Q32_MID = 0xEF15 , XWDS_W25Q64_MID = 0xEF16 ,
  XWDS_W25Q128_MID = 0xEF17 , XWDS_W25Q256_MID = 0xEF18
}
 W25QXX Flash MID 枚举 更多...
 
enum  xwds_w25qxx_sr_idx_em { XWDS_W25QXX_SR_1 , XWDS_W25QXX_SR_2 , XWDS_W25QXX_SR_3 , XWDS_W25QXX_SR_NUM }
 W25QXX Flash SR寄存器序号 更多...
 
enum  xwds_w25qxx_sr1_bit_em {
  XWDS_W25QXX_SR1_BUSY = 0x1U , XWDS_W25QXX_SR1_WEL = 0x2U , XWDS_W25QXX_SR1_BP0 = 0x4U , XWDS_W25QXX_SR1_BP1 = 0x8U ,
  XWDS_W25QXX_SR1_BP2 = 0x10U , XWDS_W25QXX_SR1_TB = 0x20U , XWDS_W25QXX_SR1_SEC = 0x40U , XWDS_W25QXX_SR1_SRP = 0x80U
}
 W25QXX Flash SR1 位枚举 更多...
 
enum  xwds_w25qxx_sr2_bit_em {
  XWDS_W25QXX_SR2_SRL = 0x1U , XWDS_W25QXX_SR2_QE = 0x2U , XWDS_W25QXX_SR2_R2 = 0x4U , XWDS_W25QXX_SR2_LB1 = 0x8U ,
  XWDS_W25QXX_SR2_LB2 = 0x10U , XWDS_W25QXX_SR2_LB3 = 0x20U , XWDS_W25QXX_SR2_CMP = 0x40U , XWDS_W25QXX_SR2_SUS = 0x80U
}
 W25QXX Flash SR2 位枚举 更多...
 
enum  xwds_w25qxx_sr3_bit_em {
  XWDS_W25QXX_SR3_R0 = 0x1U , XWDS_W25QXX_SR3_R1 = 0x2U , XWDS_W25QXX_SR3_WPS = 0x4U , XWDS_W25QXX_SR3_R3 = 0x8U ,
  XWDS_W25QXX_SR3_R4 = 0x10U , XWDS_W25QXX_SR3_DRV0 = 0x20U , XWDS_W25QXX_SR3_DRV1 = 0x40U , XWDS_W25QXX_SR3_HR = 0x80U
}
 W25QXX Flash SR3 位枚举 更多...
 

函数

void xwds_w25qxx_construct (struct xwds_w25qxx *w25qxx)
 
void xwds_w25qxx_destruct (struct xwds_w25qxx *w25qxx)
 
static xwer_t xwds_w25qxx_grab (struct xwds_w25qxx *w25qxx)
 W25QXX API:增加对象的引用计数
 
static xwer_t xwds_w25qxx_put (struct xwds_w25qxx *w25qxx)
 W25QXX API:减少对象的引用计数
 

详细描述

宏定义说明

◆ XWDS_W25QXX_CMD_MAX_PAYLOAD

#define XWDS_W25QXX_CMD_MAX_PAYLOAD   256U

在文件 device.h39 行定义.

枚举类型说明

◆ w25q_mid_em

W25QXX Flash MID 枚举

枚举值
XWDS_W25Q80_MID 
XWDS_W25Q16_MID 
XWDS_W25Q32_MID 
XWDS_W25Q64_MID 
XWDS_W25Q128_MID 
XWDS_W25Q256_MID 

在文件 device.h88 行定义.

88 {
89 XWDS_W25Q80_MID = 0xEF13,
90 XWDS_W25Q16_MID = 0xEF14,
91 XWDS_W25Q32_MID = 0xEF15,
92 XWDS_W25Q64_MID = 0xEF16,
93 XWDS_W25Q128_MID = 0xEF17,
94 XWDS_W25Q256_MID = 0xEF18,
95};
@ XWDS_W25Q128_MID
Definition device.h:93
@ XWDS_W25Q64_MID
Definition device.h:92
@ XWDS_W25Q80_MID
Definition device.h:89
@ XWDS_W25Q32_MID
Definition device.h:91
@ XWDS_W25Q256_MID
Definition device.h:94
@ XWDS_W25Q16_MID
Definition device.h:90

◆ xwds_w25qxx_cmd_em

W25QXX Flash 指令枚举

枚举值
XWDS_W25QXX_CMD_WRITE_DISABLE 
XWDS_W25QXX_CMD_WRITE_ENABLE 
XWDS_W25QXX_CMD_READ_STATUS_REG_1 
XWDS_W25QXX_CMD_READ_STATUS_REG_2 
XWDS_W25QXX_CMD_READ_STATUS_REG_3 
XWDS_W25QXX_CMD_WRITE_STATUS_REG_1 
XWDS_W25QXX_CMD_WRITE_STATUS_REG_2 
XWDS_W25QXX_CMD_WRITE_STATUS_REG_3 
XWDS_W25QXX_CMD_READ_DATA 
XWDS_W25QXX_CMD_FAST_READ_DATA 
XWDS_W25QXX_CMD_SET_READ_PARAMETERS 
XWDS_W25QXX_CMD_PAGE_PROGRAM 
XWDS_W25QXX_CMD_32KBLOCK_ERASE 
XWDS_W25QXX_CMD_64KBLOCK_ERASE 
XWDS_W25QXX_CMD_SECTOR_ERASE 
XWDS_W25QXX_CMD_CHIP_ERASE 
XWDS_W25QXX_CMD_POWER_DOWN 
XWDS_W25QXX_CMD_RELEASE_POWER_DOWN 
XWDS_W25QXX_CMD_UNIQUE_ID 
XWDS_W25QXX_CMD_MANUFACTURER_DEVICE_ID 
XWDS_W25QXX_CMD_JEDEC_DEVICE_ID 
XWDS_W25QXX_CMD_ENTER_4BYTE_ADDR_MODE 
XWDS_W25QXX_CMD_EXIT_4BYTE_ADDR_MODE 
XWDS_W25QXX_CMD_ENTER_QPI_MODE 
XWDS_W25QXX_CMD_EXIT_QPI_MODE 
XWDS_W25QXX_CMD_ENABLE_RESET 
XWDS_W25QXX_CMD_RESET 
XWDS_W25QXX_CMD_NUM 

在文件 device.h44 行定义.

44 {
47
54
58
60
65
68
72
75
78
81
83};
@ XWDS_W25QXX_CMD_64KBLOCK_ERASE
Definition device.h:62
@ XWDS_W25QXX_CMD_WRITE_STATUS_REG_1
Definition device.h:51
@ XWDS_W25QXX_CMD_READ_STATUS_REG_2
Definition device.h:49
@ XWDS_W25QXX_CMD_CHIP_ERASE
Definition device.h:64
@ XWDS_W25QXX_CMD_UNIQUE_ID
Definition device.h:69
@ XWDS_W25QXX_CMD_RESET
Definition device.h:80
@ XWDS_W25QXX_CMD_WRITE_STATUS_REG_3
Definition device.h:53
@ XWDS_W25QXX_CMD_ENABLE_RESET
Definition device.h:79
@ XWDS_W25QXX_CMD_EXIT_QPI_MODE
Definition device.h:77
@ XWDS_W25QXX_CMD_PAGE_PROGRAM
Definition device.h:59
@ XWDS_W25QXX_CMD_WRITE_DISABLE
Definition device.h:45
@ XWDS_W25QXX_CMD_MANUFACTURER_DEVICE_ID
Definition device.h:70
@ XWDS_W25QXX_CMD_EXIT_4BYTE_ADDR_MODE
Definition device.h:74
@ XWDS_W25QXX_CMD_READ_STATUS_REG_1
Definition device.h:48
@ XWDS_W25QXX_CMD_ENTER_QPI_MODE
Definition device.h:76
@ XWDS_W25QXX_CMD_POWER_DOWN
Definition device.h:66
@ XWDS_W25QXX_CMD_READ_DATA
Definition device.h:55
@ XWDS_W25QXX_CMD_READ_STATUS_REG_3
Definition device.h:50
@ XWDS_W25QXX_CMD_WRITE_STATUS_REG_2
Definition device.h:52
@ XWDS_W25QXX_CMD_NUM
Definition device.h:82
@ XWDS_W25QXX_CMD_32KBLOCK_ERASE
Definition device.h:61
@ XWDS_W25QXX_CMD_SET_READ_PARAMETERS
Definition device.h:57
@ XWDS_W25QXX_CMD_RELEASE_POWER_DOWN
Definition device.h:67
@ XWDS_W25QXX_CMD_SECTOR_ERASE
Definition device.h:63
@ XWDS_W25QXX_CMD_WRITE_ENABLE
Definition device.h:46
@ XWDS_W25QXX_CMD_ENTER_4BYTE_ADDR_MODE
Definition device.h:73
@ XWDS_W25QXX_CMD_JEDEC_DEVICE_ID
Definition device.h:71
@ XWDS_W25QXX_CMD_FAST_READ_DATA
Definition device.h:56

◆ xwds_w25qxx_sr1_bit_em

W25QXX Flash SR1 位枚举

枚举值
XWDS_W25QXX_SR1_BUSY 
XWDS_W25QXX_SR1_WEL 
XWDS_W25QXX_SR1_BP0 
XWDS_W25QXX_SR1_BP1 
XWDS_W25QXX_SR1_BP2 
XWDS_W25QXX_SR1_TB 
XWDS_W25QXX_SR1_SEC 
XWDS_W25QXX_SR1_SRP 

在文件 device.h110 行定义.

110 {
112 XWDS_W25QXX_SR1_WEL = 0x2U,
113 XWDS_W25QXX_SR1_BP0 = 0x4U,
114 XWDS_W25QXX_SR1_BP1 = 0x8U,
115 XWDS_W25QXX_SR1_BP2 = 0x10U,
116 XWDS_W25QXX_SR1_TB = 0x20U,
117 XWDS_W25QXX_SR1_SEC = 0x40U,
118 XWDS_W25QXX_SR1_SRP = 0x80U,
119};
@ XWDS_W25QXX_SR1_BP1
Definition device.h:114
@ XWDS_W25QXX_SR1_WEL
Definition device.h:112
@ XWDS_W25QXX_SR1_SEC
Definition device.h:117
@ XWDS_W25QXX_SR1_BUSY
Definition device.h:111
@ XWDS_W25QXX_SR1_BP2
Definition device.h:115
@ XWDS_W25QXX_SR1_SRP
Definition device.h:118
@ XWDS_W25QXX_SR1_BP0
Definition device.h:113
@ XWDS_W25QXX_SR1_TB
Definition device.h:116

◆ xwds_w25qxx_sr2_bit_em

W25QXX Flash SR2 位枚举

枚举值
XWDS_W25QXX_SR2_SRL 
XWDS_W25QXX_SR2_QE 
XWDS_W25QXX_SR2_R2 
XWDS_W25QXX_SR2_LB1 
XWDS_W25QXX_SR2_LB2 
XWDS_W25QXX_SR2_LB3 
XWDS_W25QXX_SR2_CMP 
XWDS_W25QXX_SR2_SUS 

在文件 device.h123 行定义.

123 {
124 XWDS_W25QXX_SR2_SRL = 0x1U,
125 XWDS_W25QXX_SR2_QE = 0x2U,
126 XWDS_W25QXX_SR2_R2 = 0x4U,
127 XWDS_W25QXX_SR2_LB1 = 0x8U,
128 XWDS_W25QXX_SR2_LB2 = 0x10U,
129 XWDS_W25QXX_SR2_LB3 = 0x20U,
130 XWDS_W25QXX_SR2_CMP = 0x40U,
131 XWDS_W25QXX_SR2_SUS = 0x80U,
132};
@ XWDS_W25QXX_SR2_QE
Definition device.h:125
@ XWDS_W25QXX_SR2_SRL
Definition device.h:124
@ XWDS_W25QXX_SR2_R2
Definition device.h:126
@ XWDS_W25QXX_SR2_LB3
Definition device.h:129
@ XWDS_W25QXX_SR2_LB1
Definition device.h:127
@ XWDS_W25QXX_SR2_CMP
Definition device.h:130
@ XWDS_W25QXX_SR2_LB2
Definition device.h:128
@ XWDS_W25QXX_SR2_SUS
Definition device.h:131

◆ xwds_w25qxx_sr3_bit_em

W25QXX Flash SR3 位枚举

枚举值
XWDS_W25QXX_SR3_R0 
XWDS_W25QXX_SR3_R1 
XWDS_W25QXX_SR3_WPS 
XWDS_W25QXX_SR3_R3 
XWDS_W25QXX_SR3_R4 
XWDS_W25QXX_SR3_DRV0 
XWDS_W25QXX_SR3_DRV1 
XWDS_W25QXX_SR3_HR 

在文件 device.h137 行定义.

137 {
138 XWDS_W25QXX_SR3_R0 = 0x1U,
139 XWDS_W25QXX_SR3_R1 = 0x2U,
140 XWDS_W25QXX_SR3_WPS = 0x4U,
141 XWDS_W25QXX_SR3_R3 = 0x8U,
142 XWDS_W25QXX_SR3_R4 = 0x10U,
143 XWDS_W25QXX_SR3_DRV0 = 0x20U,
144 XWDS_W25QXX_SR3_DRV1 = 0x40U,
145 XWDS_W25QXX_SR3_HR = 0x80U,
146};
@ XWDS_W25QXX_SR3_R1
Definition device.h:139
@ XWDS_W25QXX_SR3_DRV0
Definition device.h:143
@ XWDS_W25QXX_SR3_DRV1
Definition device.h:144
@ XWDS_W25QXX_SR3_R0
Definition device.h:138
@ XWDS_W25QXX_SR3_R4
Definition device.h:142
@ XWDS_W25QXX_SR3_HR
Definition device.h:145
@ XWDS_W25QXX_SR3_WPS
Definition device.h:140
@ XWDS_W25QXX_SR3_R3
Definition device.h:141

◆ xwds_w25qxx_sr_idx_em

W25QXX Flash SR寄存器序号

枚举值
XWDS_W25QXX_SR_1 
XWDS_W25QXX_SR_2 
XWDS_W25QXX_SR_3 
XWDS_W25QXX_SR_NUM 

在文件 device.h100 行定义.

100 {
105};
@ XWDS_W25QXX_SR_2
Definition device.h:102
@ XWDS_W25QXX_SR_3
Definition device.h:103
@ XWDS_W25QXX_SR_NUM
Definition device.h:104
@ XWDS_W25QXX_SR_1
Definition device.h:101

函数说明

◆ xwds_w25qxx_construct()

void xwds_w25qxx_construct ( struct xwds_w25qxx w25qxx)

在文件 device.c24 行定义.

25{
26 xwds_spip_construct(&w25qxx->spip);
27}
void xwds_spip_construct(struct xwds_spip *spip)
XWDS API:SPI外设控制器对象的构造函数
Definition peripheral.c:57
struct xwds_spip spip
Definition device.h:173
函数调用图:

◆ xwds_w25qxx_destruct()

void xwds_w25qxx_destruct ( struct xwds_w25qxx w25qxx)

在文件 device.c30 行定义.

31{
32 xwds_spip_destruct(&w25qxx->spip);
33}
void xwds_spip_destruct(struct xwds_spip *spip)
XWDS API:SPI外设控制器对象的析构函数
Definition peripheral.c:64
函数调用图:

◆ xwds_w25qxx_grab()

static xwer_t xwds_w25qxx_grab ( struct xwds_w25qxx w25qxx)
inlinestatic

W25QXX API:增加对象的引用计数

参数
[in]w25qxxW25QXX Flash 设备指针
返回
错误码
返回值

ref xwds_spip_grab()

在文件 device.h194 行定义.

195{
196 return xwds_spip_grab(&w25qxx->spip);
197}
xwer_t xwds_spip_grab(struct xwds_spip *spip)
XWDS API:增加对象的引用计数
Definition peripheral.c:70
函数调用图:
这是这个函数的调用关系图:

◆ xwds_w25qxx_put()

static xwer_t xwds_w25qxx_put ( struct xwds_w25qxx w25qxx)
inlinestatic

W25QXX API:减少对象的引用计数

参数
[in]w25qxxW25QXX Flash 设备指针
返回
错误码
返回值

ref xwds_spip_put()

在文件 device.h206 行定义.

207{
208 return xwds_spip_put(&w25qxx->spip);
209}
xwer_t xwds_spip_put(struct xwds_spip *spip)
XWDS API:减少对象的引用计数
Definition peripheral.c:76
函数调用图:
这是这个函数的调用关系图: