Hardware GPIO data types. More...

Typedefs

typedef void(* zos_gpio_irq_callback_t) (void *arg)
 GPIO interrupt callback prototype. More...
 

Enumerations

enum  zos_gpio_direction_t {
  GPIO_INPUT_PULLUP,
  GPIO_INPUT_PULLDOWN,
  GPIO_INPUT_HIGHZ,
  GPIO_OUTPUT_PUSHPULL,
  GPIO_OUTPUT_OPENDRAIN,
  GPIO_OUTPUT_OPENDRAIN_PULLUP,
  GPIO_OUTPUT_NONE
}
 GPIO direction (i.e. More...
 
enum  zos_gpio_irq_trigger_t {
  GPIO_IRQ_TRIGGER_RISING_EDGE = 0x1,
  GPIO_IRQ_TRIGGER_FALLING_EDGE = 0x2,
  GPIO_IRQ_TRIGGER_BOTH_EDGES = GPIO_IRQ_TRIGGER_RISING_EDGE | GPIO_IRQ_TRIGGER_FALLING_EDGE
}
 GPIO external interrupt trigger edge. More...
 

Detailed Description

Hardware GPIO data types.

Typedef Documentation

typedef void(* zos_gpio_irq_callback_t) (void *arg)

GPIO interrupt callback prototype.

Parameters
[out]argIs the argument supplied when calling zn_gpio_irq_enable()

Enumeration Type Documentation

GPIO direction (i.e.

function) type

Enumerator
GPIO_INPUT_PULLUP 

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

GPIO_INPUT_PULLDOWN 

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

GPIO_INPUT_HIGHZ 

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

GPIO_OUTPUT_PUSHPULL 

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

GPIO_OUTPUT_OPENDRAIN 

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.

GPIO_OUTPUT_OPENDRAIN_PULLUP 

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.

GPIO_OUTPUT_NONE 

None. GPIO is de-registered.

GPIO external interrupt trigger edge.

Enumerator
GPIO_IRQ_TRIGGER_RISING_EDGE 

Interrupt triggered at input signal's rising edge.

GPIO_IRQ_TRIGGER_FALLING_EDGE 

Interrupt triggered at input signal's falling edge.

GPIO_IRQ_TRIGGER_BOTH_EDGES 

Interrupt triggered on both edges.