Most I/O lines are equipped with an embedded pull-up resistor. A pull-up resistor has one end connected to the positive voltage and the other end connected to an input. The pull-up resistor ensures that the level on the input is high (logic 1) when no external device is connected. If an external device is connected and outputs 0, the input detects logic 0.
A pull-down resistor works the similar way, but it is connected to ground and the logic 0 is present on the line when no external device is connected.
Pull-up and pull-down resistors can be enabled/disabled on each input pin individually.
You cannot simultaneously enable pull-up and pull-down resistors for the same pin.
If a pin is not assigned to the GPIO module, your settings are saved in the internal memory and will be applied when you assign the pin to the GPIO module.
By default, pull-up resistors are enabled for all pins. The pull-down resisters are disabled by default.
Use the following GPIO Interface functions to control and monitor pull-up resistors:
Enables the pull-up resistor on a pin.
Disables the pull-up resistor on a pin.
Determines whether the pull-up resistor is enabled on a pin.
Use the following GPIO Interface functions to control and monitor pull-down resistors: