nRF51822: avoid leakage through GPIO

Hello, guys!

We are using nRF51822 SoC in our project. Some of the nRF51822 GPIOs should be dynamically reconfigured during runtime. For example, we want to set GPIO as output LOW for some time (e.g. 10ms), then make it float (physically disconnect) in order to avoid leakage current through GPIO.

Is it enough to just call

nrf_gpio_cfg_default(pin_number);

API when we want to physically disconnect GPIO from the external line and:

nrf_gpio_cfg_output(pin_number);
nrf_gpio_pin_clear(pin_number);

when we want to set the GPIO in a LOW state?

Thanks in advance for your time and efforts.

Sincerely,
Bojan.

Related