29#define LOGTAG "TCA9539"
49 msg.
size =
sizeof(txdata);
91 if (
NULL != gpiorsc) {
94 goto err_gpio_req_rst;
99 if (
NULL != gpiorsc) {
102 goto err_gpio_req_irq;
109 if (
NULL != gpiorsc) {
124 if (
NULL != gpiorsc) {
128 if (
NULL != gpiorsc) {
134#if defined(XWCDCFG_ds_PM) && (1 == XWCDCFG_ds_PM)
186 regmsk = (
xwu8_t)pinmsk & 0xFFU;
190 cfgval = regmsk ^ regmsk;
197 newval = oldval & (~regmsk);
208 newval = oldval & (~regmsk);
233 regmsk = (
xwu8_t)pinmsk & 0xFFU;
240 newval = oldval & (~regmsk);
253 newval = oldval & (~regmsk);
279 regmsk = (
xwu8_t)pinmsk & 0xFFU;
286 newval = oldval & (~regmsk);
298 newval = oldval & (~regmsk);
323 regmsk = (
xwu8_t)pinmsk & 0xFFU;
330 newval = oldval & (~regmsk);
343 newval = oldval & (~regmsk);
369 regmsk = (
xwu8_t)pinmsk & 0xFFU;
376 newval = oldval & (~regmsk);
377 newval |= (regmsk & (
xwu8_t)out);
389 newval = oldval & (~regmsk);
390 newval |= (regmsk & (
xwu8_t)out);
414 regmsk = (
xwu8_t)pinmsk & 0xFFU;
421 *in = regval & regmsk;
428 *in = regval & regmsk;
439 .
name =
"xwds.tca9539",
444#if defined(XWCDCFG_ds_PM) && (1 == XWCDCFG_ds_PM)
508 if (
NULL != gpiorsc) {
530 if (
NULL != gpiorsc) {
583 "[ID:%d] 0x%X, 0x%X, 0x%X, 0x%X, 0x%X, 0x%X, 0x%X, 0x%X\r\n",
585 val[0], val[1], val[2], val[3],
586 val[4], val[5], val[6], val[7]);
xwer_t xwds_eirq_req(struct xwds_soc *soc, xwid_t port, xwsq_t pinmask, xwid_t eiid, xwsq_t eiflag, xwds_eirq_f isr, xwds_eirq_arg_t arg)
XWDS API:申请外部中断
xwer_t xwds_eirq_rls(struct xwds_soc *soc, xwid_t port, xwsq_t pinmask, xwid_t eiid)
XWDS API:释放外部中断
@ XWDS_SOC_EIF_TM_FALLING
xwer_t xwds_i2cm_xfer(struct xwds_i2cm *i2cm, struct xwds_i2c_msg *msg, xwtm_t to)
XWDS API:传输I2C消息
void(* xwds_eirq_f)(struct xwds_soc *, xwid_t, xwds_eirq_arg_t)
外部中断函数
#define xwds_cast(type, dev)
#define XWDS_TCA9539_REG_P0_POLINV
xwer_t xwds_tca9539_drv_start(struct xwds_device *dev)
TCA9539基本驱动:启动设备
#define XWDS_TCA9539_REG_P1_INPUT
#define XWDS_TCA9539_REG_P0_OUTPUT
#define XWDS_TCA9539_REG_P1_OUTPUT
#define XWDS_TCA9539_REG_P1_CFG
#define XWDS_TCA9539_REG_P1_POLINV
#define XWDS_TCA9539_REG_P0_CFG
#define XWDS_TCA9539_REG_P0_INPUT
@ XWDS_TCA9539_PIN_DIRECTION_IN
xws64_t xwtm_t
XWOS系统时间 (有符号)
#define xwlogf(lv, tag, fmt,...)
格式化日志,并输出
xwer_t xwds_tca9539_drv_gpio_input(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmsk, xwsq_t *in, xwtm_t to)
TCA9539 GPIO驱动:并行读取多个IO扩展芯片的GPIO
xwer_t xwds_tca9539_drv_gpio_req(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmask, xwtm_t to)
TCA9539 GPIO驱动:申请IO扩展芯片的GPIO
xwer_t xwds_tca9539_drv_gpio_reset(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmsk, xwtm_t to)
TCA9539 GPIO驱动:将IO扩展芯片的GPIO设置为低电平
void xwds_tca9539_dump(struct xwds_tca9539 *tca9539, xwtm_t to)
TCA9539 API:输出TCA9539的寄存器信息
xwer_t xwds_tca9539_drv_stop(struct xwds_device *dev)
TCA9539基本驱动:停止设备
xwer_t xwds_tca9539_drv_suspend(struct xwds_device *dev)
TCA9539基本驱动:暂停设备
void xwds_tca9539_reset(struct xwds_tca9539 *tca9539, bool active)
TCA9539 API:复位TCA9539
xwer_t xwds_tca9539_drv_gpio_output(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmsk, xwsq_t out, xwtm_t to)
TCA9539 GPIO驱动:并行输出多个IO扩展芯片的GPIO
xwer_t xwds_tca9539_drv_gpio_cfg(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmsk, void *cfg, xwtm_t to)
TCA9539 GPIO驱动:配置IO扩展芯片的GPIO
static xwer_t xwds_tca9539_write(struct xwds_tca9539 *tca9539, xwu8_t reg, xwu8_t data, xwtm_t to)
xwer_t xwds_tca9539_drv_resume(struct xwds_device *dev)
TCA9539基本驱动:继续设备
xwer_t xwds_tca9539_run(struct xwds_tca9539 *tca9539, xwds_eirq_f eisr, xwtm_t to)
TCA9539 API:启动TCA9539
xwer_t xwds_tca9539_drv_gpio_toggle(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmsk, xwtm_t to)
TCA9539 GPIO驱动:翻转IO扩展芯片的GPIO电平
void xwds_tca9539_quit(struct xwds_tca9539 *tca9539)
TCA9539 API:停止运行TCA9539
const struct xwds_iochip_driver xwds_tca9539_drv
TCA9539的驱动
xwer_t xwds_tca9539_drv_gpio_set(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmsk, xwtm_t to)
TCA9539 GPIO驱动:将IO扩展芯片的GPIO设置为高电平
xwer_t xwds_tca9539_drv_gpio_rls(struct xwds_iochip *iochip, xwid_t port, xwsq_t pinmask, xwtm_t to)
TCA9539 GPIO驱动:释放IO扩展芯片的GPIO
static xwer_t xwds_tca9539_read(struct xwds_tca9539 *tca9539, xwu8_t reg, xwu8_t *buf, xwtm_t to)
玄武设备栈:I2C IO扩展芯片:TCA9539:驱动
xwer_t xwds_gpio_reset(struct xwds_soc *soc, xwid_t port, xwsq_t pinmask)
XWDS API:将SOC的GPIO设置为低电平
xwer_t xwds_gpio_rls(struct xwds_soc *soc, xwid_t port, xwsq_t pinmask)
XWDS API:释放SOC的GPIO
xwer_t xwds_gpio_set(struct xwds_soc *soc, xwid_t port, xwsq_t pinmask)
XWDS API:将SOC的GPIO设置为高电平
xwer_t xwds_gpio_req(struct xwds_soc *soc, xwid_t port, xwsq_t pinmask)
XWDS API:申请SOC的GPIO
union xwds_iochip::@19 bc
struct xwds_iochip::@20 gpio
const struct xwds_resource_gpio * irq
const struct xwds_resource_gpio * rst
struct xwds_iochip iochip
struct xwds_tca9539::@39 gpiorsc