aboutsummaryrefslogtreecommitdiffstats
path: root/boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-07-15 12:41:40 +1000
committerinmarket <andrewh@inmarket.com.au>2014-07-15 12:41:40 +1000
commit0e74c164c3eac14f6e99d1a5cc4e0563faeff5d0 (patch)
treead1e2e9942db826dfaaf681c8a0cef48a87eabf2 /boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h
parent92d972cfd83b67961dc63d60c5317ec2651eb256 (diff)
parentdb4719bd1d3cef2597f1bf443f8d82a27f233eae (diff)
downloaduGFX-0e74c164c3eac14f6e99d1a5cc4e0563faeff5d0.tar.gz
uGFX-0e74c164c3eac14f6e99d1a5cc4e0563faeff5d0.tar.bz2
uGFX-0e74c164c3eac14f6e99d1a5cc4e0563faeff5d0.zip
Merge branch 'master' into newmouse
Diffstat (limited to 'boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h')
-rw-r--r--boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h b/boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h
new file mode 100644
index 00000000..fa459707
--- /dev/null
+++ b/boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h
@@ -0,0 +1,48 @@
+#ifndef _GPIO_H_
+#define _GPIO_H_
+
+/* GPIO event detect types */
+enum DETECT_TYPE {
+ DETECT_NONE,
+ DETECT_RISING,
+ DETECT_FALLING,
+ DETECT_HIGH,
+ DETECT_LOW,
+ DETECT_RISING_ASYNC,
+ DETECT_FALLING_ASYNC
+};
+
+/* GPIO pull up or down states */
+enum PULL_STATE {
+ PULL_DISABLE,
+ PULL_UP,
+ PULL_DOWN,
+ PULL_RESERVED
+};
+
+/* Pin data direction */
+enum GPIO_DIR {
+ GPIO_IN,
+ GPIO_OUT
+};
+
+/* GPIO pin setup */
+void SetGpioFunction (unsigned int pinNum, unsigned int funcNum);
+/* A simple wrapper around SetGpioFunction */
+void SetGpioDirection (unsigned int pinNum, enum GPIO_DIR dir);
+
+/* Set GPIO output level */
+void SetGpio (unsigned int pinNum, unsigned int pinVal);
+
+/* Read GPIO pin level */
+int ReadGpio (unsigned int pinNum);
+
+/* GPIO pull up/down resistor control function (NOT YET IMPLEMENTED) */
+int PudGpio (unsigned int pinNum, enum PULL_STATE state);
+
+/* Interrupt related functions */
+void EnableGpioDetect (unsigned int pinNum, enum DETECT_TYPE type);
+void DisableGpioDetect (unsigned int pinNum, enum DETECT_TYPE type);
+void ClearGpioInterrupt (unsigned int pinNum);
+
+#endif