Loading...
Searching...
No Matches
vbus_gpio.h
/*
* (c) 2011 Alexander Warg <warg@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/compiler.h>
#include <l4/sys/types.h>
#include <l4/vbus/vbus_types.h>
L4_BEGIN_DECLS
enum L4vbus_gpio_generic_func
{
L4VBUS_GPIO_SETUP_INPUT = 0x100,
L4VBUS_GPIO_SETUP_OUTPUT = 0x200,
L4VBUS_GPIO_SETUP_IRQ = 0x300,
};
enum L4vbus_gpio_pull_modes
{
L4VBUS_GPIO_PIN_PULL_NONE = 0x100,
L4VBUS_GPIO_PIN_PULL_UP = 0x200,
L4VBUS_GPIO_PIN_PULL_DOWN = 0x300,
};
int L4_CV
l4vbus_gpio_setup(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned pin, unsigned mode, int value);
int L4_CV
l4vbus_gpio_config_pull(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned pin, unsigned mode);
int L4_CV
l4vbus_gpio_config_pad(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned pin, unsigned func, unsigned value);
int L4_CV
l4vbus_gpio_config_get(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned pin, unsigned func, unsigned *value);
int L4_CV
l4vbus_gpio_get(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned pin);
int L4_CV
l4vbus_gpio_set(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned pin, int value);
int L4_CV
l4vbus_gpio_multi_setup(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned offset, unsigned mask,
unsigned mode, unsigned value);
int L4_CV
l4vbus_gpio_multi_config_pad(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned offset, unsigned mask,
unsigned func, unsigned value);
int L4_CV
l4vbus_gpio_multi_get(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned offset, unsigned *data);
int L4_CV
l4vbus_gpio_multi_set(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned offset, unsigned mask, unsigned data);
int L4_CV
l4vbus_gpio_to_irq(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
unsigned pin);
L4_END_DECLS
compiler.h
L4 compiler related defines.
l4_cap_idx_t
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
L4_CV
#define L4_CV
Define calling convention.
Definition linkage.h:33
L4_BEGIN_DECLS
#define L4_BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:165
L4_END_DECLS
#define L4_END_DECLS
End section with C types and functions.
Definition compiler.h:166
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.
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.
L4vbus_gpio_generic_func
L4vbus_gpio_generic_func
Constants for generic GPIO functions.
Definition vbus_gpio.h:25
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.
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.
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.
L4vbus_gpio_pull_modes
L4vbus_gpio_pull_modes
Constants for generic GPIO pull up/down resistor configuration.
Definition vbus_gpio.h:35
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.
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.
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.
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.
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.
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.
L4VBUS_GPIO_SETUP_IRQ
@ L4VBUS_GPIO_SETUP_IRQ
Set GPIO pin to IRQ.
Definition vbus_gpio.h:28
L4VBUS_GPIO_SETUP_INPUT
@ L4VBUS_GPIO_SETUP_INPUT
Set GPIO pin to input.
Definition vbus_gpio.h:26
L4VBUS_GPIO_SETUP_OUTPUT
@ L4VBUS_GPIO_SETUP_OUTPUT
Set GPIO pin to output.
Definition vbus_gpio.h:27
L4VBUS_GPIO_PIN_PULL_DOWN
@ L4VBUS_GPIO_PIN_PULL_DOWN
enable pull down resistor
Definition vbus_gpio.h:38
L4VBUS_GPIO_PIN_PULL_NONE
@ L4VBUS_GPIO_PIN_PULL_NONE
No pull up or pull down resistors.
Definition vbus_gpio.h:36
L4VBUS_GPIO_PIN_PULL_UP
@ L4VBUS_GPIO_PIN_PULL_UP
enable pull up resistor
Definition vbus_gpio.h:37
types.h
Common L4 ABI Data Types.
vbus_types.h
This header file contains descriptions of vbus related data types and constants.
l4vbus_device_handle_t
l4_mword_t l4vbus_device_handle_t
Device handle for a device on the vbus.
Definition vbus_types.h:18