Browse Source

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>
pull/255/head
Daniel Leung 10 years ago committed by Anas Nashif
parent
commit
cae35e2460
  1. 8
      include/gpio.h

8
include/gpio.h

@ -63,6 +63,14 @@ extern "C" { @@ -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);

Loading…
Cancel
Save