diff options
-rw-r--r-- | include/gpio.h | 24 | ||||
-rw-r--r-- | zephyr/include/dt-bindings/gpio_defines.h | 30 |
2 files changed, 25 insertions, 29 deletions
diff --git a/include/gpio.h b/include/gpio.h index d57d6417ab..c6ff3e049f 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -29,28 +29,28 @@ * Validate that these definitions haven't changed. */ /* Validate that Zephyr's definition are the same for overlapping defines */ -#if BIT(8) != GPIO_INPUT +#if BIT(16) != GPIO_INPUT #error GPIO_INPUT values are not the same! -#elif BIT(9) != GPIO_OUTPUT +#elif BIT(17) != GPIO_OUTPUT #error GPIO_OUTPUT values are not the same! -#elif BIT(10) != GPIO_OUTPUT_INIT_LOW +#elif BIT(18) != GPIO_OUTPUT_INIT_LOW #error GPIO_OUTPUT_INIT_LOW values are not the same! -#elif BIT(11) != GPIO_OUTPUT_INIT_HIGH +#elif BIT(19) != GPIO_OUTPUT_INIT_HIGH #error GPIO_OUTPUT_INIT_HIGH values are not the same! -#elif BIT(13) != GPIO_INT_DISABLE +#elif BIT(20) != GPIO_OUTPUT_INIT_LOGICAL +#error GPIO_OUTPUT_INIT_LOGICAL values are not the same! +#elif BIT(21) != GPIO_INT_DISABLE #error GPIO_INT_DISABLE values are not the same! -#elif BIT(14) != GPIO_INT_ENABLE +#elif BIT(22) != GPIO_INT_ENABLE #error GPIO_INT_ENABLE values are not the same! -#elif BIT(15) != GPIO_INT_LEVELS_LOGICAL +#elif BIT(23) != GPIO_INT_LEVELS_LOGICAL #error GPIO_INT_LEVELS_LOGICAL values are not the same! -#elif BIT(16) != GPIO_INT_EDGE +#elif BIT(24) != GPIO_INT_EDGE #error GPIO_INT_EDGE values are not the same! -#elif BIT(17) != GPIO_INT_LOW_0 +#elif BIT(25) != GPIO_INT_LOW_0 #error GPIO_INT_LOW_0 values are not the same! -#elif BIT(18) != GPIO_INT_HIGH_1 +#elif BIT(26) != GPIO_INT_HIGH_1 #error GPIO_INT_HIGH_1 values are not the same! -#elif BIT(19) != GPIO_INT_DEBOUNCE -#error GPIO_INT_DEBOUNCE values are not the same! #endif /* diff --git a/zephyr/include/dt-bindings/gpio_defines.h b/zephyr/include/dt-bindings/gpio_defines.h index cc73dd6382..5b04189a9f 100644 --- a/zephyr/include/dt-bindings/gpio_defines.h +++ b/zephyr/include/dt-bindings/gpio_defines.h @@ -21,16 +21,19 @@ */ /** Enables pin as input. */ -#define GPIO_INPUT (1U << 8) +#define GPIO_INPUT (1U << 16) /** Enables pin as output, no change to the output state. */ -#define GPIO_OUTPUT (1U << 9) +#define GPIO_OUTPUT (1U << 17) /* Initializes output to a low state. */ -#define GPIO_OUTPUT_INIT_LOW (1U << 10) +#define GPIO_OUTPUT_INIT_LOW (1U << 18) /* Initializes output to a high state. */ -#define GPIO_OUTPUT_INIT_HIGH (1U << 11) +#define GPIO_OUTPUT_INIT_HIGH (1U << 19) + +/* Initializes output based on logic level */ +#define GPIO_OUTPUT_INIT_LOGICAL (1U << 20) /* Configures GPIO pin as output and initializes it to a low state. */ #define GPIO_OUTPUT_LOW (GPIO_OUTPUT | GPIO_OUTPUT_INIT_LOW) @@ -58,17 +61,17 @@ */ /** Disables GPIO pin interrupt. */ -#define GPIO_INT_DISABLE (1U << 13) +#define GPIO_INT_DISABLE (1U << 21) /* Enables GPIO pin interrupt. */ -#define GPIO_INT_ENABLE (1U << 14) +#define GPIO_INT_ENABLE (1U << 22) /* GPIO interrupt is sensitive to logical levels. * * This is a component flag that should be combined with other * `GPIO_INT_*` flags to produce a meaningful configuration. */ -#define GPIO_INT_LEVELS_LOGICAL (1U << 15) +#define GPIO_INT_LEVELS_LOGICAL (1U << 23) /* GPIO interrupt is edge sensitive. * @@ -77,7 +80,7 @@ * This is a component flag that should be combined with other * `GPIO_INT_*` flags to produce a meaningful configuration. */ -#define GPIO_INT_EDGE (1U << 16) +#define GPIO_INT_EDGE (1U << 24) /* Trigger detection when input state is (or transitions to) physical low or * logical 0 level. @@ -85,7 +88,7 @@ * This is a component flag that should be combined with other * `GPIO_INT_*` flags to produce a meaningful configuration. */ -#define GPIO_INT_LOW_0 (1U << 17) +#define GPIO_INT_LOW_0 (1U << 25) /* Trigger detection on input state is (or transitions to) physical high or * logical 1 level. @@ -93,7 +96,7 @@ * This is a component flag that should be combined with other * `GPIO_INT_*` flags to produce a meaningful configuration. */ -#define GPIO_INT_HIGH_1 (1U << 18) +#define GPIO_INT_HIGH_1 (1U << 26) /** Configures GPIO interrupt to be triggered on pin rising edge and enables it. */ @@ -158,11 +161,4 @@ GPIO_INT_LEVELS_LOGICAL | \ GPIO_INT_HIGH_1) -/** Enable GPIO pin debounce. - * - * @note Drivers that do not support a debounce feature should ignore - * this flag rather than rejecting the configuration with -ENOTSUP. - */ -#define GPIO_INT_DEBOUNCE (1U << 19) - #endif /* DT_BINDINGS_GPIO_DEFINES_H_ */ |