Hardware GPIO data types. More...

Enumerations

enum gos_gpio_config_t {
GOS_GPIO_INPUT_PULL_UP ,
GOS_GPIO_INPUT_PULL_DOWN ,
GOS_GPIO_INPUT_HIGH_IMPEDANCE ,
GOS_GPIO_OUTPUT_PUSH_PULL ,
GOS_GPIO_OUTPUT_OPEN_DRAIN_NO_PULL ,
GOS_GPIO_OUTPUT_OPEN_DRAIN_PULL_UP ,
GOS_GPIO_CONFIG_NONE
}
GPIO direction (i.e. function) type. More...
enum gos_gpio_irq_trigger_t {
GOS_GPIO_TRIGGER_RISING_EDGE = 0x1,
GOS_GPIO_TRIGGER_FALLING_EDGE = 0x2,
GOS_GPIO_TRIGGER_BOTH_EDGES = GOS_GPIO_TRIGGER_RISING_EDGE | GOS_GPIO_TRIGGER_FALLING_EDGE
}
GPIO external interrupt trigger edge. More...
enum gos_gpio_t {
GOS_GPIO_0 ,
GOS_GPIO_MAX ,
GOS_GPIO_INVALID
}

Detailed Description

Hardware GPIO data types.

Enumeration Type Documentation

gos_gpio_config_t

GPIO direction (i.e. function) type.

Enumerator
GOS_GPIO_INPUT_PULL_UP

Input with an internal pull-up resistor - use with devices that actively drive the signal low - e.g. button connected to ground.

GOS_GPIO_INPUT_PULL_DOWN

Input with an internal pull-down resistor - use with devices that actively drive the signal high - e.g. button connected to a power rail.

GOS_GPIO_INPUT_HIGH_IMPEDANCE

Input - must always be driven, either actively or by an external pullup resistor.

GOS_GPIO_OUTPUT_PUSH_PULL

Output actively driven high and actively driven low - must not be connected to other active outputs - e.g. LED output.

GOS_GPIO_OUTPUT_OPEN_DRAIN_NO_PULL

Output actively driven low but is high-impedance when set high - can be connected to other open-drain/open-collector outputs. Needs an external pull-up resistor.

GOS_GPIO_OUTPUT_OPEN_DRAIN_PULL_UP

Output actively driven low and is pulled high with an internal resistor when set high - can be connected to other open-drain/open-collector outputs.

GOS_GPIO_CONFIG_NONE

None. GPIO is unregistered.

gos_gpio_irq_trigger_t

GPIO external interrupt trigger edge.

Enumerator
GOS_GPIO_TRIGGER_RISING_EDGE

Interrupt triggered at input signal's rising edge.

GOS_GPIO_TRIGGER_FALLING_EDGE

Interrupt triggered at input signal's falling edge.

GOS_GPIO_TRIGGER_BOTH_EDGES

Interrupt triggered on both edges.

gos_gpio_t

Gecko OS GPIO ID

Enumerator
GOS_GPIO_0

This is just a placeholder, this is platform dependent.

GOS_GPIO_MAX

Maximum number of GPIOs the platform supports in Gecko OS.

Maximum number of I2Cs the platform supports in Gecko OS.

GOS_GPIO_INVALID

Invalid GPIO.

Examples:
peripheral/gpio_irq/main.c , and system/indicator/main.c .