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.
Call the DlnGpioPinPullupEnable() function to enable the pull-up resistor. It can be disabled by using the DlnGpioPinPullupDisable() function.
To enable a pull-down resistor, use the DlnGpioPinPulldownEnable() function. To disable it, use the DlnGpioPinPulldownDisable() function.
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:
- DlnGpioPinPullupEnable()
Enables the pull-up resistor on a pin.
- DlnGpioPinPullupDisable()
Disables the pull-up resistor on a pin.
- DlnGpioPinPullupIsEnabled()
Determines whether the pull-up resistor is enabled on a pin.
Use the following GPIO Interface functions to control and monitor pull-down resistors:
- DlnGpioPinPulldownEnable()
Enables the pull-down resistor on a pin.
- DlnGpioPinPulldownDisable()
Disables the pull-down resistor on a pin.
- DlnGpioPinPulldownIsEnabled()
Determines whether the pull-down resistor is enabled on a pin.