XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
chip.h
浏览该文件的文档.
1
21#ifndef __xwcd_ds_iochip_chip_h__
22#define __xwcd_ds_iochip_chip_h__
23
24#include <xwcd/ds/standard.h>
25#include <xwcd/ds/device.h>
28
35struct xwds_iochip;
36
41
45typedef void (* xwds_iochip_eirq_f)(struct xwds_iochip *,
46 xwid_t,
48
55 xwer_t (* gpio_req)(struct xwds_iochip * /*iochip*/,
56 xwid_t /*port*/,
57 xwsq_t /*pinmask*/,
58 xwtm_t /*to*/);
59 xwer_t (* gpio_rls)(struct xwds_iochip * /*iochip*/,
60 xwid_t /*port*/,
61 xwid_t /*pinmask*/,
62 xwtm_t /*to*/);
63 xwer_t (* gpio_cfg)(struct xwds_iochip * /*iochip*/,
64 xwid_t /*port*/,
65 xwsq_t /*pinmask*/,
66 void * /*cfg*/,
67 xwtm_t /*to*/);
69 xwid_t /*port*/,
70 xwsq_t /*pinmask*/,
71 xwsq_t /*out*/,
72 xwtm_t /*to*/);
73 xwer_t (* gpio_set)(struct xwds_iochip * /*iochip*/,
74 xwid_t /*port*/,
75 xwsq_t /*pinmask*/,
76 xwtm_t /*to*/);
77 xwer_t (* gpio_reset)(struct xwds_iochip * /*iochip*/,
78 xwid_t /*port*/,
79 xwsq_t /*pinmask*/,
80 xwtm_t /*to*/);
81 xwer_t (* gpio_toggle)(struct xwds_iochip * /*iochip*/,
82 xwid_t /*port*/,
83 xwsq_t /*pinmask*/,
84 xwtm_t /*to*/);
85 xwer_t (* gpio_input)(struct xwds_iochip * /*iochip*/,
86 xwid_t /*port*/,
87 xwsq_t /*pinmask*/,
88 xwsq_t * /*inbuf*/,
89 xwtm_t /*to*/);
90};
91
96 union {
98#if defined(XWCDCFG_ds_I2C_PERIPHERAL) && (1 == XWCDCFG_ds_I2C_PERIPHERAL)
99 struct xwds_i2cp i2cp;
100#endif
101#if defined(XWCDCFG_ds_SPI_PERIPHERAL) && (1 == XWCDCFG_ds_SPI_PERIPHERAL)
103#endif
104 } bc;
106 /* attributes */
107 struct {
108 void * cfg;
113};
114
119void xwds_iochip_construct(struct xwds_iochip * iochip);
120
125void xwds_iochip_destruct(struct xwds_iochip * iochip);
126
131xwer_t xwds_iochip_grab(struct xwds_iochip * iochip);
132
137xwer_t xwds_iochip_put(struct xwds_iochip * iochip);
138
143#endif /* xwcd/ds/iochip/chip.h */
玄武设备栈:设备基类
void(* xwds_iochip_eirq_f)(struct xwds_iochip *, xwid_t, xwds_iochip_eirq_arg_t)
外部中断函数
Definition chip.h:45
xwer_t xwds_iochip_grab(struct xwds_iochip *iochip)
XWDS API:增加对象的引用计数
Definition chip.c:71
xwer_t xwds_iochip_put(struct xwds_iochip *iochip)
XWDS API:减少对象的引用计数
Definition chip.c:77
void xwds_iochip_construct(struct xwds_iochip *iochip)
XWDS API:IOCHIP对象的构造函数
Definition chip.c:58
void * xwds_iochip_eirq_arg_t
外部中断函数参数
Definition chip.h:40
void xwds_iochip_destruct(struct xwds_iochip *iochip)
XWDS API:IOCHIP对象的析构函数
Definition chip.c:65
xws64_t xwtm_t
XWOS系统时间 (有符号)
Definition type.h:742
signed long xwer_t
Definition type.h:554
unsigned long xwid_t
Definition type.h:481
__xwcc_atomic xwsq_t atomic_xwsq_t
Definition type.h:448
unsigned long xwsz_t
Definition type.h:339
unsigned long xwsq_t
Definition type.h:445
玄武设备栈:I2C:外设
玄武设备栈:SPI:外设
设备(所有设备的基类)
Definition device.h:127
基本驱动函数表(所有设备驱动的基类)
Definition device.h:113
I2C外设
Definition peripheral.h:48
BSP中需要提供的IO扩展芯片设备驱动函数表
Definition chip.h:52
xwer_t(* gpio_req)(struct xwds_iochip *, xwid_t, xwsq_t, xwtm_t)
Definition chip.h:55
xwer_t(* gpio_cfg)(struct xwds_iochip *, xwid_t, xwsq_t, void *, xwtm_t)
Definition chip.h:63
xwer_t(* gpio_rls)(struct xwds_iochip *, xwid_t, xwid_t, xwtm_t)
Definition chip.h:59
struct xwds_driver base
Definition chip.h:53
xwer_t(* gpio_toggle)(struct xwds_iochip *, xwid_t, xwsq_t, xwtm_t)
Definition chip.h:81
xwer_t(* gpio_set)(struct xwds_iochip *, xwid_t, xwsq_t, xwtm_t)
Definition chip.h:73
xwer_t(* gpio_reset)(struct xwds_iochip *, xwid_t, xwsq_t, xwtm_t)
Definition chip.h:77
xwer_t(* gpio_input)(struct xwds_iochip *, xwid_t, xwsq_t, xwsq_t *, xwtm_t)
Definition chip.h:85
xwer_t(* gpio_output)(struct xwds_iochip *, xwid_t, xwsq_t, xwsq_t, xwtm_t)
Definition chip.h:68
IO扩展芯片
Definition chip.h:95
xwsz_t port_num
Definition chip.h:110
struct xwds_i2cp i2cp
Definition chip.h:99
xwsz_t pin_num
Definition chip.h:111
struct xwds_device dev
Definition chip.h:97
union xwds_iochip::@19 bc
struct xwds_spip spip
Definition chip.h:102
struct xwds_iochip::@20 gpio
void * cfg
Definition chip.h:108
atomic_xwsq_t * pins
Definition chip.h:109
SPI外设控制器
Definition peripheral.h:47
玄武设备栈:顶级头文件