Вы здесь

DlnGpioSetDebounce() Function

The DlnGpioSetDebounce() function specifies the debounce interval (the minimum duration of pulses to be registered). See Debounce Filter for details.

Syntax
C/C++
DLN_RESULT DlnGpioSetDebounce(
   HDLN handle, 
   uint32_t* duration
);
Parameters
handle

A handle to the DLN-series adapter.

duration

A pointer to an unsigned 32-bit integer. After the function execution, this integer is set to the debounce duration, rounded up to the nearest value supported by the adapter. See Debounce Filter for details.

Return Value
DLN_RES_SUCCESS (0x00)

The function specified the debounce interval successfully.

DLN_RES_COMMAND_NOT_SUPPORTED (0x91)

The adapter does not support debounce filtering.

Remarks

The specified debounce interval is actual for all pins where the debounce filter is enabled. This value should be specified in microseconds (µs): from 1µs up to 4,294,967,295µs (~1h 10m). If a DLN-series adapter does not support the specified value, it rounds it up to the nearest supported value.

The default value of the debounce interval depends on the DLN adapter. Once you call the DlnGpioSetDebounce() function and specify the debounce interval value, you change the default value. If the debounce filter is disabled for a pin or a pin is not assigned to the GPIO module, this value will be applied when the pin is assigned to the GPIO module with the debounce filter enabled.

DLN-1 and DLN-2 adapters do not support the debounce filter feature.

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

Языки

Вход на сайт