diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-07-09 18:47:59 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-07-09 18:47:59 +1000 |
commit | 6dea259ea2dd0afc4b610961e211d77460cfd0c6 (patch) | |
tree | 225a157a5ac0c7cf8d4e1b451b47075a57e3110b /boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h | |
parent | ab9ce99647965d0d3e9ea65ea92ad694c8b8ee1b (diff) | |
download | uGFX-6dea259ea2dd0afc4b610961e211d77460cfd0c6.tar.gz uGFX-6dea259ea2dd0afc4b610961e211d77460cfd0c6.tar.bz2 uGFX-6dea259ea2dd0afc4b610961e211d77460cfd0c6.zip |
Example added for FreeRTOS on Raspberry Pi
Diffstat (limited to 'boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h')
-rw-r--r-- | boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h | 48 |
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 |