Вы здесь

DlnAdcChannelGetCfg() Function

The DlnAdcChannelGetCfg() function retrieves the current configuration settings of a single ADC channel.

This function is defined in the dln_adc.h file.

Syntax
C/C++
DLN_RESULT DlnAdcChannelGetCfg(
    HDLN handle,
    uint8_t port, 
    uint8_t channel,
    uint8_t* eventType,
    uint16_t* eventPeriod,
    uint16_t* thresholdLow,
    uint16_t* thresholdHigh
 );
Parameters
handle

A handle to the DLN-series adapter.

port

A number of the ADC port to retrieve the information from.

channel

A number of the ADC channel to retrieve the information from.

eventType

A pointer to an unsigned 8-bit integer. The integer will be filled the currently set event generation condition for the ADC channel after the function execution. The following values are available:

ValueDescription

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 threshold.

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

A pointer to an unsigned 16-bit integer. The integer will be filled with the repeat interval for DLN_ADC_CONDITION_MET_EV event generation on the pin after the function execution. 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

A pointer to an unsigned 16-bit integer. The integer will be filled with the lower voltage threshold value, specified in bits, after the function execution.

thresholdHigh

A pointer to an unsigned 16-bit integer. The integer will be filled with the higher voltage threshold value, specified in bits, after the function execution.

Return Value
DLN_RES_SUCCESS

Function was successfully executed.

Языки

Вход на сайт