diff options
author | pashamray <pashamray@gmail.com> | 2014-07-10 08:04:52 +0300 |
---|---|---|
committer | pashamray <pashamray@gmail.com> | 2014-07-10 08:04:52 +0300 |
commit | b46e58ba6ccd80130b05dc662739cde55a8275f8 (patch) | |
tree | abb566e21fbea1f475cb3e1496cd5f5eaae3823e /boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h | |
parent | ddeeacea0e31ee6d2dad798b6a5f79bbd548b8b9 (diff) | |
parent | 5c8c0c7b36cd8f2c94b67cce56e99804a048a906 (diff) | |
download | uGFX-b46e58ba6ccd80130b05dc662739cde55a8275f8.tar.gz uGFX-b46e58ba6ccd80130b05dc662739cde55a8275f8.tar.bz2 uGFX-b46e58ba6ccd80130b05dc662739cde55a8275f8.zip |
Tectu/ugfx слито с master
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 |