This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 Open Drain GPIO

nRF52840  SDK 15.2

I want to control the power of sensor, so I configurate the pin like this:

nrf_gpio_cfg(AFE4403_PIN_PWR_EN,
                 NRF_GPIO_PIN_DIR_OUTPUT,
                 NRF_GPIO_PIN_INPUT_DISCONNECT,
                 NRF_GPIO_PIN_NOPULL,
                 NRF_GPIO_PIN_S0D1,
                 NRF_GPIO_PIN_NOSENSE);

When I intended to power off the senser, code as below:

 nrf_gpio_pin_set(AFE4403_PIN_PWR_EN); // Power off senser

But I can't close the CMOS, means that measure the D pin of CMOS and voltage is not zero, equal VBat.

Measure the G pin of CMOS, the voltage equal 3.4V.

I don't understand where is my mistake about the code of configuration, could you help me?

Related