Use the GPIO Interface functions to control and monitor the GPIO module of a DLN-series adapter.
General pin information:
Retrieves the number of pins that can be assigned to the GPIO module.
Assigns a pin to the GPIO module.
Unassigns a pin from the GPIO module.
Retrieves whether a pin is connected to the GPIO module.
Configures a pin as a digital input or output.
Retrieves whether a pin is configured as a digital input or output.
Defines a value on the output pin.
Retrieves the output value configured to the pin.
Retrieves the actual value on the I/O line.
Event functions:
Configures event generation for a pin.
Retrieves event generation configuration for a pin.
Returns the list of the event types available for a pin.
Debounce filter functions:
Enables the Debounce Filter on a pin.
Disables the Debounce Filter on a pin
Determines whether the Debounce Filter is enabled on a pin.
Configures the debounce interval (the minimum duration of pulses to be registered).
Retrieves the debounce interval value.
Open Drain mode functions:
Enables the Open Drain mode on a pin.
Disables the Open Drain mode on a pin.
Determines whether the Open Drain mode in enabled on a pin.
Pull-up/Pull-down resistors functions:
Enables the pull-up resistor on a pin.
Enables the pull-down resistor on a pin.
Disables the pull-up resistor on a pin.
Disables the pull-down resistor on a pin.
Determines whether the pull-up resistor is enabled on a pin.
Determines whether the pull-down resistor is enabled on a pin.
The dln_gpio.h
file declares the GPIO Interface functions.
The DlnGpioGetPinCount()
function retrieves the total number of GPIO pins available in the DLN-series adapter.
The DlnGpioPinEnable()
function connects a pin to the GPIO module.
The DlnGpioPinDisable()
function disconnects a pin from the GPIO module. Then, another module can use the pin.
The DlnGpioPinIsEnabled()
function informs whether the GPIO module currently uses the pin.
The DlnGpioPinSetDirection()
function configures a pin as an input or as an output.
The DlnGpioPinGetDirection()
function retrieves current direction of a GPIO pin.
The DlnGpioPinGetVal()
function retrieves the current value on the specified GPIO pin.
The DlnGpioPinSetOutVal()
function sets the output value for the specified GPIO pin.
The DlnGpioPinGetOutVal()
function retrieves the pin output value.
The DlnGpioPinSetEventCfg()
function configures when and which events should be generated for the specified pin. For more information, read Digital Input Events.
The DlnGpioPinGetEventCfg()
function retrieves the current event configuration for the specified pin. For more information, read Digital Input Events.
The DlnGpioPinGetSupportedEventTypes()
function returns all event types supported for the specified pin.
The DlnGpioPinDebounceEnable()
function enables Debounce Filter for the specified pin.
The DlnGpioPinDebounceDisable()
disables Debounce Filter for the specified pin.
The DlnGpioPinDebounceIsEnabled()
function informs whether the Debounce Filter is currently enabled for the specified pin.
The DlnGpioSetDebounce()
function specifies the debounce interval (the minimum duration of pulses to be registered). See Debounce Filter for details.
The DlnGpioGetDebounce()
function retrieves the current value of the debounce interval (the minimum duration of the pulse to be registered). See Debounce Filter for details.
The DlnGpioPinOpendrainEnable()
function enables Open Drain Mode for the specified pin.
The DlnGpioPinOpendrainDisable()
disables Open Drain Mode for the specified pin.
The DlnGpioPinOpendrainIsEnabled()
function informs whether the pin output is currently configured as push-pull or Open Drain.
The DlnGpioPinPullupEnable()
function activates an embedded pull-up resistor for the specified pin. For more information, read Pull-up/Pull-down Resistors.
The DlnGpioPinPullupDisable()
deactivates an embedded pull-up resistor for the specified pin. For more information, read Pull-up/Pull-down Resistors.
The DlnGpioPinPullupIsEnabled()
function informs whether an embedded pull-up resistor is currently enabled for the specified pin.
The DlnGpioPinPulldownEnable()
function activates an embedded pull-down resistor for the specified pin. For more information, read Pull-up/Pull-down Resistors.
The DlnGpioPinPulldownDisable()
function deactivates an embedded pull-down resistor for the specified pin.
The DlnGpioPinPulldownIsEnabled()
function informs whether an embedded pull-down resistor is active for the specified pin.
The DlnGpioPinSetCfg()
function changes the configuration of a single GPIO pin. It allows customizing the following:
Define the pin direction (input or output).
Enable or disable the open drain, pull up resistor and/or debounce filter.
Define the output value.
Define input event parameters.
With this function, you can either reconfigure the pin entirely or change only some of its parameters.
The DlnGpioPinGetCfg()
function retrieves the current configuration of the specified GPIO pin.