Pull-up Resistors

Each I/O line is equipped with an embedded pull-up resistor. Pull-up resistors are used to ensure that inputs to I/O lines settle at expected levels, if external devices are disconnected or high-impedance.

A pull-up resistor can be enabled or disabled using a DlnGpioPortSetCfg() function.

To do this you must specify the corresponding handle and port values, as well as configure validFields, mask and config parameters.

In order to trigger pull up resistors, a user must set the fourth bit in a validFields parameter to 1 (you can use a DLN_GPIO_FIELDISPULLUPEN constant). This way the corresponding configuration field (isPullUpEnabled) becomes valid.

The mask parameter is used to define the pins, whose pull-up resistors must be triggered. Set the bits, corresponding to the pins that should be affected to 1.

The config parameter contains the DLN_GPIO_PORT_CONFIG structure, which is filled with new configuration values to be set. Its fifth field - isPullUpEnabled - triggers pull-up resistors and must be set to 0 or 1 in order to disable or enable them respectively.

A pull-up resistor can be enabled for a single pin using the DlnGpioPinPullupEnable() function and disabled using the DlnGpioPinPullupDisable(). In order to retrieve current state of the pull-up resistor, call the DlnGpioPinPullupIsEnabled().

By default all the pull-up resistors are enabled.