summaryrefslogtreecommitdiff
path: root/include/gpio.h
diff options
context:
space:
mode:
authorDaniel Leung <daniel.leung@intel.com>2016-01-29 13:51:57 -0800
committerAnas Nashif <anas.nashif@intel.com>2016-02-05 20:25:29 -0500
commitcae35e246028a0780e1a5560e2bda3fa87494ac8 (patch)
tree270ae61d00efeb0fb8b5d8c82b92735d2856690d /include/gpio.h
parent9c9ad646e12d40a7a3919bc69f61be03486ccf61 (diff)
gpio: allow pins to be enabled/disabled
Some GPIO controllers allow individual pins to be detached from the controller (i.e. the controller no longer affects the pin output, or can read its state). This adds the configuration bits to the API so this feature can be used by apps. Change-Id: I355fd5910a5439dcabe01ab40cd887dda30eab72 Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Diffstat (limited to 'include/gpio.h')
-rw-r--r--include/gpio.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h
index a967eaa28..26bcc2818 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -63,6 +63,14 @@ extern "C" {
#define GPIO_PUD_PULL_DOWN (2 << GPIO_PUD_POS)
#define GPIO_PUD_MASK (3 << GPIO_PUD_POS)
+/* Pin enable/disable
+ *
+ * Individual pins can be enabled or disabled
+ * if the controller supports this operation.
+ */
+#define GPIO_PIN_ENABLE (1 << 10)
+#define GPIO_PIN_DISABLE (1 << 11)
+
/* application callback function signature*/
typedef void (*gpio_callback_t)(struct device *port, uint32_t pin);