nRF5 SDK is not maintained anymore
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
  • Hi,

    Pull is configured by writing to the PULL field in the PIN_CNF register for a specific pin. If this field is 0, which is default, pull is disabled. So by default there is no need to do anything. If you have configured a pull, and want to disable it again, write 0 to this field.

    Using Zephyr APIs, this means that to avoid using any pull, simply do not configure either pull up or pull down.

Reply
  • Hi,

    Pull is configured by writing to the PULL field in the PIN_CNF register for a specific pin. If this field is 0, which is default, pull is disabled. So by default there is no need to do anything. If you have configured a pull, and want to disable it again, write 0 to this field.

    Using Zephyr APIs, this means that to avoid using any pull, simply do not configure either pull up or pull down.

Children
Related