XWOS API
4.0
XWOS C/C++ API参考手册
|
结构体 | |
struct | xwds_iochip_driver |
BSP中需要提供的IO扩展芯片设备驱动函数表 更多... | |
struct | xwds_iochip |
IO扩展芯片 更多... | |
类型定义 | |
typedef void * | xwds_iochip_eirq_arg_t |
外部中断函数参数 | |
typedef void(* | xwds_iochip_eirq_f) (struct xwds_iochip *, xwid_t, xwds_iochip_eirq_arg_t) |
外部中断函数 | |
函数 | |
void | xwds_iochip_construct (struct xwds_iochip *iochip) |
XWDS API:IOCHIP对象的构造函数 | |
void | xwds_iochip_destruct (struct xwds_iochip *iochip) |
XWDS API:IOCHIP对象的析构函数 | |
xwer_t | xwds_iochip_grab (struct xwds_iochip *iochip) |
XWDS API:增加对象的引用计数 | |
xwer_t | xwds_iochip_put (struct xwds_iochip *iochip) |
XWDS API:减少对象的引用计数 | |
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_rls (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_set (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_toggle (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 | |
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 | |
#define | XWDS_IOCHIP_GPIO_PORT(p) (p) |
#define | XWDS_IOCHIP_GPIO_PIN(n) (1U << ((xwu32_t)(n))) |
#define | XWDS_IOCHIP_GPIO_PIN_MASK(n) (XWDS_IOCHIP_GPIO_PIN(n) - 1U) |
enum | xwds_iochip_gpio_pin_em { XWDS_IOCHIP_GPIO_PIN_0 = (1U << ((xwu32_t)( 0 ))) , XWDS_IOCHIP_GPIO_PIN_1 = (1U << ((xwu32_t)( 1 ))) , XWDS_IOCHIP_GPIO_PIN_2 = (1U << ((xwu32_t)( 2 ))) , XWDS_IOCHIP_GPIO_PIN_3 = (1U << ((xwu32_t)( 3 ))) , XWDS_IOCHIP_GPIO_PIN_4 = (1U << ((xwu32_t)( 4 ))) , XWDS_IOCHIP_GPIO_PIN_5 = (1U << ((xwu32_t)( 5 ))) , XWDS_IOCHIP_GPIO_PIN_6 = (1U << ((xwu32_t)( 6 ))) , XWDS_IOCHIP_GPIO_PIN_7 = (1U << ((xwu32_t)( 7 ))) , XWDS_IOCHIP_GPIO_PIN_8 = (1U << ((xwu32_t)( 8 ))) , XWDS_IOCHIP_GPIO_PIN_9 = (1U << ((xwu32_t)( 9 ))) , XWDS_IOCHIP_GPIO_PIN_10 = (1U << ((xwu32_t)( 10 ))) , XWDS_IOCHIP_GPIO_PIN_11 = (1U << ((xwu32_t)( 11 ))) , XWDS_IOCHIP_GPIO_PIN_12 = (1U << ((xwu32_t)( 12 ))) , XWDS_IOCHIP_GPIO_PIN_13 = (1U << ((xwu32_t)( 13 ))) , XWDS_IOCHIP_GPIO_PIN_14 = (1U << ((xwu32_t)( 14 ))) , XWDS_IOCHIP_GPIO_PIN_15 = (1U << ((xwu32_t)( 15 ))) , XWDS_IOCHIP_GPIO_PIN_16 = (1U << ((xwu32_t)( 16 ))) , XWDS_IOCHIP_GPIO_PIN_17 = (1U << ((xwu32_t)( 17 ))) , XWDS_IOCHIP_GPIO_PIN_18 = (1U << ((xwu32_t)( 18 ))) , XWDS_IOCHIP_GPIO_PIN_19 = (1U << ((xwu32_t)( 19 ))) , XWDS_IOCHIP_GPIO_PIN_20 = (1U << ((xwu32_t)( 20 ))) , XWDS_IOCHIP_GPIO_PIN_21 = (1U << ((xwu32_t)( 21 ))) , XWDS_IOCHIP_GPIO_PIN_22 = (1U << ((xwu32_t)( 22 ))) , XWDS_IOCHIP_GPIO_PIN_23 = (1U << ((xwu32_t)( 23 ))) , XWDS_IOCHIP_GPIO_PIN_24 = (1U << ((xwu32_t)( 24 ))) , XWDS_IOCHIP_GPIO_PIN_25 = (1U << ((xwu32_t)( 25 ))) , XWDS_IOCHIP_GPIO_PIN_26 = (1U << ((xwu32_t)( 26 ))) , XWDS_IOCHIP_GPIO_PIN_27 = (1U << ((xwu32_t)( 27 ))) , XWDS_IOCHIP_GPIO_PIN_28 = (1U << ((xwu32_t)( 28 ))) , XWDS_IOCHIP_GPIO_PIN_29 = (1U << ((xwu32_t)( 29 ))) , XWDS_IOCHIP_GPIO_PIN_30 = (1U << ((xwu32_t)( 30 ))) , XWDS_IOCHIP_GPIO_PIN_31 = (1U << ((xwu32_t)( 31 ))) } |
XWDS IOCHIP GPIO PIN 枚举 更多... | |
#define XWDS_IOCHIP_GPIO_PIN_MASK | ( | n | ) | (XWDS_IOCHIP_GPIO_PIN(n) - 1U) |
typedef void* xwds_iochip_eirq_arg_t |
typedef void(* xwds_iochip_eirq_f) (struct xwds_iochip *, xwid_t, xwds_iochip_eirq_arg_t) |
XWDS IOCHIP GPIO PIN 枚举
void xwds_iochip_construct | ( | struct xwds_iochip * | iochip | ) |
XWDS API:IOCHIP对象的构造函数
[in] | iochip | IOCHIP对象指针 |
void xwds_iochip_destruct | ( | struct xwds_iochip * | iochip | ) |
XWDS API:IOCHIP对象的析构函数
[in] | iochip | IOCHIP对象指针 |
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
[in] | iochip | IOCHIP对象指针 |
[in] | port | GPIO端口 |
[in] | pinmask | 引脚的掩码,取值 xwds_iochip_gpio_pin_em 中的任意项的或运算 |
[in] | cfg | GPIO配置,取值依据不同IOCHIP |
[in] | to | 期望唤醒的时间点 |
XWOK | 没有错误 |
-EFAULT | 无效指针 |
-ERANGE | GPIO PORT错误 |
-ENOSYS | 不支持的API |
<No error
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
[in] | iochip | IOCHIP对象指针 |
[in] | port | GPIO端口 |
[in] | pinmask | 引脚的掩码,取值 xwds_iochip_gpio_pin_em 中的任意项的或运算 |
[out] | inbuf | 输入缓冲区 |
[in] | to | 期望唤醒的时间点 |
XWOK | 没有错误 |
-EFAULT | 无效指针 |
-ERANGE | GPIO PORT错误 |
-EPERM | GPIO PIN未被申请 |
-ENOSYS | 不支持的API |
<No error
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
[in] | iochip | IOCHIP对象指针 |
[in] | port | GPIO端口 |
[in] | pinmask | 引脚的掩码,取值 xwds_iochip_gpio_pin_em 中的任意项的或运算 |
[in] | out | 输出值,取值 xwds_iochip_gpio_pin_em 中的任意项的或运算, 只有被pinmask掩码覆盖的部分有效,未覆盖的pin输出不会发生改变。 |
[in] | to | 期望唤醒的时间点 |
XWOK | 没有错误 |
-EFAULT | 无效指针 |
-ERANGE | GPIO PORT错误 |
-EPERM | GPIO PIN未被申请 |
-ENOSYS | 不支持的API |
<No error
xwer_t xwds_iochip_gpio_req | ( | struct xwds_iochip * | iochip, |
xwid_t | port, | ||
xwsq_t | pinmask, | ||
xwtm_t | to | ||
) |
XWDS API:申请IO扩展芯片的GPIO
[in] | iochip | IOCHIP对象指针 |
[in] | port | GPIO端口 |
[in] | pinmask | 引脚的掩码,取值 xwds_iochip_gpio_pin_em 中的任意项的或运算 |
[in] | to | 期望唤醒的时间点 |
XWOK | 没有错误 |
-EFAULT | 无效指针 |
-ERANGE | GPIO PORT错误 |
-EBUSY | GPIO PIN已被使用 |
<No error
xwer_t xwds_iochip_gpio_reset | ( | struct xwds_iochip * | iochip, |
xwid_t | port, | ||
xwsq_t | pinmask, | ||
xwtm_t | to | ||
) |
XWDS API:将IO扩展芯片的GPIO设置为低电平
[in] | iochip | IOCHIP对象指针 |
[in] | port | GPIO端口 |
[in] | pinmask | 引脚的掩码,取值 xwds_iochip_gpio_pin_em 中的任意项的或运算 |
[in] | to | 期望唤醒的时间点 |
XWOK | 没有错误 |
-EFAULT | 无效指针 |
-ERANGE | GPIO PORT错误 |
-EPERM | GPIO PIN未被申请 |
-ENOSYS | 不支持的API |
<No error
xwer_t xwds_iochip_gpio_rls | ( | struct xwds_iochip * | iochip, |
xwid_t | port, | ||
xwsq_t | pinmask, | ||
xwtm_t | to | ||
) |
XWDS API:释放IO扩展芯片的GPIO
[in] | iochip | IOCHIP对象指针 |
[in] | port | GPIO端口 |
[in] | pinmask | 引脚的掩码,取值 xwds_iochip_gpio_pin_em 中的任意项的或运算 |
[in] | to | 期望唤醒的时间点 |
XWOK | 没有错误 |
-EFAULT | 无效指针 |
-ERANGE | GPIO PORT错误 |
-EPERM | GPIO PIN未被申请 |
<No error
xwer_t xwds_iochip_gpio_set | ( | struct xwds_iochip * | iochip, |
xwid_t | port, | ||
xwsq_t | pinmask, | ||
xwtm_t | to | ||
) |
XWDS API:将IO扩展芯片的GPIO设置为高电平
[in] | iochip | IOCHIP对象指针 |
[in] | port | GPIO端口 |
[in] | pinmask | 引脚的掩码,取值 xwds_iochip_gpio_pin_em 中的任意项的或运算 |
[in] | to | 期望唤醒的时间点 |
XWOK | 没有错误 |
-EFAULT | 无效指针 |
-ERANGE | GPIO PORT错误 |
-EPERM | GPIO PIN未被申请 |
-ENOSYS | 不支持的API |
<No error
xwer_t xwds_iochip_gpio_toggle | ( | struct xwds_iochip * | iochip, |
xwid_t | port, | ||
xwsq_t | pinmask, | ||
xwtm_t | to | ||
) |
XWDS API:翻转IO扩展芯片的GPIO电平
[in] | iochip | IOCHIP对象指针 |
[in] | port | GPIO端口 |
[in] | pinmask | 引脚的掩码,取值 xwds_iochip_gpio_pin_em 中的任意项的或运算 |
[in] | to | 期望唤醒的时间点 |
XWOK | 没有错误 |
-EFAULT | 无效指针 |
-ERANGE | GPIO PORT错误 |
-EPERM | GPIO PIN未被申请 |
-ENOSYS | 不支持的API |
<No error
xwer_t xwds_iochip_grab | ( | struct xwds_iochip * | iochip | ) |
XWDS API:增加对象的引用计数
[in] | iochip | IOCHIP对象指针 |
xwer_t xwds_iochip_put | ( | struct xwds_iochip * | iochip | ) |
XWDS API:减少对象的引用计数
[in] | iochip | IOCHIP对象指针 |