GPIO HAL

The GPIO HAL definitions are in dev_gpio.h, it provides interfaces for gpio driver to implement. Here is a diagram for the gpio interface.

GPIO HAL

Definitions

group DEVICE_HAL_GPIO_DEVSTRUCT

contains definitions of gpio device structure.

This structure will be used in user implemented code, which was called Device Driver Implement Layer for gpio to use in implementation code. Application developer should use the GPIO API provided here to access to GPIO devices. BSP developer should follow the API definition to implement GPIO device drivers.

Defines

DEV_GPIO_INFO_SET_EXTRA_OBJECT(gpio_info_ptr, extra_info)

Set extra information pointer of gpio info

DEV_GPIO_INFO_GET_EXTRA_OBJECT(gpio_info_ptr)

Get extra information pointer of gpio info

DEV_GPIO_BITS_MTHD_POLL

Method of all gpio bits set to poll

DEV_GPIO_BITS_MTHD_INTERRUPT

Method of all gpio bits set to interrupt

DEV_GPIO_BITS_MTHD_DEFAULT

Default method of all gpio bits should be poll for first open

Typedefs

typedef struct dev_gpio_info DEV_GPIO_INFO

gpio information struct definition

Informations about gpio open count, working status gpio registers and control block, gpio io direction and interrupt/poll for each bit of gpio

Note

Only available for gpio with max 32bits

typedef struct dev_gpio_info *DEV_GPIO_INFO_PTR
typedef struct dev_gpio DEV_GPIO

gpio device interface definition

Define gpio device interface, like gpio information structure, fuctions to open/close/control gpio, write or read data via gpio

Note

All this details are implemented by user in user porting code

typedef struct dev_gpio *DEV_GPIO_PTR
struct dev_gpio_info
#include <dev_gpio.h>

gpio information struct definition

Informations about gpio open count, working status gpio registers and control block, gpio io direction and interrupt/poll for each bit of gpio

Note

Only available for gpio with max 32bits

struct dev_gpio
#include <dev_gpio.h>

gpio device interface definition

Define gpio device interface, like gpio information structure, fuctions to open/close/control gpio, write or read data via gpio

Note

All this details are implemented by user in user porting code