1/*
2 * Copyright 2011-2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Alexander von Gluck, kallisti5@unixzen.com
7 */
8#ifndef _SYSTEM_BOOT_PLATFORM_PI_GPIO_H
9#define _SYSTEM_BOOT_PLATFORM_PI_GPIO_H
10
11
12#include <SupportDefs.h>
13
14#include <arch/arm/bcm2708.h>
15
16
17#define GPIO_IN		0
18#define GPIO_OUT	1
19#define GPIO_ALT0	4
20#define GPIO_ALT1	5
21#define GPIO_ALT2	6
22#define GPIO_ALT3	7
23#define GPIO_ALT4	3
24#define GPIO_ALT5	2
25
26
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32
33void gpio_write(addr_t base, int pin, bool value);
34void gpio_mode(addr_t base, int pin, int mode);
35
36void gpio_init();
37
38
39#ifdef __cplusplus
40}
41#endif
42
43
44#endif /* _SYSTEM_BOOT_PLATFORM_PI_GPIO_H */
45