diff options
Diffstat (limited to 'include/gpio.h')
-rw-r--r-- | include/gpio.h | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/include/gpio.h b/include/gpio.h index 341727ce73..16d0086d5e 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -22,17 +22,35 @@ #ifdef CONFIG_ZEPHYR #include <drivers/gpio.h> +/* + * Some flag definitions are duplicated by our private devicetree binding + * in zephyr/include/dt-bindings/gpio_defines.h. + * + * Validate that these definitions haven't changed. + */ /* Validate that Zephyr's definition are the same for overlapping defines */ -#if GPIO_OPEN_DRAIN != (BIT(1) | BIT(2)) -#error GPIO_OPEN_DRAIN values are not the same! -#elif GPIO_PULL_UP != BIT(4) -#error GPIO_PULL_UP values are not the same! -#elif GPIO_PULL_DOWN != BIT(5) -#error GPIO_PULL_DOWN values are not the same! -#elif GPIO_INPUT != BIT(8) +#if BIT(8) != GPIO_INPUT #error GPIO_INPUT values are not the same! -#elif GPIO_OUTPUT != BIT(9) +#elif BIT(9) != GPIO_OUTPUT #error GPIO_OUTPUT values are not the same! +#elif BIT(10) != GPIO_OUTPUT_INIT_LOW +#error GPIO_OUTPUT_INIT_LOW values are not the same! +#elif BIT(11) != GPIO_OUTPUT_INIT_HIGH +#error GPIO_OUTPUT_INIT_HIGH values are not the same! +#elif BIT(13) != GPIO_INT_DISABLE +#error GPIO_INT_DISABLE values are not the same! +#elif BIT(14) != GPIO_INT_ENABLE +#error GPIO_INT_ENABLE values are not the same! +#elif BIT(15) != GPIO_INT_LEVELS_LOGICAL +#error GPIO_INT_LEVELS_LOGICAL values are not the same! +#elif BIT(16) != GPIO_INT_EDGE +#error GPIO_INT_EDGE values are not the same! +#elif BIT(17) != GPIO_INT_LOW_0 +#error GPIO_INT_LOW_0 values are not the same! +#elif BIT(18) != 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 /* Otherwise define overlapping GPIO_ flags ourselves */ |