iLLD_TC27xD  1.0
Module Functions
Collaboration diagram for Module Functions:

Functions

IFX_INLINE void IfxVadc_Adc_deInitModule (IfxVadc_Adc *vadc)
 Reset the VADC module. More...
 
IFX_INLINE void IfxVadc_Adc_getModuleConfig (IfxVadc_Adc *vadc, IfxVadc_Adc_Config *config)
 Get the current VADC configuration (e.g. VADC frequency) More...
 
IFX_INLINE Ifx_VADC_RES IfxVadc_Adc_getResultBasedOnRequestSource (IfxVadc_Adc_Group *group, IfxVadc_ChannelId channel, IfxVadc_RequestSource sourceType)
 Get conversion result based on the Request Source. (Function does not care about the alignment) value = raw * gain + offset. More...
 
IFX_EXTERN void IfxVadc_Adc_disableModule (Ifx_VADC *vadc)
 Disable VADC Module. More...
 
IFX_EXTERN IfxVadc_Status IfxVadc_Adc_initModule (IfxVadc_Adc *vadc, const IfxVadc_Adc_Config *config)
 Initialise the VADC to run with the expected frequency and calibration. More...
 
IFX_EXTERN void IfxVadc_Adc_initModuleConfig (IfxVadc_Adc_Config *config, Ifx_VADC *vadc)
 Initialise buffer with default VADC configuration. More...
 

Detailed Description

Function Documentation

IFX_INLINE void IfxVadc_Adc_deInitModule ( IfxVadc_Adc vadc)

Reset the VADC module.

Parameters
vadcpointer to the VADC module
Returns
None

Example Usage :How to use the VADC ADC Interface driver?

Definition at line 1175 of file IfxVadc_Adc.h.

IFX_EXTERN void IfxVadc_Adc_disableModule ( Ifx_VADC *  vadc)

Disable VADC Module.

Parameters
vadcPointer to VADC Module
Returns
None

Definition at line 128 of file IfxVadc_Adc.c.

IFX_INLINE void IfxVadc_Adc_getModuleConfig ( IfxVadc_Adc vadc,
IfxVadc_Adc_Config config 
)

Get the current VADC configuration (e.g. VADC frequency)

Parameters
vadcpointer to the VADC module
configpointer to the VADC module configuration
Returns
None

Example Usage :How to use the VADC ADC Interface driver?

Definition at line 1207 of file IfxVadc_Adc.h.

IFX_INLINE Ifx_VADC_RES IfxVadc_Adc_getResultBasedOnRequestSource ( IfxVadc_Adc_Group group,
IfxVadc_ChannelId  channel,
IfxVadc_RequestSource  sourceType 
)

Get conversion result based on the Request Source. (Function does not care about the alignment) value = raw * gain + offset.

Parameters
grouppointer to the VADC group
channelchannel number
sourceTypetype of request source
Returns
scaled Conversion result
// create configuration
IfxVadc_Adc_initModuleConfig(&adcConfig, &MODULE_VADC);
// initialize module
IfxVadc_Adc_initModule(&vadc, &adcConfig);
// create group config
IfxVadc_Adc_GroupConfig adcGroupConfig;
IfxVadc_Adc_initGroupConfig(&adcGroupConfig, &vadc);
// change group (default is GroupId0, change to GroupId2)
adcGroupConfig.groupId = IfxVadc_GroupId2;
adcGroupConfig.master = adcGroupConfig.groupId;
// enable gate in "always" mode (no edge detection)
// enable auto scan
adcGroupConfig.scanRequest.autoscanEnabled = TRUE;
// initialize the group
IfxVadc_Adc_initGroup(&adcGroup, &adcGroupConfig);
// create channel config
IfxVadc_Adc_ChannelConfig adcChannelConfig;
IfxVadc_Adc_initChannelConfig(&adcChannelConfig, &adcGroup);
// change channel (default is ChannelId0, change to ChannelId2)
adcChannelConfig.channelId = IfxVadc_ChannelId2;
// initialize the channel
IfxVadc_Adc_initChannel(&adcChannel, &adcChannelConfig);
uint32 channels = (1 << 2); // enable channel #2
uint32 mask = (1 << 7) | (1 << 2); // modify the selection for channel #7 and #2; channel #7 will be disabled
// configure wait for read mode
// configure scan
IfxVadc_Adc_setScan(&adcGroup, channels, mask);
// start the scan
// wait for valid result
Ifx_VADC_RES resultChannel;
do {
resultChannel = IfxVadc_Adc_getResultBasedOnRequestSource(&adcGroup, IfxVadc_ChannelId2, IfxVadc_RequestSource_scan);
} while( !resultChannel.B.VF );

Definition at line 1233 of file IfxVadc_Adc.h.

IFX_EXTERN IfxVadc_Status IfxVadc_Adc_initModule ( IfxVadc_Adc vadc,
const IfxVadc_Adc_Config config 
)

Initialise the VADC to run with the expected frequency and calibration.

Parameters
vadcpointer to the VADC handle
configpointer to the VADC configuration
Returns
IfxVadc_Status

For coding example see: How to use the VADC ADC Interface driver?

Definition at line 716 of file IfxVadc_Adc.c.

IFX_EXTERN void IfxVadc_Adc_initModuleConfig ( IfxVadc_Adc_Config config,
Ifx_VADC *  vadc 
)

Initialise buffer with default VADC configuration.

Parameters
configpointer to the VADC module configuration
vadcpointer to the VADC
Returns
None

For coding example see: How to use the VADC ADC Interface driver?

Definition at line 771 of file IfxVadc_Adc.c.