Loading...
Searching...
No Matches
L4vbus GPIO functions
L4 Vbus functions
Collaboration diagram for L4vbus GPIO functions:

## Enumerations

enum | L4vbus_gpio_generic_func { L4VBUS_GPIO_SETUP_INPUT = 0x100 , L4VBUS_GPIO_SETUP_OUTPUT = 0x200 , L4VBUS_GPIO_SETUP_IRQ = 0x300 }
| Constants for generic GPIO functions. More...
enum | L4vbus_gpio_pull_modes { L4VBUS_GPIO_PIN_PULL_NONE = 0x100 , L4VBUS_GPIO_PIN_PULL_UP = 0x200 , L4VBUS_GPIO_PIN_PULL_DOWN = 0x300 }
| Constants for generic GPIO pull up/down resistor configuration. More...

## Functions

int | l4vbus_gpio_setup (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin, unsigned mode, int value)
| Configure the function of a GPIO pin.
int | l4vbus_gpio_config_pull (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin, unsigned mode)
| Generic function to set pull up/down mode.
int | l4vbus_gpio_config_pad (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin, unsigned func, unsigned value)
| Hardware specific configuration function.
int | l4vbus_gpio_config_get (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin, unsigned func, unsigned *value)
| Read hardware specific configuration.
int | l4vbus_gpio_get (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin)
| Read value of GPIO input pin.
int | l4vbus_gpio_set (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin, int value)
| Set GPIO output pin.
int | l4vbus_gpio_multi_setup (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned offset, unsigned mask, unsigned mode, unsigned value)
| Configure function of multiple GPIO pins at once.
int | l4vbus_gpio_multi_config_pad (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned offset, unsigned mask, unsigned func, unsigned value)
| Hardware specific configuration function for multiple GPIO pins.
int | l4vbus_gpio_multi_get (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned offset, unsigned *data)
| Read values of multiple GPIO pins at once.
int | l4vbus_gpio_multi_set (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned offset, unsigned mask, unsigned data)
| Set multiple GPIO output pins at once.
int | l4vbus_gpio_to_irq (l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin)
| Create IRQ for GPIO pin.

## Detailed Description

## Enumeration Type Documentation

## L4vbus_gpio_generic_func

enum L4vbus_gpio_generic_func

Constants for generic GPIO functions.

Enumerator
L4VBUS_GPIO_SETUP_INPUT | Set GPIO pin to input.
L4VBUS_GPIO_SETUP_OUTPUT | Set GPIO pin to output.
L4VBUS_GPIO_SETUP_IRQ | Set GPIO pin to IRQ.

Definition at line 24 of file vbus_gpio.h.

## L4vbus_gpio_pull_modes

enum L4vbus_gpio_pull_modes

Constants for generic GPIO pull up/down resistor configuration.

Enumerator
L4VBUS_GPIO_PIN_PULL_NONE | No pull up or pull down resistors.
L4VBUS_GPIO_PIN_PULL_UP | enable pull up resistor
L4VBUS_GPIO_PIN_PULL_DOWN | enable pull down resistor

Definition at line 34 of file vbus_gpio.h.

## Function Documentation

## l4vbus_gpio_config_get()

int l4vbus_gpio_config_get | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | pin,
|  | unsigned | func,
|  | unsigned * | value )

Read hardware specific configuration.

Parameters

  | vbus | V-BUS capability
  | handle | Device handle for the GPIO chip
  | pin | GPIO pin number
  | func | Hardware specific configuration register to read from. Usually this is an offset to the GPIO chip's base address.
  [out] | value | The configuration value.

Returns
  0 if OK, error code otherwise

References L4_CV.

Referenced by L4vbus::Gpio_pin::config_get().

Here is the caller graph for this function:

## l4vbus_gpio_config_pad()

int l4vbus_gpio_config_pad | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | pin,
|  | unsigned | func,
|  | unsigned | value )

Hardware specific configuration function.

Parameters

  vbus | V-BUS capability
  handle | Device handle for the GPIO chip
  pin | GPIO pin number
  func | Hardware specific configuration register, usually offset to the GPIO chip's base address
  value | Value which is written into the hardware specific configuration register for the specified pin

Returns
  0 if OK, error code otherwise

References L4_CV.

Referenced by L4vbus::Gpio_pin::config_pad().

Here is the caller graph for this function:

## l4vbus_gpio_config_pull()

int l4vbus_gpio_config_pull | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | pin,
|  | unsigned | mode )

Generic function to set pull up/down mode.

Parameters

  vbus | V-BUS capability
  handle | Device handle for the GPIO chip
  pin | GPIO pin number
  mode | mode for pull up/down resistors, see L4vbus_gpio_pull_modes

Returns
  0 if OK, error code otherwise

References L4_CV.

Referenced by L4vbus::Gpio_pin::config_pull().

Here is the caller graph for this function:

## l4vbus_gpio_get()

int l4vbus_gpio_get | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | pin )

Read value of GPIO input pin.

Parameters

  vbus | V-BUS capability
  handle | Device handle for the GPIO chip
  pin | GPIO pin number to read from

