49 rc = drv->
gpio_req(iochip, port, pinmask, to);
51 goto err_drv_gpio_req;
78 if (pinmask & (~pinsts)) {
84 rc = drv->
gpio_rls(iochip, port, pinmask, to);
86 goto err_drv_gpio_rls;
114 goto err_iochip_grab;
118 rc = drv->
gpio_cfg(iochip, port, pinmask, cfg, to);
123 goto err_drv_gpio_cfg;
149 goto err_iochip_grab;
152 if (pinmask & (~pinsts)) {
158 rc = drv->
gpio_set(iochip, port, pinmask, to);
190 goto err_iochip_grab;
193 if (pinmask & (~pinsts)) {
199 rc = drv->
gpio_reset(iochip, port, pinmask, to);
231 goto err_iochip_grab;
234 if (pinmask & (~pinsts)) {
272 goto err_iochip_grab;
275 if (pinmask & (~pinsts)) {
281 rc = drv->
gpio_output(iochip, port, pinmask, out, to);
313 goto err_iochip_grab;
316 if (pinmask & (~pinsts)) {
322 rc = drv->
gpio_input(iochip, port, pinmask, inbuf, to);
xwer_t xwds_iochip_grab(struct xwds_iochip *iochip)
XWDS API:增加对象的引用计数
xwer_t xwds_iochip_put(struct xwds_iochip *iochip)
XWDS API:减少对象的引用计数
#define XWDS_IOCHIP_GPIO_PIN_MASK(n)
#define xwds_cast(type, dev)
#define XWDS_VALIDATE(exp, errstr,...)
#define EFAULT
Bad address
#define ENOSYS
Function not implemented
#define EBUSY
Device or resource busy
#define ERANGE
Result too large
#define EPERM
Operation not permitted
xws64_t xwtm_t
XWOS系统时间 (有符号)
#define xwaop_c0m(type, a, m, nv, ov)
对原子变量进行原子操作:读取-位清0操作-回写
#define xwaop_load(type, a, memorder)
对原子变量进行原子操作:加载
#define xwaop_t0ma_then_s1m(type, a, m, nv, ov)
对原子变量进行原子操作:读取-位测试-位置1操作-回写
xwer_t xwds_iochip_gpio_input(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmask, xwsq_t *inbuf, xwtm_t to)
XWDS API:并行读取多个IO扩展芯片的GPIO
xwer_t xwds_iochip_gpio_set(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmask, xwtm_t to)
XWDS API:将IO扩展芯片的GPIO设置为高电平
xwer_t xwds_iochip_gpio_cfg(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmask, void *cfg, xwtm_t to)
XWDS API:配置IO扩展芯片的GPIO
xwer_t xwds_iochip_gpio_toggle(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmask, xwtm_t to)
XWDS API:翻转IO扩展芯片的GPIO电平
xwer_t xwds_iochip_gpio_req(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmask, xwtm_t to)
XWDS API:申请IO扩展芯片的GPIO
xwer_t xwds_iochip_gpio_reset(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmask, xwtm_t to)
XWDS API:将IO扩展芯片的GPIO设置为低电平
xwer_t xwds_iochip_gpio_rls(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmask, xwtm_t to)
XWDS API:释放IO扩展芯片的GPIO
xwer_t xwds_iochip_gpio_output(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmask, xwsq_t out, xwtm_t to)
XWDS API:并行输出多个IO扩展芯片的GPIO
const struct xwds_driver * drv
xwer_t(* gpio_req)(struct xwds_iochip *, xwid_t, xwsq_t, xwtm_t)
xwer_t(* gpio_cfg)(struct xwds_iochip *, xwid_t, xwsq_t, void *, xwtm_t)
xwer_t(* gpio_rls)(struct xwds_iochip *, xwid_t, xwid_t, xwtm_t)
xwer_t(* gpio_toggle)(struct xwds_iochip *, xwid_t, xwsq_t, xwtm_t)
xwer_t(* gpio_set)(struct xwds_iochip *, xwid_t, xwsq_t, xwtm_t)
xwer_t(* gpio_reset)(struct xwds_iochip *, xwid_t, xwsq_t, xwtm_t)
xwer_t(* gpio_input)(struct xwds_iochip *, xwid_t, xwsq_t, xwsq_t *, xwtm_t)
xwer_t(* gpio_output)(struct xwds_iochip *, xwid_t, xwsq_t, xwsq_t, xwtm_t)
union xwds_iochip::@19 bc
struct xwds_iochip::@20 gpio