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>
This commit is contained in:
Daniel Leung 2016-01-29 13:51:57 -08:00 committed by Anas Nashif
commit cae35e2460

View file

@ -63,6 +63,14 @@ extern "C" {
#define GPIO_PUD_PULL_DOWN (2 << GPIO_PUD_POS) #define GPIO_PUD_PULL_DOWN (2 << GPIO_PUD_POS)
#define GPIO_PUD_MASK (3 << 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*/ /* application callback function signature*/
typedef void (*gpio_callback_t)(struct device *port, uint32_t pin); typedef void (*gpio_callback_t)(struct device *port, uint32_t pin);