L4Re - L4 Runtime Environment
vbus_gpio.h
1 /*
2  * (c) 2011 Alexander Warg <warg@os.inf.tu-dresden.de>
3  * economic rights: Technische Universit├Ąt Dresden (Germany)
4  *
5  * This file is part of TUD:OS and distributed under the terms of the
6  * GNU General Public License 2.
7  * Please see the COPYING-GPL-2 file for details.
8  */
9 #pragma once
10 
11 #include <l4/sys/compiler.h>
12 #include <l4/sys/types.h>
13 #include <l4/vbus/vbus_types.h>
14 
21 __BEGIN_DECLS
22 
27 {
31 };
32 
37 {
41 };
42 
50 int L4_CV
51 l4vbus_gpio_setup(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
52  unsigned pin, unsigned mode, int value);
53 
61 int L4_CV
62 l4vbus_gpio_config_pull(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
63  unsigned pin, unsigned mode);
64 
72 int L4_CV
73 l4vbus_gpio_config_pad(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
74  unsigned pin, unsigned func, unsigned value);
75 
83 int L4_CV
84 l4vbus_gpio_config_get(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
85  unsigned pin, unsigned func, unsigned *value);
86 
94 int L4_CV
95 l4vbus_gpio_get(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
96  unsigned pin);
97 
105 int L4_CV
106 l4vbus_gpio_set(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
107  unsigned pin, int value);
108 
121 int L4_CV
122 l4vbus_gpio_multi_setup(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
123  unsigned offset, unsigned mask,
124  unsigned mode, unsigned value);
125 
138 int L4_CV
139 l4vbus_gpio_multi_config_pad(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
140  unsigned offset, unsigned mask,
141  unsigned func, unsigned value);
142 
149 int L4_CV
150 l4vbus_gpio_multi_get(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
151  unsigned offset, unsigned *data);
152 
161 int L4_CV
162 l4vbus_gpio_multi_set(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
163  unsigned offset, unsigned mask, unsigned data);
164 
172 int L4_CV
173 l4vbus_gpio_to_irq(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
174  unsigned pin);
175 
L4vbus_gpio_pull_modes
Constants for generic GPIO pull up/down resistor configuration.
Definition: vbus_gpio.h:36
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.
Common L4 ABI Data Types.
Set GPIO pin to IRQ.
Definition: vbus_gpio.h:30
Set GPIO pin to output.
Definition: vbus_gpio.h:29
unsigned long l4_cap_idx_t
L4 Capability selector Type.
Definition: types.h:341
#define __END_DECLS
End section with C types and functions.
Definition: compiler.h:193
L4 compiler related defines.
enable pull up resistor
Definition: vbus_gpio.h:39
No pull up or pull down resistors.
Definition: vbus_gpio.h:38
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_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_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_config_pull(l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin, unsigned mode)
Generic function to set pull up/down mode.
#define L4_CV
Define calling convention.
Definition: linkage.h:44
This header file contains descriptions of vbus related data types and constants.
L4vbus_gpio_generic_func
Constants for generic GPIO functions.
Definition: vbus_gpio.h:26
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.
enable pull down resistor
Definition: vbus_gpio.h:40
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_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_pad(l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin, unsigned func, unsigned value)
Hardware specific configuration function.
int l4vbus_gpio_to_irq(l4_cap_idx_t vbus, l4vbus_device_handle_t handle, unsigned pin)
Create IRQ for GPIO pin.
Set GPIO pin to input.
Definition: vbus_gpio.h:28
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.