XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
device.h
浏览该文件的文档.
1
21#ifndef __xwcd_peripheral_i2c_iochip_tca9539_device_h__
22#define __xwcd_peripheral_i2c_iochip_tca9539_device_h__
23
24#include <xwos/standard.h>
26#include <xwcd/ds/iochip/chip.h>
27
34#define XWDS_TCA9539_REG_P0_INPUT ((xwu8_t)0)
35#define XWDS_TCA9539_REG_P1_INPUT ((xwu8_t)1)
36#define XWDS_TCA9539_REG_P0_OUTPUT ((xwu8_t)2)
37#define XWDS_TCA9539_REG_P1_OUTPUT ((xwu8_t)3)
38#define XWDS_TCA9539_REG_P0_POLINV ((xwu8_t)4)
39#define XWDS_TCA9539_REG_P1_POLINV ((xwu8_t)5)
40#define XWDS_TCA9539_REG_P0_CFG ((xwu8_t)6)
41#define XWDS_TCA9539_REG_P1_CFG ((xwu8_t)7)
42
49};
50
57 struct {
58 union {
59 struct {
68 } bit;
71 union {
72 struct {
73 xwu8_t p0:1;
74 xwu8_t p1:1;
75 xwu8_t p2:1;
76 xwu8_t p3:1;
77 xwu8_t p4:1;
78 xwu8_t p5:1;
79 xwu8_t p6:1;
80 xwu8_t p7:1;
81 } bit;
82 xwu8_t u8;
83 } out;
84 } p0;
85 struct {
86 union {
87 struct {
88 xwu8_t p0:1;
89 xwu8_t p1:1;
90 xwu8_t p2:1;
91 xwu8_t p3:1;
92 xwu8_t p4:1;
93 xwu8_t p5:1;
94 xwu8_t p6:1;
95 xwu8_t p7:1;
96 } bit;
97 xwu8_t u8;
99 union {
100 struct {
101 xwu8_t p0:1;
102 xwu8_t p1:1;
103 xwu8_t p2:1;
104 xwu8_t p3:1;
105 xwu8_t p4:1;
106 xwu8_t p5:1;
107 xwu8_t p6:1;
108 xwu8_t p7:1;
110 xwu8_t u8;
111 } out;
112 } p1;
113};
114
122};
123
129 struct {
130 const struct xwds_resource_gpio * rst;
131 const struct xwds_resource_gpio * irq;
134};
135
140void xwds_tca9539_construct(struct xwds_tca9539 * tca9539);
141
146void xwds_tca9539_destruct(struct xwds_tca9539 * tca9539);
147
154static __xwds_inline
156{
157 return xwds_i2cp_grab(&tca9539->iochip.bc.i2cp);
158}
159
166static __xwds_inline
168{
169 return xwds_i2cp_put(&tca9539->iochip.bc.i2cp);
170}
171
176#endif /* xwcd/peripheral/i2c/iochip/tca9539/device.h */
xwer_t xwds_i2cp_put(struct xwds_i2cp *i2cp)
XWDS API:减少对象的引用计数
Definition peripheral.c:76
xwer_t xwds_i2cp_grab(struct xwds_i2cp *i2cp)
XWDS API:增加对象的引用计数
Definition peripheral.c:70
#define __xwds_inline
Definition standard.h:34
void xwds_tca9539_construct(struct xwds_tca9539 *tca9539)
TCA9539 API:TCA9539对象的构造函数
Definition device.c:26
void xwds_tca9539_destruct(struct xwds_tca9539 *tca9539)
TCA9539 API:TCA9539对象的析构函数
Definition device.c:32
xwds_tca9539_pin_direction_em
TCA9539 Pin方向枚举
Definition device.h:46
static xwer_t xwds_tca9539_put(struct xwds_tca9539 *tca9539)
TCA9539 API:减少对象的引用计数
Definition device.h:167
static xwer_t xwds_tca9539_grab(struct xwds_tca9539 *tca9539)
TCA9539 API:增加对象的引用计数
Definition device.h:155
@ XWDS_TCA9539_PIN_DIRECTION_OUT
Definition device.h:47
@ XWDS_TCA9539_PIN_DIRECTION_IN
Definition device.h:48
signed long xwer_t
Definition type.h:554
unsigned long xwid_t
Definition type.h:481
uint8_t xwu8_t
Definition type.h:194
玄武设备栈:I2C:外设
玄武设备栈:IO扩展芯片
IO扩展芯片
Definition chip.h:95
struct xwds_i2cp i2cp
Definition chip.h:99
union xwds_iochip::@19 bc
设备栈GPIO资源
Definition standard.h:98
TCA9539配置
Definition device.h:56
union xwds_tca9539_cfg::@29::@32 out
struct xwds_tca9539_cfg::@29::@31::@33 bit
union xwds_tca9539_cfg::@29::@31 direction
TCA9539 PIN配置
Definition device.h:120
TCA9539对象
Definition device.h:127
const struct xwds_resource_gpio * irq
Definition device.h:131
const struct xwds_resource_gpio * rst
Definition device.h:130
xwid_t eirq
Definition device.h:133
struct xwds_iochip iochip
Definition device.h:128
struct xwds_tca9539::@39 gpiorsc
XWOS的标准头文件