Returns
  Value of GPIO pin (usually 0 or 1), negative error code otherwise.

References L4_CV.

Referenced by L4vbus::Gpio_pin::get().

Here is the caller graph for this function:

## l4vbus_gpio_multi_config_pad()

int l4vbus_gpio_multi_config_pad | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | offset,
|  | unsigned | mask,
|  | unsigned | func,
|  | unsigned | value )

Hardware specific configuration function for multiple GPIO pins.

Parameters

  vbus | V-BUS capability
  handle | Device handle for the GPIO chip
  offset | Pin corresponding to the LSB in mask. Note: allowed may be hardware specific.
  mask | Mask of GPIO pins to configure. A bit set to 1 configures this pin. A maximum of 32 pins can be configured at once. The real number depends on the hardware and the driver implementation.
  func | Hardware specific configuration register, usually offset to the GPIO chip's base address.
  value | Value which is written into the hardware specific configuration register for the specified pins

Returns
  0 if OK, error code otherwise

References L4_CV.

Referenced by L4vbus::Gpio_module::config_pad().

Here is the caller graph for this function:

## l4vbus_gpio_multi_get()

int l4vbus_gpio_multi_get | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | offset,
|  | unsigned * | data )

Read values of multiple GPIO pins at once.

Parameters

  | vbus | V-BUS capability
  | handle | Device handle for the GPIO chip
  | offset | Pin corresponding to the LSB in data. Note: allowed may be hardware specific.
  [out] | data | Each bit returns the value (0 or 1) for the corresponding GPIO pin. The value of pins that are not accessible is undefined.

Returns
  0 if OK, error code otherwise

References L4_CV.

Referenced by L4vbus::Gpio_module::get().

Here is the caller graph for this function:

## l4vbus_gpio_multi_set()

int l4vbus_gpio_multi_set | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | offset,
|  | unsigned | mask,
|  | unsigned | data )

Set multiple GPIO output pins at once.

Parameters

  vbus | V-BUS capability
  handle | Device handle for the GPIO chip
  offset | Pin corresponding to the LSB in data. Note: allowed may be hardware specific.
  mask | Mask of GPIO pins to set. A bit set to 1 selects this pin. A maximum of 32 pins can be set at once. The real number depends on the hardware and the driver implementation.
  data | Each bit corresponds to the GPIO pin in mask. The value of each bit is written to the GPIO pin if its bit in mask is set.

Returns
  0 if OK, error code otherwise

References L4_CV.

Referenced by L4vbus::Gpio_module::set().

Here is the caller graph for this function:

## l4vbus_gpio_multi_setup()

int l4vbus_gpio_multi_setup | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | offset,
|  | unsigned | mask,
|  | unsigned | mode,
|  | unsigned | value )

Configure function of multiple GPIO pins at once.

Parameters

  vbus | V-BUS capability
  handle | Device handle for the GPIO chip
  offset | Pin corresponding to the LSB in mask. Note: allowed may be hardware specific.
  mask | Mask of GPIO pins to configure. A bit set to 1 configures this pin. A maximum of 32 pins can be configured at once. The real number depends on the hardware and the driver implementation.
  mode | GPIO function, see L4vbus_gpio_generic_func for generic functions. Hardware specific functions must be provided in the lower 8 bits.
  value | Optional value to set the GPIO pins to if they are configured as output pins

Returns
  0 if OK, error code otherwise

References L4_CV.

Referenced by L4vbus::Gpio_module::setup().

Here is the caller graph for this function:

## l4vbus_gpio_set()

int l4vbus_gpio_set | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | pin,
|  | int | value )

Set GPIO output pin.

Parameters

  vbus | V-BUS capability
  handle | Device handle for the GPIO chip
  pin | GPIO pin number to write to
  value | Value to write to the GPIO pin (usually 0 or 1)

Returns
  0 if OK, error code otherwise

References L4_CV.

Referenced by L4vbus::Gpio_pin::set().

Here is the caller graph for this function:

## l4vbus_gpio_setup()

int l4vbus_gpio_setup | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | pin,
|  | unsigned | mode,
|  | int | value )

Configure the function of a GPIO pin.

Parameters

  vbus | V-BUS capability
  handle | Device handle for the GPIO chip
  pin | GPIO pin number
  mode | GPIO function, see L4vbus_gpio_generic_func for generic functions. Hardware specific functions must be provided in the lower 8 bits.
  value | Optional value to set the GPIO pin to if it is configured as an output pin

Returns
  0 if OK, error code otherwise

References L4_CV.

Referenced by L4vbus::Gpio_pin::setup().

Here is the caller graph for this function:

## l4vbus_gpio_to_irq()

int l4vbus_gpio_to_irq | ( | l4_cap_idx_t | vbus,
|  | l4vbus_device_handle_t | handle,
|  | unsigned | pin )

Create IRQ for GPIO pin.

Parameters

  vbus | V-BUS capability
  handle | Device handle for the GPIO chip
  pin | GPIO pin to create an IRQ for.

Returns
  IRQ number if OK, negative error code otherwise

References L4_END_DECLS.

Referenced by L4vbus::Gpio_pin::to_irq().

Here is the caller graph for this function: