|
XWOS API
4.0
XWOS C/C++ API参考手册
|

结构体 | |
| struct | xwds_soc_driver |
| BSP中需要提供的SOC设备驱动函数表 更多... | |
| struct | xwds_soc |
| SOC设备 更多... | |
宏定义 | |
| #define | __xwds_soc_eirq_tbl_qualifier |
| #define | __xwds_soc_dma_tbl_qualifier |
类型定义 | |
| typedef void * | xwds_eirq_arg_t |
| 外部中断函数参数 | |
| typedef void(* | xwds_eirq_f) (struct xwds_soc *, xwid_t, xwds_eirq_arg_t) |
| 外部中断函数 | |
| typedef void * | xwds_dma_cbarg_t |
| DMA完成回调函数参数 | |
| typedef void(* | xwds_dma_f) (struct xwds_soc *, xwid_t, xwu32_t, xwds_dma_cbarg_t) |
| DMA完成回调函数类型 | |
函数 | |
| void | xwds_soc_construct (struct xwds_soc *soc) |
| XWDS API:SOC构造函数 | |
| void | xwds_soc_destruct (struct xwds_soc *soc) |
| XWDS API:SOC对象的析构函数 | |
| xwer_t | xwds_soc_grab (struct xwds_soc *soc) |
| XWDS API:增加对象的引用计数 | |
| xwer_t | xwds_soc_put (struct xwds_soc *soc) |
| XWDS API:减少对象的引用计数 | |
| xwer_t | xwds_soc_get_reset_reason (struct xwds_soc *soc, xwu64_t *reason) |
| XWDS API:获取复位原因 | |
| xwer_t | xwds_clk_req (struct xwds_soc *soc, xwid_t id) |
| XWDS API:申请时钟 | |
| xwer_t | xwds_clk_rls (struct xwds_soc *soc, xwid_t id) |
| XWDS API:释放时钟 | |
| xwer_t | xwds_clk_getfqcy (struct xwds_soc *soc, xwid_t id, xwu32_t *buf, xwsz_t *num) |
| XWDS API:获取时钟频率 | |
| xwer_t | xwds_pwr_req (struct xwds_soc *soc, xwid_t id) |
| XWDS API:申请电源 | |
| xwer_t | xwds_pwr_rls (struct xwds_soc *soc, xwid_t id) |
| XWDS API:释放电源 | |
| xwer_t | xwds_pwr_getvltg (struct xwds_soc *soc, xwid_t id, xwu32_t *buf, xwsz_t *num) |
| XWDS API:获取电源电压 | |
| xwer_t | xwds_dma_req (struct xwds_soc *soc, xwid_t ch) |
| XWDS API:申请DMA的通道 | |
| xwer_t | xwds_dma_rls (struct xwds_soc *soc, xwid_t ch) |
| XWDS API:释放DMA的通道 | |
| xwer_t | xwds_dma_cfg (struct xwds_soc *soc, xwid_t ch, void *cfg, xwds_dma_f cb, xwds_dma_cbarg_t arg) |
| XWDS API:配置DMA的通道 | |
| xwer_t | xwds_dma_enable (struct xwds_soc *soc, xwid_t ch) |
| XWDS API:打开DMA的通道 | |
| xwer_t | xwds_dma_disable (struct xwds_soc *soc, xwid_t ch) |
| XWDS API:关闭DMA的通道 | |
| xwer_t | xwds_dma_start (struct xwds_soc *soc, xwid_t ch) |
| XWDS API:启动DMA的通道 | |
| xwer_t | xwds_dma_stop (struct xwds_soc *soc, xwid_t ch) |
| XWDS API:停止DMA的通道 | |
| #define | XWDS_DMA_CH(x) ((xwid_t)(x)) |
| XWDS DMA 通道 | |
| 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:释放外部中断 | |
| #define | XWDS_EIRQ(x) ((xwid_t)x) |
| XWDS External IRQ Number | |
| enum | xwds_soc_ei_flag_em { XWDS_SOC_EIF_TM_RISING = ((xwbmp_t)1 << ( 0 )) , XWDS_SOC_EIF_TM_FALLING = ((xwbmp_t)1 << ( 1 )) , XWDS_SOC_EIF_TM_EITHER , XWDS_SOC_EIF_TM_LOW = ((xwbmp_t)1 << ( 2 )) , XWDS_SOC_EIF_TM_HIGH = ((xwbmp_t)1 << ( 3 )) , XWDS_SOC_EIF_TM_MASK , XWDS_SOC_EIF_WKUP = ((xwbmp_t)1 << ( 4 )) , XWDS_SOC_EIF_DMA = ((xwbmp_t)1 << ( 5 )) } |
| 外部中断标志 更多... | |
| xwer_t | xwds_gpio_req (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_cfg (struct xwds_soc *soc, xwid_t port, xwsq_t pinmask, void *cfg) |
| 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_reset (struct xwds_soc *soc, xwid_t port, xwsq_t pinmask) |
| XWDS API:将SOC的GPIO设置为低电平 | |
| xwer_t | xwds_gpio_toggle (struct xwds_soc *soc, xwid_t port, xwsq_t pinmask) |
| XWDS API:翻转SOC的GPIO电平 | |
| xwer_t | xwds_gpio_output (struct xwds_soc *soc, xwid_t port, xwsq_t pinmask, xwsq_t out) |
| XWDS API:并行输出多个SOC的GPIO | |
| xwer_t | xwds_gpio_input (struct xwds_soc *soc, xwid_t port, xwsq_t pinmask, xwsq_t *inbuf) |
| XWDS API:并行读取多个SOC的GPIO | |
| #define | XWDS_GPIO_PIN(n) (1U << (n)) |
| #define | XWDS_GPIO_PIN_MASK(n) (XWDS_GPIO_PIN(n) - 1U) |
| enum | xwds_gpio_port_em { XWDS_GPIO_PORT_A = 0 , XWDS_GPIO_PORT_B , XWDS_GPIO_PORT_C , XWDS_GPIO_PORT_D , XWDS_GPIO_PORT_E , XWDS_GPIO_PORT_F , XWDS_GPIO_PORT_G , XWDS_GPIO_PORT_H , XWDS_GPIO_PORT_I , XWDS_GPIO_PORT_J , XWDS_GPIO_PORT_K , XWDS_GPIO_PORT_L , XWDS_GPIO_PORT_M , XWDS_GPIO_PORT_N , XWDS_GPIO_PORT_O , XWDS_GPIO_PORT_P , XWDS_GPIO_PORT_Q , XWDS_GPIO_PORT_R , XWDS_GPIO_PORT_S , XWDS_GPIO_PORT_T , XWDS_GPIO_PORT_U , XWDS_GPIO_PORT_V , XWDS_GPIO_PORT_W , XWDS_GPIO_PORT_X , XWDS_GPIO_PORT_Y , XWDS_GPIO_PORT_Z } |
| XWDS GPIO Port 枚举 更多... | |
| enum | xwds_gpio_pin_em { XWDS_GPIO_PIN_0 = (1U << ( 0 )) , XWDS_GPIO_PIN_1 = (1U << ( 1 )) , XWDS_GPIO_PIN_2 = (1U << ( 2 )) , XWDS_GPIO_PIN_3 = (1U << ( 3 )) , XWDS_GPIO_PIN_4 = (1U << ( 4 )) , XWDS_GPIO_PIN_5 = (1U << ( 5 )) , XWDS_GPIO_PIN_6 = (1U << ( 6 )) , XWDS_GPIO_PIN_7 = (1U << ( 7 )) , XWDS_GPIO_PIN_8 = (1U << ( 8 )) , XWDS_GPIO_PIN_9 = (1U << ( 9 )) , XWDS_GPIO_PIN_10 = (1U << ( 10 )) , XWDS_GPIO_PIN_11 = (1U << ( 11 )) , XWDS_GPIO_PIN_12 = (1U << ( 12 )) , XWDS_GPIO_PIN_13 = (1U << ( 13 )) , XWDS_GPIO_PIN_14 = (1U << ( 14 )) , XWDS_GPIO_PIN_15 = (1U << ( 15 )) , XWDS_GPIO_PIN_16 = (1U << ( 16 )) , XWDS_GPIO_PIN_17 = (1U << ( 17 )) , XWDS_GPIO_PIN_18 = (1U << ( 18 )) , XWDS_GPIO_PIN_19 = (1U << ( 19 )) , XWDS_GPIO_PIN_20 = (1U << ( 20 )) , XWDS_GPIO_PIN_21 = (1U << ( 21 )) , XWDS_GPIO_PIN_22 = (1U << ( 22 )) , XWDS_GPIO_PIN_23 = (1U << ( 23 )) , XWDS_GPIO_PIN_24 = (1U << ( 24 )) , XWDS_GPIO_PIN_25 = (1U << ( 25 )) , XWDS_GPIO_PIN_26 = (1U << ( 26 )) , XWDS_GPIO_PIN_27 = (1U << ( 27 )) , XWDS_GPIO_PIN_28 = (1U << ( 28 )) , XWDS_GPIO_PIN_29 = (1U << ( 29 )) , XWDS_GPIO_PIN_30 = (1U << ( 30 )) , XWDS_GPIO_PIN_31 = (1U << ( 31 )) } |
| XWDS GPIO Pin 枚举 更多... | |
| #define XWDS_GPIO_PIN_MASK | ( | n | ) | (XWDS_GPIO_PIN(n) - 1U) |
| typedef void* xwds_dma_cbarg_t |
| typedef void(* xwds_dma_f) (struct xwds_soc *, xwid_t, xwu32_t, xwds_dma_cbarg_t) |
| typedef void* xwds_eirq_arg_t |
| typedef void(* xwds_eirq_f) (struct xwds_soc *, xwid_t, xwds_eirq_arg_t) |
| enum xwds_gpio_pin_em |
XWDS GPIO Pin 枚举
| enum xwds_gpio_port_em |
XWDS GPIO Port 枚举
| enum xwds_soc_ei_flag_em |
XWDS API:获取时钟频率
| [in] | soc | SOC对象指针 |
| [in] | id | 时钟ID |
| [out] | buf | 返回时钟频率的缓冲区的指针 |
| [in,out] | num | 指向缓冲区的指针,此缓冲区:
|
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 时钟ID错误 |
| -ENOSYS | 不支持的API |
<No error

XWDS API:申请时钟
| [in] | soc | SOC对象指针 |
| [in] | id | 时钟ID |
| XWOK | 没有错误 |
| -ERANGE | 时钟ID错误 |
| -ENOSYS | 不支持的API |
<No error

XWDS API:释放时钟
| [in] | soc | SOC对象指针 |
| [in] | id | 时钟ID |
| XWOK | 没有错误 |
| -ERANGE | 时钟ID错误 |
| -ENOSYS | 不支持的API |
<No error

| xwer_t xwds_dma_cfg | ( | struct xwds_soc * | soc, |
| xwid_t | ch, | ||
| void * | cfg, | ||
| xwds_dma_f | cb, | ||
| xwds_dma_cbarg_t | arg | ||
| ) |
XWDS API:配置DMA的通道
| [in] | soc | SOC对象指针 |
| [in] | ch | DMA通道 |
| [in] | cfg | SOC DMA通道配置 |
| [in] | cb | 传输结束回调函数 |
| [in] | cfg | 回调函数参数 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 无效的DMA通道 |
| -EPERM | DMA通道未被使用 |
<No error

XWDS API:关闭DMA的通道
| [in] | soc | SOC对象指针 |
| [in] | ch | DMA通道 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 无效的DMA通道 |
| -EPERM | DMA通道未被使用 |
<No error

XWDS API:打开DMA的通道
| [in] | soc | SOC对象指针 |
| [in] | ch | DMA通道 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 无效的DMA通道 |
| -EPERM | DMA通道未被使用 |
<No error

XWDS API:申请DMA的通道
| [in] | soc | SOC对象指针 |
| [in] | ch | DMA通道 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 无效的DMA通道 |
| -EBUSY | DMA通道繁忙 |
<No error

XWDS API:释放DMA的通道
| [in] | soc | SOC对象指针 |
| [in] | ch | DMA通道 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 无效的DMA通道 |
| -EPERM | DMA通道未被使用 |
<No error

XWDS API:启动DMA的通道
| [in] | soc | SOC对象指针 |
| [in] | ch | DMA通道 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 无效的DMA通道 |
| -EPERM | DMA通道未被使用 |
<No error

XWDS API:停止DMA的通道
| [in] | soc | SOC对象指针 |
| [in] | ch | DMA通道 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 无效的DMA通道 |
| -EPERM | DMA通道未被使用 |
<No error

| 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:申请外部中断
| [in] | soc | SOC对象指针 |
| [in] | port | GPIO端口 |
| [in] | pinmask | GPIO PIN |
| [in] | eiid | 外部中断ID |
| [in] | eiflag | 触发标志 |
| [in] | isr | 中断响应函数 |
| [in] | arg | 中断响应函数参数 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 外部中断ID错误 |
<No error


XWDS API:释放外部中断
| [in] | soc | SOC对象指针 |
| [in] | port | GPIO端口 |
| [in] | pinmask | GPIO PIN |
| [in] | eiid | 外部中断ID |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 外部中断ID错误 |
<No error


XWDS API:配置SOC的GPIO
| [in] | soc | SOC对象指针 |
| [in] | port | GPIO端口,取值 xwds_gpio_port_em 中的一项 |
| [in] | pinmask | 引脚的掩码,取值 xwds_gpio_pin_em 中的任意项的或运算 |
| [in] | cfg | GPIO配置,取值依据不同SOC |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | GPIO PORT错误 |
| -ENOSYS | 不支持的API |
<No error

XWDS API:并行读取多个SOC的GPIO
| [in] | soc | SOC对象指针 |
| [in] | port | GPIO端口,取值 xwds_gpio_port_em 中的一项 |
| [in] | pinmask | 引脚的掩码,取值 xwds_gpio_pin_em 中的任意项的或运算 |
| [out] | inbuf | 输入缓冲区 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | GPIO PORT错误 |
| -EPERM | GPIO PIN未被申请 |
| -ENOSYS | 不支持的API |
<No error

XWDS API:并行输出多个SOC的GPIO
| [in] | soc | SOC对象指针 |
| [in] | port | GPIO端口,取值 xwds_gpio_port_em 中的一项 |
| [in] | pinmask | 引脚的掩码,取值 xwds_gpio_pin_em 中的任意项的或运算 |
| [in] | out | 输出值,引脚的掩码,取值 xwds_gpio_pin_em 中的任意项的或运算, 只有被pinmask掩码覆盖的部分有效,未覆盖的pin输出不会发生改变。 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | GPIO PORT错误 |
| -EPERM | GPIO PIN未被申请 |
| -ENOSYS | 不支持的API |
<No error

XWDS API:申请SOC的GPIO
| [in] | soc | SOC对象指针 |
| [in] | port | GPIO端口,取值 xwds_gpio_port_em 中的一项 |
| [in] | pinmask | 引脚的掩码,取值 xwds_gpio_pin_em 中的任意项的或运算 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | GPIO PORT错误 |
| -EBUSY | GPIO PIN已被使用 |
<No error


XWDS API:将SOC的GPIO设置为低电平
| [in] | soc | SOC对象指针 |
| [in] | port | GPIO端口,取值 xwds_gpio_port_em 中的一项 |
| [in] | pinmask | 引脚的掩码,取值 xwds_gpio_pin_em 中的任意项的或运算 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | GPIO PORT错误 |
| -EPERM | GPIO PIN未被申请 |
| -ENOSYS | 不支持的API |
<No error


XWDS API:释放SOC的GPIO
| [in] | soc | SOC对象指针 |
| [in] | port | GPIO端口,取值 xwds_gpio_port_em 中的一项 |
| [in] | pinmask | 引脚的掩码,取值 xwds_gpio_pin_em 中的任意项的或运算 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | GPIO PORT错误 |
| -EPERM | GPIO PIN未被申请 |
<No error


XWDS API:将SOC的GPIO设置为高电平
| [in] | soc | SOC对象指针 |
| [in] | port | GPIO端口,取值 xwds_gpio_port_em 中的一项 |
| [in] | pinmask | 引脚的掩码,取值 xwds_gpio_pin_em 中的任意项的或运算 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | GPIO PORT错误 |
| -EPERM | GPIO PIN未被申请 |
| -ENOSYS | 不支持的API |
<No error


XWDS API:翻转SOC的GPIO电平
| [in] | soc | SOC对象指针 |
| [in] | port | GPIO端口,取值 xwds_gpio_port_em 中的一项 |
| [in] | pinmask | 引脚的掩码,取值 xwds_gpio_pin_em 中的任意项的或运算 |
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | GPIO PORT错误 |
| -EPERM | GPIO PIN未被申请 |
| -ENOSYS | 不支持的API |
<No error

XWDS API:获取电源电压
| [in] | soc | SOC对象指针 |
| [in] | id | 电源ID |
| [out] | buf | 返回电源电压的缓冲区的指针 |
| [in,out] | num | 指向缓冲区的指针,此缓冲区:
|
| XWOK | 没有错误 |
| -EFAULT | 无效指针 |
| -ERANGE | 电源ID错误 |
| -ENOSYS | 不支持的API |
<No error

XWDS API:申请电源
| [in] | soc | SOC对象指针 |
| [in] | id | 电源ID |
| XWOK | 没有错误 |
| -ERANGE | 电源ID错误 |
| -ENOSYS | 不支持的API |
<No error

XWDS API:释放电源
| [in] | soc | SOC对象指针 |
| [in] | id | 电源ID |
| XWOK | 没有错误 |
| -ERANGE | 电源ID错误 |
| -ENOSYS | 不支持的API |
<No error

| void xwds_soc_construct | ( | struct xwds_soc * | soc | ) |
XWDS API:SOC构造函数
| [in] | soc | SOC对象指针 |

| void xwds_soc_destruct | ( | struct xwds_soc * | soc | ) |
XWDS API:SOC对象的析构函数
| [in] | soc | SOC对象指针 |

XWDS API:获取复位原因
| [in] | soc | SOC对象指针 |
| [out] | reason | 返回复位原因的缓冲区 |

XWDS API:增加对象的引用计数
| [in] | soc | SOC对象指针 |


XWDS API:减少对象的引用计数
| [in] | soc | SOC对象指针 |

