diff --git a/drivers/gpio/gpio_nrfx.c b/drivers/gpio/gpio_nrfx.c index d89c964cc90a8fb..9599eeb21d5fe83 100644 --- a/drivers/gpio/gpio_nrfx.c +++ b/drivers/gpio/gpio_nrfx.c @@ -79,6 +79,11 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, case NRF_GPIO_DRIVE_H0H1: drive = NRF_GPIO_PIN_H0H1; break; +#if defined(GPIO_PIN_CNF_DRIVE_E0E1) || defined(GPIO_PIN_CNF_DRIVE0_E0) + case NRF_GPIO_DRIVE_E0E1: + drive = NRF_GPIO_PIN_E0E1; + break; +#endif case NRF_GPIO_DRIVE_S0 | GPIO_OPEN_DRAIN: drive = NRF_GPIO_PIN_S0D1; break; diff --git a/include/zephyr/dt-bindings/gpio/nordic-nrf-gpio.h b/include/zephyr/dt-bindings/gpio/nordic-nrf-gpio.h index fe6c4cea45ab62f..46dc83bb72d9d0f 100644 --- a/include/zephyr/dt-bindings/gpio/nordic-nrf-gpio.h +++ b/include/zephyr/dt-bindings/gpio/nordic-nrf-gpio.h @@ -30,25 +30,30 @@ * The drive flags are encoded in the 8 upper bits of @ref gpio_dt_flags_t as * follows: * - * - Bit 8: Drive mode for '0' (0=Standard, 1=High) - * - Bit 9: Drive mode for '1' (0=Standard, 1=High) + * - Bits 8-9: Drive mode for '0' (0=Standard, 1=High, 2=Extra high, 3=reserved) + * - Bits 10-11: Drive mode for '1' (0=Standard, 1=High, 2=Extra high, 3=reserved) * * @{ */ /** @cond INTERNAL_HIDDEN */ /** Drive mode field mask */ -#define NRF_GPIO_DRIVE_MSK 0x0300U +#define NRF_GPIO_DRIVE_MSK 0x0F00U /** @endcond */ /** Standard drive for '0' (default, used with GPIO_OPEN_DRAIN) */ #define NRF_GPIO_DRIVE_S0 (0U << 8U) /** High drive for '0' (used with GPIO_OPEN_DRAIN) */ #define NRF_GPIO_DRIVE_H0 (1U << 8U) +/** Extra high drive for '0' */ +#define NRF_GPIO_DRIVE_E0 (2U << 8U) /** Standard drive for '1' (default, used with GPIO_OPEN_SOURCE) */ -#define NRF_GPIO_DRIVE_S1 (0U << 9U) +#define NRF_GPIO_DRIVE_S1 (0U << 10U) /** High drive for '1' (used with GPIO_OPEN_SOURCE) */ -#define NRF_GPIO_DRIVE_H1 (1U << 9U) +#define NRF_GPIO_DRIVE_H1 (1U << 10U) +/** Extra high drive for '1' */ +#define NRF_GPIO_DRIVE_E1 (2U << 10U) + /** Standard drive for '0' and '1' (default) */ #define NRF_GPIO_DRIVE_S0S1 (NRF_GPIO_DRIVE_S0 | NRF_GPIO_DRIVE_S1) /** Standard drive for '0' and high for '1' */ @@ -57,6 +62,8 @@ #define NRF_GPIO_DRIVE_H0S1 (NRF_GPIO_DRIVE_H0 | NRF_GPIO_DRIVE_S1) /** High drive for '0' and '1' */ #define NRF_GPIO_DRIVE_H0H1 (NRF_GPIO_DRIVE_H0 | NRF_GPIO_DRIVE_H1) +/** Extra high drive for '0' and '1' */ +#define NRF_GPIO_DRIVE_E0E1 (NRF_GPIO_DRIVE_E0 | NRF_GPIO_DRIVE_E1) /** @} */