1 | /** |
---|
2 | * @file rpi-gpio.h |
---|
3 | * |
---|
4 | * @ingroup raspberrypi_gpio |
---|
5 | * |
---|
6 | * @brief Raspberry Pi specific GPIO definitions. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2015 Andre Marques <andre.lousa.marques at gmail.com> |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef LIBBSP_ARM_RASPBERRYPI_RPI_GPIO_H |
---|
18 | #define LIBBSP_ARM_RASPBERRYPI_RPI_GPIO_H |
---|
19 | |
---|
20 | #include <rtems.h> |
---|
21 | |
---|
22 | #ifdef __cplusplus |
---|
23 | extern "C" { |
---|
24 | #endif /* __cplusplus */ |
---|
25 | |
---|
26 | /** |
---|
27 | * @brief Raspberry Pi GPIO functions. |
---|
28 | */ |
---|
29 | #define RPI_DIGITAL_IN 0 |
---|
30 | #define RPI_DIGITAL_OUT 1 |
---|
31 | #define RPI_ALT_FUNC_0 4 |
---|
32 | #define RPI_ALT_FUNC_1 5 |
---|
33 | #define RPI_ALT_FUNC_2 6 |
---|
34 | #define RPI_ALT_FUNC_3 7 |
---|
35 | #define RPI_ALT_FUNC_4 3 |
---|
36 | #define RPI_ALT_FUNC_5 2 |
---|
37 | #define RPI_ALT_FUNC_MASK 7 |
---|
38 | |
---|
39 | /** |
---|
40 | * @brief Setups a JTAG interface. |
---|
41 | * |
---|
42 | * @retval RTEMS_SUCCESSFUL JTAG interface successfully configured. |
---|
43 | * @retval * At least one of the required pins is currently |
---|
44 | * occupied, @see rtems_gpio_request_pin_group(). |
---|
45 | */ |
---|
46 | extern rtems_status_code rpi_gpio_select_jtag(void); |
---|
47 | |
---|
48 | /** |
---|
49 | * @brief Setups a SPI interface. |
---|
50 | * |
---|
51 | * @retval RTEMS_SUCCESSFUL SPI interface successfully configured. |
---|
52 | * @retval * At least one of the required pins is currently |
---|
53 | * occupied, @see rtems_gpio_request_pin_group(). |
---|
54 | */ |
---|
55 | extern rtems_status_code rpi_gpio_select_spi(void); |
---|
56 | |
---|
57 | /** |
---|
58 | * @brief Setups a I2C interface. |
---|
59 | * |
---|
60 | * @retval RTEMS_SUCCESSFUL I2C interface successfully configured. |
---|
61 | * @retval * At least one of the required pins is currently |
---|
62 | * occupied, @see rtems_gpio_request_pin_group(). |
---|
63 | */ |
---|
64 | extern rtems_status_code rpi_gpio_select_i2c(void); |
---|
65 | |
---|
66 | #ifdef __cplusplus |
---|
67 | } |
---|
68 | #endif /* __cplusplus */ |
---|
69 | |
---|
70 | #endif /* LIBBSP_ARM_RASPBERRYPI_RPI_GPIO_H */ |
---|