GPIO控制器

类型定义

typedef aos_dev_ref_t aos_gpioc_ref_t
 

函数

aos_status_t aos_gpioc_get (aos_gpioc_ref_t *ref, uint32_t id)
 Get a GPIO controller device. 更多...
 
void aos_gpioc_put (aos_gpioc_ref_t *ref)
 Release a GPIO controller device. 更多...
 
aos_status_t aos_gpioc_get_num_pins (aos_gpioc_ref_t *ref)
 Get number of pins on a GPIO controller device. 更多...
 
aos_status_t aos_gpioc_get_mode (aos_gpioc_ref_t *ref, uint32_t pin, uint32_t *mode)
 Get the parameters associated with a GPIO pin. 更多...
 
aos_status_t aos_gpioc_set_mode (aos_gpioc_ref_t *ref, uint32_t pin, uint32_t mode)
 Set the parameters associated with a GPIO pin. 更多...
 
aos_status_t aos_gpioc_set_mode_irq (aos_gpioc_ref_t *ref, uint32_t pin, uint32_t mode, aos_gpio_irq_handler_t irq_handler, void *irq_arg)
 Set the parameters and IRQ settings associated with a GPIO pin. 更多...
 
aos_status_t aos_gpioc_get_value (aos_gpioc_ref_t *ref, uint32_t pin)
 Get the input or output level of a GPIO pin. 更多...
 
aos_status_t aos_gpioc_set_value (aos_gpioc_ref_t *ref, uint32_t pin, int val)
 Set the output level of a GPIO pin. 更多...
 
aos_status_t aos_gpioc_toggle (aos_gpioc_ref_t *ref, uint32_t pin)
 Toggle the output level of a GPIO pin. 更多...
 

详细描述

给应用提供GPIO控制器操作的AOS API.

类型定义说明

◆ aos_gpioc_ref_t

typedef aos_dev_ref_t aos_gpioc_ref_t

在文件 gpioc.h19 行定义.

函数说明

◆ aos_gpioc_get()

aos_status_t aos_gpioc_get ( aos_gpioc_ref_t ref,
uint32_t  id 
)

Get a GPIO controller device.

参数
[out]refGPIO controller ref to operate
[in]idGPIO controller device ID
返回
0: on success; < 0: on failure

◆ aos_gpioc_get_mode()

aos_status_t aos_gpioc_get_mode ( aos_gpioc_ref_t ref,
uint32_t  pin,
uint32_t *  mode 
)

Get the parameters associated with a GPIO pin.

参数
[in]refGPIO controller ref to operate
[in]pinpin to operate
[out]modepin mode
返回
0: on success; < 0: on failure

◆ aos_gpioc_get_num_pins()

aos_status_t aos_gpioc_get_num_pins ( aos_gpioc_ref_t ref)

Get number of pins on a GPIO controller device.

参数
[in]refGPIO controller ref to operate
返回
>= 0: on success; < 0: on failure

◆ aos_gpioc_get_value()

aos_status_t aos_gpioc_get_value ( aos_gpioc_ref_t ref,
uint32_t  pin 
)

Get the input or output level of a GPIO pin.

参数
[in]refGPIO controller ref to operate
[in]pinpin to operate
返回
0: low level; > 0: high level; < 0: on failure

◆ aos_gpioc_put()

void aos_gpioc_put ( aos_gpioc_ref_t ref)

Release a GPIO controller device.

参数
[in]refGPIO controller ref to operate
返回
None

◆ aos_gpioc_set_mode()

aos_status_t aos_gpioc_set_mode ( aos_gpioc_ref_t ref,
uint32_t  pin,
uint32_t  mode 
)

Set the parameters associated with a GPIO pin.

参数
[in]refGPIO controller ref to operate
[in]pinpin to operate
[in]modepin mode
返回
0: on success; < 0: on failure

◆ aos_gpioc_set_mode_irq()

aos_status_t aos_gpioc_set_mode_irq ( aos_gpioc_ref_t ref,
uint32_t  pin,
uint32_t  mode,
aos_gpio_irq_handler_t  irq_handler,
void *  irq_arg 
)

Set the parameters and IRQ settings associated with a GPIO pin.

参数
[in]refGPIO controller ref to operate
[in]pinpin to operate
[in]modepin mode
[in]irq_handlerIRQ handler
[in]irq_argargument passed to IRQ handler
返回
0: on success; < 0: on failure

◆ aos_gpioc_set_value()

aos_status_t aos_gpioc_set_value ( aos_gpioc_ref_t ref,
uint32_t  pin,
int  val 
)

Set the output level of a GPIO pin.

参数
[in]refGPIO controller ref to operate
[in]pinpin to operate
[in]valoutput level
返回
0: on success; < 0: on failure

◆ aos_gpioc_toggle()

aos_status_t aos_gpioc_toggle ( aos_gpioc_ref_t ref,
uint32_t  pin 
)

Toggle the output level of a GPIO pin.

参数
[in]refGPIO controller ref to operate
[in]pinpin to operate
返回
0: on success; < 0: on failure