CCAux  2.20.0.0
CCAux API reference
Functions
Adc functions

Functions

EXTERN_C CCAUXDLL_API ADCHANDLE CCAUXDLL_CALLING_CONV GetAdc (void)
 
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Adc_release (ADCHANDLE)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Adc_getVoltage (ADCHANDLE, VoltageEnum selection, float64_t *value)
 

Detailed Description

Functions in the Adc class

Function Documentation

◆ Adc_getVoltage()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Adc_getVoltage ( ADCHANDLE  ,
VoltageEnum  selection,
float64_t value 
)

Read measured voltage.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
selectionThe type of voltage to get.
valueVoltage value in Volt. Can be undefined if return value is error code. Not all values are supported on all platforms, ERR_NOT_SUPPORTED will indicate that.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Adc_getVoltage(pAdc, selection, &voltage);
{
cout << left << setw(7) << description << ": " << fixed << setprecision(2) << voltage << "V" << endl;
}
{
/* Don't print anything */
}
else
{
cout << left << setw(7) << description << ": " << fixed << setprecision(2) << CrossControl::GetErrorStringA(err)
<< endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Adc_getVoltage(ADCHANDLE, VoltageEnum selection, float64_t *value)
EXTERN_C CCAUXDLL_API char_t const *CCAUXDLL_CALLING_CONV GetErrorStringA(eErr errCode)
@ ERR_SUCCESS
Definition: CCAuxTypes.h:163
@ ERR_NOT_SUPPORTED
Definition: CCAuxTypes.h:165

◆ Adc_release()

EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV CrossControl::Adc_release ( ADCHANDLE  )

Delete the ADC object.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Returns
-

Example Usage:

ADCHANDLE pAdc = ::GetAdc();
assert(pAdc);
output_voltage(pAdc, "24VIN", CrossControl::VOLTAGE_24VIN);
output_voltage(pAdc, "24V", CrossControl::VOLTAGE_24V);
output_voltage(pAdc, "12V", CrossControl::VOLTAGE_12V);
output_voltage(pAdc, "12VID", CrossControl::VOLTAGE_12VID);
output_voltage(pAdc, "5V", CrossControl::VOLTAGE_5V);
output_voltage(pAdc, "3V3", CrossControl::VOLTAGE_3V3);
output_voltage(pAdc, "VTFT", CrossControl::VOLTAGE_VTFT);
output_voltage(pAdc, "5VSTB", CrossControl::VOLTAGE_5VSTB);
output_voltage(pAdc, "1V9", CrossControl::VOLTAGE_1V9);
output_voltage(pAdc, "1V8", CrossControl::VOLTAGE_1V8);
output_voltage(pAdc, "1V5", CrossControl::VOLTAGE_1V5);
output_voltage(pAdc, "1V2", CrossControl::VOLTAGE_1V2);
output_voltage(pAdc, "1V05", CrossControl::VOLTAGE_1V05);
output_voltage(pAdc, "1V0", CrossControl::VOLTAGE_1V0);
output_voltage(pAdc, "0V9", CrossControl::VOLTAGE_0V9);
output_voltage(pAdc, "VREF_INT", CrossControl::VOLTAGE_VREF_INT);
output_voltage(pAdc, "24V_BACKUP", CrossControl::VOLTAGE_24V_BACKUP);
output_voltage(pAdc, "2V5", CrossControl::VOLTAGE_2V5);
output_voltage(pAdc, "1V1", CrossControl::VOLTAGE_1V1);
output_voltage(pAdc, "1V3_PER", CrossControl::VOLTAGE_1V3_PER);
output_voltage(pAdc, "1V3_VDDA", CrossControl::VOLTAGE_1V3_VDDA);
output_voltage(pAdc, "3V3 STBY", CrossControl::VOLTAGE_3V3STBY);
output_voltage(pAdc, "VPMIC", CrossControl::VOLTAGE_VPMIC);
output_voltage(pAdc, "VMAIN", CrossControl::VOLTAGE_VMAIN);
output_voltage(pAdc, "AI_1", CrossControl::VOLTAGE_AI_1);
output_voltage(pAdc, "AI_2", CrossControl::VOLTAGE_AI_2);
output_voltage(pAdc, "AI_3", CrossControl::VOLTAGE_AI_3);
Adc_release(pAdc);
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Adc_release(ADCHANDLE)
EXTERN_C CCAUXDLL_API ADCHANDLE CCAUXDLL_CALLING_CONV GetAdc(void)
@ VOLTAGE_2V5
Definition: CCAuxTypes.h:105
@ VOLTAGE_5VSTB
Definition: CCAuxTypes.h:95
@ VOLTAGE_12V
Definition: CCAuxTypes.h:90
@ VOLTAGE_3V3STBY
Definition: CCAuxTypes.h:109
@ VOLTAGE_1V05
Definition: CCAuxTypes.h:100
@ VOLTAGE_1V2
Definition: CCAuxTypes.h:99
@ VOLTAGE_AI_1
Definition: CCAuxTypes.h:113
@ VOLTAGE_1V5
Definition: CCAuxTypes.h:98
@ VOLTAGE_24V
Definition: CCAuxTypes.h:89
@ VOLTAGE_1V3_PER
Definition: CCAuxTypes.h:107
@ VOLTAGE_AI_3
Definition: CCAuxTypes.h:115
@ VOLTAGE_1V8
Definition: CCAuxTypes.h:97
@ VOLTAGE_VMAIN
Definition: CCAuxTypes.h:111
@ VOLTAGE_VTFT
Definition: CCAuxTypes.h:94
@ VOLTAGE_5V
Definition: CCAuxTypes.h:92
@ VOLTAGE_24V_BACKUP
Definition: CCAuxTypes.h:104
@ VOLTAGE_1V9
Definition: CCAuxTypes.h:96
@ VOLTAGE_AI_2
Definition: CCAuxTypes.h:114
@ VOLTAGE_VREF_INT
Definition: CCAuxTypes.h:103
@ VOLTAGE_0V9
Definition: CCAuxTypes.h:102
@ VOLTAGE_24VIN
Definition: CCAuxTypes.h:88
@ VOLTAGE_3V3
Definition: CCAuxTypes.h:93
@ VOLTAGE_VPMIC
Definition: CCAuxTypes.h:110
@ VOLTAGE_1V1
Definition: CCAuxTypes.h:106
@ VOLTAGE_1V0
Definition: CCAuxTypes.h:101
@ VOLTAGE_1V3_VDDA
Definition: CCAuxTypes.h:108
@ VOLTAGE_12VID
Definition: CCAuxTypes.h:91
void * ADCHANDLE
Definition: Adc.h:34

◆ GetAdc()

EXTERN_C CCAUXDLL_API ADCHANDLE CCAUXDLL_CALLING_CONV CrossControl::GetAdc ( void  )

Factory function that creates instances of the Adc object.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Returns
ADCHANDLE to an allocated Adc object. The returned handle needs to be deallocated using the Adc_release(ADCHANDLE) method when it's no longer needed.

Returns NULL if it fails to allocate memory.

Example Usage:

ADCHANDLE pAdc = ::GetAdc();
assert(pAdc);
output_voltage(pAdc, "24VIN", CrossControl::VOLTAGE_24VIN);
output_voltage(pAdc, "24V", CrossControl::VOLTAGE_24V);
output_voltage(pAdc, "12V", CrossControl::VOLTAGE_12V);
output_voltage(pAdc, "12VID", CrossControl::VOLTAGE_12VID);
output_voltage(pAdc, "5V", CrossControl::VOLTAGE_5V);
output_voltage(pAdc, "3V3", CrossControl::VOLTAGE_3V3);
output_voltage(pAdc, "VTFT", CrossControl::VOLTAGE_VTFT);
output_voltage(pAdc, "5VSTB", CrossControl::VOLTAGE_5VSTB);
output_voltage(pAdc, "1V9", CrossControl::VOLTAGE_1V9);
output_voltage(pAdc, "1V8", CrossControl::VOLTAGE_1V8);
output_voltage(pAdc, "1V5", CrossControl::VOLTAGE_1V5);
output_voltage(pAdc, "1V2", CrossControl::VOLTAGE_1V2);
output_voltage(pAdc, "1V05", CrossControl::VOLTAGE_1V05);
output_voltage(pAdc, "1V0", CrossControl::VOLTAGE_1V0);
output_voltage(pAdc, "0V9", CrossControl::VOLTAGE_0V9);
output_voltage(pAdc, "VREF_INT", CrossControl::VOLTAGE_VREF_INT);
output_voltage(pAdc, "24V_BACKUP", CrossControl::VOLTAGE_24V_BACKUP);
output_voltage(pAdc, "2V5", CrossControl::VOLTAGE_2V5);
output_voltage(pAdc, "1V1", CrossControl::VOLTAGE_1V1);
output_voltage(pAdc, "1V3_PER", CrossControl::VOLTAGE_1V3_PER);
output_voltage(pAdc, "1V3_VDDA", CrossControl::VOLTAGE_1V3_VDDA);
output_voltage(pAdc, "3V3 STBY", CrossControl::VOLTAGE_3V3STBY);
output_voltage(pAdc, "VPMIC", CrossControl::VOLTAGE_VPMIC);
output_voltage(pAdc, "VMAIN", CrossControl::VOLTAGE_VMAIN);
output_voltage(pAdc, "AI_1", CrossControl::VOLTAGE_AI_1);
output_voltage(pAdc, "AI_2", CrossControl::VOLTAGE_AI_2);
output_voltage(pAdc, "AI_3", CrossControl::VOLTAGE_AI_3);
Adc_release(pAdc);