Вы здесь

DlnGpioPinSetEventCfg() Function

The DlnGpioPinSetEventCfg() function configures when and which events should be generated for the specified pin. For more information, read Digital Input Events.

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

A handle to the DLN-series adapter.

pin

A number of the pin for which you want to configure the event generation.

eventType

Defines when the DLN adapter should generate pin events. The following values are available:

ValueDescription

0 or DLN_GPIO_EVENT_NONE

The DLN adapter does not generate any events.

1 or DLN_GPIO_EVENT_CHANGE

The DLN adapter generates events when the level on the digital input line changes. For details, read DLN_GPIO_EVENT_CHANGE Events

2 or DLN_GPIO_EVENT_LEVEL_HIGH

The DLN adapter generates events when the high level is present on the digital input line or after transition from low to high level. For details, read DLN_GPIO_EVENT_LEVEL_HIGH Events

3 or DLN_GPIO_EVENT_LEVEL_LOW

The DLN adapter generates events when the low level is present on the digital input line or after transition from high to low level. For details, read DLN_GPIO_EVENT_LEVEL_LOW Events

4 or DLN_GPIO_EVENT_ALWAYS

The DLN adapter generates events continuously, regardless of the level. For details, read DLN_GPIO_EVENT_ALWAYS Events

eventPeriod

Defines the interval in milliseconds (ms) at which the events occur.

Return Value
DLN_RES_SUCCESS (0x00)

The function configured event settings successfully.

DLN_RES_INVALID_PIN_NUMBER (0xAB)

The pin number is not valid. Use the DlnGpioGetPinCount() function to find the maximum possible pin number.

DLN_RES_INVALID_EVENT_TYPE (0xA9)

The specified event type is not valid. Use the DlnGpioPinGetSupportedEventTypes() function to check the event types supported for the pin.

DLN_RES_INVALID_EVENT_PERIOD (0xAC)

The specified event period is not valid.

Remarks
The DLN-1 adapters do not support GPIO events.

The DlnGpioPinSetEventCfg() function is declared in the dln_gpio.h file.

Языки

Вход на сайт