DlnAdcChannelSetCfg() Function
Syntax
- C/C++
-
DLN_RESULT DlnAdcChannelSetCfg( HDLN handle, uint8_t port, uint8_t channel, uint8_t eventType, uint16_t eventPeriod, uint16_t thresholdLow, uint16_t thresholdHigh );
The DlnAdcChannelSetCfg() function changes the configuration of a single GPIO pin and set the conditions of DLN_ADC_CONDITION_MET_EV event generation.
Parameters:
- handle
- A handle to the DLN-series adapter.
- port
- A number of the ADC port to be configured.
- channel
- A number of the ADC channel to be configured.
- eventType
-
Must contain the event generation condition for the ADC channel. The following values are available:
Value Description 0 or DLN_ADC_EVENT_NONE No events are generated for the current channel. 1 or DLN_ADC_EVENT_BELOW Events are generated when voltage level on the ADC channel crosses the lower threshhold. 2 or DLN_ADC_EVENT_LEVEL_ABOVE Events are generated when voltage level on the ADC channel crosses the higher threshold. 3 or DLN_ADC_EVENT_OUTSIDE Events are generated when voltage level on the ADC channel falls outside of the specified range between thresholds. 4 or DLN_ADC_EVENT_INSIDE Events are generated when voltage level on the ADC channel falls within the specified range between thresholds. 5 or DLN_ADC_EVENT_ALWAYS Events are sent periodically with predefined repeat interval. The non-zero interval must be specified for this event type. - eventPeriod
- Must contain the repeat interval for DLN_ADC_CONDITION_MET_EV event generation on the pin. The repeat interval is set in ms (1 to 65,535ms). If the repeat interval is set to 0, the DLN-series adapter will send a single event when the level on the line changes to meet the specified conditions.
- thresholdLow
- The lower threshold value, specified in bits.
- thresholdHigh
- The higher threshold value specified in bits.
Results:
| Result | Description |
|---|---|
| DLN_RES_SUCCESS | Function was succesfully executed. |
This function is defined in the dln_adc.h file.
2006-2012