Zephyr Project API  3.3.0
A Scalable Open Source RTOS
nordic-nrf-gpio.h File Reference

Go to the source code of this file.

Macros

nRF GPIO drive flags

nRF GPIO drive flags

Standard (S) or High (H) drive modes can be applied to both pin levels, 0 or

  1. High drive mode will increase current capabilities of the pin (refer to each SoC reference manual).

When the pin is configured to operate in open-drain mode (wired-and), the drive mode can only be selected for the 0 level (1 is disconnected). Similarly, when the pin is configured to operate in open-source mode (wired-or), the drive mode can only be set for the 1 level (0 is disconnected).

The drive flags are encoded in the 8 upper bits of 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)
#define NRF_GPIO_DRIVE_S0   (0U << 8U)
 
#define NRF_GPIO_DRIVE_H0   (1U << 8U)
 
#define NRF_GPIO_DRIVE_S1   (0U << 9U)
 
#define NRF_GPIO_DRIVE_H1   (1U << 9U)
 
#define NRF_GPIO_DRIVE_S0S1   (NRF_GPIO_DRIVE_S0 | NRF_GPIO_DRIVE_S1)
 
#define NRF_GPIO_DRIVE_S0H1   (NRF_GPIO_DRIVE_S0 | NRF_GPIO_DRIVE_H1)
 
#define NRF_GPIO_DRIVE_H0S1   (NRF_GPIO_DRIVE_H0 | NRF_GPIO_DRIVE_S1)
 
#define NRF_GPIO_DRIVE_H0H1   (NRF_GPIO_DRIVE_H0 | NRF_GPIO_DRIVE_H1)