diff --git a/include/dt-bindings/gpio/gpio.h b/include/dt-bindings/gpio/gpio.h index e0ea0e71d1b..10cb8660d29 100644 --- a/include/dt-bindings/gpio/gpio.h +++ b/include/dt-bindings/gpio/gpio.h @@ -76,6 +76,32 @@ /** @} */ +/** + * @name GPIO pin voltage flags + * + * The voltage flags are a Zephyr specific extension of the standard GPIO + * flags specified by the Linux GPIO binding. Only applicable if SoC allows + * to configure pin voltage per individual pin. + * + * @{ + */ + +/** @cond INTERNAL_HIDDEN */ +#define GPIO_VOLTAGE_POS 6 +#define GPIO_VOLTAGE_MASK (3U << GPIO_VOLTAGE_POS) +/** @endcond */ + +/** Set pin at the default voltage level */ +#define GPIO_VOLTAGE_DEFAULT (0U << GPIO_VOLTAGE_POS) +/** Set pin voltage level at 1.8 V */ +#define GPIO_VOLTAGE_1P8 (1U << GPIO_VOLTAGE_POS) +/** Set pin voltage level at 3.3 V */ +#define GPIO_VOLTAGE_3P3 (2U << GPIO_VOLTAGE_POS) +/** Set pin voltage level at 5.0 V */ +#define GPIO_VOLTAGE_5P0 (3U << GPIO_VOLTAGE_POS) + +/** @} */ + /** * @} */