summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/raspberrypi/include/rpi-gpio.h
diff options
context:
space:
mode:
authorPavel Pisa <ppisa@pikron.com>2016-05-19 10:29:28 +0200
committerPavel Pisa <ppisa@pikron.com>2016-05-19 13:21:40 +0200
commit4b62192f0570427ec66b9fd57882389c9a92a459 (patch)
tree1b434b867dad47fccb003ff994f11adb450923d8 /c/src/lib/libbsp/arm/raspberrypi/include/rpi-gpio.h
parentarm/raspberrypi: ensure that RTEMS application image can be started by U-boot. (diff)
downloadrtems-4b62192f0570427ec66b9fd57882389c9a92a459.tar.bz2
arm/raspberrypi: correct GPIO pin function selection.
Original implementation does only bitwise-or with previous register value for all functions except IN. Switch from one to other function would lead to incorrect value.
Diffstat (limited to 'c/src/lib/libbsp/arm/raspberrypi/include/rpi-gpio.h')
-rw-r--r--c/src/lib/libbsp/arm/raspberrypi/include/rpi-gpio.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/arm/raspberrypi/include/rpi-gpio.h b/c/src/lib/libbsp/arm/raspberrypi/include/rpi-gpio.h
index 7f4d802b0f..82ba4b1f2a 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/include/rpi-gpio.h
+++ b/c/src/lib/libbsp/arm/raspberrypi/include/rpi-gpio.h
@@ -26,7 +26,7 @@ extern "C" {
/**
* @brief Raspberry Pi GPIO functions.
*/
-#define RPI_DIGITAL_IN 7
+#define RPI_DIGITAL_IN 0
#define RPI_DIGITAL_OUT 1
#define RPI_ALT_FUNC_0 4
#define RPI_ALT_FUNC_1 5
@@ -34,6 +34,7 @@ extern "C" {
#define RPI_ALT_FUNC_3 7
#define RPI_ALT_FUNC_4 3
#define RPI_ALT_FUNC_5 2
+#define RPI_ALT_FUNC_MASK 7
/**
* @brief Setups a JTAG interface.