Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

How to set the GPIO pin input to no pull or float mode

Hi,

I am using NCS for development and configuring GPIO pin as input, but I found the GPIO can't configuring as NO-PULL mode. There are only two options: Pull up and Pull Down.

I can find the option NRF_GPIO_PIN_NOPULL in the SDK "nrf5_SDK_for_Mesh_v5.0.0" nrf_gpio.h file.

So how can I to configuring the GPIO pin as input in NO-PULL mode or Float mode on the NCS?

Thanks a lot

Parents Reply
  • Hi,

    The code snippet you have here is from the implementation of dk_buttons_init() in nrf\lib\dk_buttons_and_leds\dk_buttons_and_leds.c, and the difference is that you have removed the flags that configure pull.

    In what way does this not work?

    Also, why do you want to remove pull from the input for this button handling code? Unless the input is always driven, which is typically not the case for buttons etc., then a pull resistor is needed. A floating input will cause problems.

Children
No Data
Related