summaryrefslogtreecommitdiff
path: root/include/gpio.h
diff options
context:
space:
mode:
authorDaniel Leung <daniel.leung@intel.com>2015-09-17 15:56:47 -0700
committerAnas Nashif <anas.nashif@intel.com>2016-02-05 20:24:18 -0500
commitadd6d78b0a5ec0262d775a0f7292014d567d923f (patch)
tree8d8260e941121927b57e9793cdf4513a576186af /include/gpio.h
parent792930172a1247bf1f3159a2e71ac5a9f4035686 (diff)
gpio: add polarity and pull up/down config flags
This adds to the configuration flags for GPIO: () Indicates the polarity of the pin, whether it should be normal or inversed. () Enables pull up/pull down for the pin. Change-Id: I2b0c57e5a539208aff7aeb4ea53050134ab404fd Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Diffstat (limited to 'include/gpio.h')
-rw-r--r--include/gpio.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h
index 562173571..84736b4d2 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -59,6 +59,19 @@ extern "C" {
#define GPIO_INT_EDGE (1 << 5)
#define GPIO_INT_DOUBLE_EDGE (1 << 6)
+/* Polarity of the GPIO (1 bit) */
+#define GPIO_POL_POS 7
+#define GPIO_POL_NORMAL (0 << GPIO_POL_POS)
+#define GPIO_POL_INV (1 << GPIO_POL_POS)
+#define GPIO_POL_MASK (1 << GPIO_POL_POS)
+
+/* Pull-up/pull-down for GPIO (2 bits) */
+#define GPIO_PUD_POS 8
+#define GPIO_PUD_NORMAL (0 << GPIO_PUD_POS)
+#define GPIO_PUD_PULL_UP (1 << GPIO_PUD_POS)
+#define GPIO_PUD_PULL_DOWN (2 << GPIO_PUD_POS)
+#define GPIO_PUD_MASK (3 << GPIO_PUD_POS)
+
/* application callback function signature*/
typedef void (*gpio_callback_t)(struct device *port, uint32_t pin);