XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
driver.h
浏览该文件的文档.
1
23#ifndef __xwcd_peripheral_i2c_eeprom_driver_h__
24#define __xwcd_peripheral_i2c_eeprom_driver_h__
25
26#include <xwos/standard.h>
29
40 xwer_t (* putc)(struct xwds_eeprom * /*eeprom*/,
41 xwu8_t /*data*/, xwptr_t /*addr*/,
42 xwtm_t /*to*/);
43 xwer_t (* getc)(struct xwds_eeprom * /*eeprom*/,
44 xwu8_t * /*buf*/, xwptr_t /*addr*/,
45 xwtm_t /*to*/);
46 xwer_t (* pgwrite)(struct xwds_eeprom * /*eeprom*/,
47 xwu8_t * /*data*/, xwsz_t * /*size*/, xwsq_t /*pgidx*/,
48 xwtm_t /*to*/);
49 xwer_t (* pgread)(struct xwds_eeprom * /*eeprom*/,
50 xwu8_t * /*buf*/, xwsz_t * /*size*/, xwsq_t /*pgidx*/,
51 xwtm_t /*to*/);
52};
53
54extern const struct xwds_eeprom_driver at24sd_drv;
55extern const struct xwds_eeprom_driver at24md_drv;
56
57/******** ******** base driver ******** ********/
62
67#if defined(XWCDCFG_ds_PM) && (1 == XWCDCFG_ds_PM)
72
77#endif
78
79/******** ******** I2C EEPROM APIs ******** ********/
88
97
106
115
136xwer_t xwds_eeprom_putc(struct xwds_eeprom * eeprom,
137 xwu8_t data, xwsq_t addr,
138 xwtm_t to);
139
160xwer_t xwds_eeprom_getc(struct xwds_eeprom * eeprom,
161 xwu8_t * buf, xwsq_t addr,
162 xwtm_t to);
163
188 xwu8_t * data, xwsz_t * size, xwsq_t pgidx,
189 xwtm_t to);
190
215 xwu8_t * buf, xwsz_t * size, xwsq_t pgidx,
216 xwtm_t to);
217
236xwer_t xwds_eeprom_reset(struct xwds_eeprom * eeprom, xwtm_t to);
237
242#endif /* xwcd/peripheral/i2c/eeprom/driver.h */
xws64_t xwtm_t
XWOS系统时间 (有符号)
Definition type.h:742
signed long xwer_t
Definition type.h:554
unsigned long xwsz_t
Definition type.h:339
uint8_t xwu8_t
Definition type.h:194
unsigned long xwsq_t
Definition type.h:445
unsigned long xwptr_t
Definition type.h:375
xwer_t xwds_eeprom_drv_start(struct xwds_device *dev)
EEPROM基本驱动:启动设备
Definition driver.c:48
xwer_t xwds_eeprom_putc(struct xwds_eeprom *eeprom, xwu8_t data, xwsq_t addr, xwtm_t to)
EEPROM API:写一个字节到EEPROM
Definition driver.c:186
xwer_t xwds_eeprom_drv_suspend(struct xwds_device *dev)
EEPROM基本驱动:继续设备
Definition driver.c:108
xwer_t xwds_eeprom_pgwrite(struct xwds_eeprom *eeprom, xwu8_t *data, xwsz_t *size, xwsq_t pgidx, xwtm_t to)
EEPROM API:写一页数据到EEPROM
Definition driver.c:220
xwer_t xwds_eeprom_getc(struct xwds_eeprom *eeprom, xwu8_t *buf, xwsq_t addr, xwtm_t to)
EEPROM API:从EEPROM中读取一个字节
Definition driver.c:203
xwer_t xwds_eeprom_pgread(struct xwds_eeprom *eeprom, xwu8_t *buf, xwsz_t *size, xwsq_t pgidx, xwtm_t to)
EEPROM API:从EEPROM读一页数据
Definition driver.c:237
xwer_t xwds_eeprom_wp_enable(struct xwds_eeprom *eeprom)
EEPROM API:开启EEPROM的写保护
Definition driver.c:154
xwer_t xwds_eeprom_reset(struct xwds_eeprom *eeprom, xwtm_t to)
EEPROM API:复位EEPROM的I2C总线
Definition driver.c:254
xwer_t xwds_eeprom_drv_stop(struct xwds_device *dev)
EEPROM基本驱动:停止设备
Definition driver.c:87
const struct xwds_eeprom_driver at24md_drv
Definition at24md.c:46
xwer_t xwds_eeprom_wp_disable(struct xwds_eeprom *eeprom)
EEPROM API:关闭EEPROM的写保护
Definition driver.c:170
const struct xwds_eeprom_driver at24sd_drv
Definition at24sd.c:46
xwer_t xwds_eeprom_power_off(struct xwds_eeprom *eeprom)
EEPROM API:关闭EEPROM的电源
Definition driver.c:138
xwer_t xwds_eeprom_power_on(struct xwds_eeprom *eeprom)
EEPROM API:开启EEPROM的电源
Definition driver.c:122
xwer_t xwds_eeprom_drv_resume(struct xwds_device *dev)
EEPROM基本驱动:暂停设备
Definition driver.c:114
玄武设备栈:I2C:外设
I2C EEPROM 设备
设备(所有设备的基类)
Definition device.h:127
EEPROM驱动函数表
Definition driver.h:38
xwer_t(* pgread)(struct xwds_eeprom *, xwu8_t *, xwsz_t *, xwsq_t, xwtm_t)
Definition driver.h:49
struct xwds_i2cp_driver i2cp
Definition driver.h:39
xwer_t(* getc)(struct xwds_eeprom *, xwu8_t *, xwptr_t, xwtm_t)
Definition driver.h:43
xwer_t(* pgwrite)(struct xwds_eeprom *, xwu8_t *, xwsz_t *, xwsq_t, xwtm_t)
Definition driver.h:46
xwer_t(* putc)(struct xwds_eeprom *, xwu8_t, xwptr_t, xwtm_t)
Definition driver.h:40
BSP中需要提供的I2C外设驱动函数表
Definition peripheral.h:41
XWOS的标准头文件