DlnGpioPinSetEventCfg() Function

Syntax

C/C++
 DLN_RESULT DlnGpioPinSetEventCfg(
    HDLN handle,
    uint8_t pin,
    uint8_t eventType,
    uint16_t eventPeriod
 );     
     

The DlnGpioPinSetEventCfg() function configures the event generation conditions for the specified pin.

Parameters:

handle
A handle to the DLN-series adapter.
pin
A number of the pin to configure the event generation conditions for.
eventType

Defines the condition for event generation for the pin. The following values are available:

Value Description
0 or DLN_GPIO_EVENT_NONE No events are generated for the current pin.
1 or DLN_GPIO_EVENT_CHANGE Events are generated when the level on the digital input line changes.
2 or DLN_GPIO_EVENT_LEVEL_HIGH Events are generated when high level (logical 1) is detected on the digital input line.
3 or DLN_GPIO_EVENT_LEVEL_LOW Events are generated when low level (logical 1) is detected on the digital input line.
4 or DLN_GPIO_EVENT_LEVEL_ALWAYS Events are sent periodically with predefined repeat interval. The non-zero interval must be specified for this event type.

For more detailed information see GPIO Events

Results:

Result Description
DLN_RES_SUCCESS Event generation conditions were successfully configured.
DLN_RES_INVALID_PIN_NUMBER Invalid pin number was specified.
DLN_RES_INVALID_EVENT_TYPE Invalid event type was specified.
DLN_RES_INVALID_EVENT_PERIOD Invalid event period was specified.

This function is defined in the dln_gpio.h file.