iLLD_TC27xD  1.0
Background Autoscan Functions
Collaboration diagram for Background Autoscan Functions:

Functions

IFX_INLINE void IfxVadc_Adc_configureWaitForReadModeForGlobalResultRegister (IfxVadc_Adc *vadc, boolean waitForRead)
 access function to enable/disable wait for read mode for global result register More...
 
IFX_INLINE IfxVadc_Status IfxVadc_Adc_getBackgroundScanStatus (IfxVadc_Adc *vadc)
 Gives the background scan status for a group. More...
 
IFX_INLINE Ifx_VADC_GLOBRES IfxVadc_Adc_getGlobalResult (IfxVadc_Adc *vadc)
 returns result stored in global result register More...
 
IFX_INLINE void IfxVadc_Adc_setBackgroundScan (IfxVadc_Adc *vadc, IfxVadc_Adc_Group *group, uint32 channels, uint32 mask)
 configures a background scan More...
 
IFX_INLINE void IfxVadc_Adc_startBackgroundScan (IfxVadc_Adc *vadc)
 Starts a background scan. More...
 

Detailed Description

Function Documentation

IFX_INLINE void IfxVadc_Adc_configureWaitForReadModeForGlobalResultRegister ( IfxVadc_Adc vadc,
boolean  waitForRead 
)

access function to enable/disable wait for read mode for global result register

Parameters
vadcpointer to the VADC module
waitForReadwait for read mode enabled/disabled
Returns
None

For coding example see: IfxVadc_Adc_getGlobalResult

Definition at line 1169 of file IfxVadc_Adc.h.

IFX_INLINE IfxVadc_Status IfxVadc_Adc_getBackgroundScanStatus ( IfxVadc_Adc vadc)

Gives the background scan status for a group.

Parameters
vadcpointer to the VADC module
Returns
IfxVadc_Status

Definition at line 1183 of file IfxVadc_Adc.h.

IFX_INLINE Ifx_VADC_GLOBRES IfxVadc_Adc_getGlobalResult ( IfxVadc_Adc vadc)

returns result stored in global result register

Parameters
vadcpointer to the VADC module
Returns
global result register
// 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 GroupId_0, change to GroupId_3)
adcGroupConfig.groupId = IfxVadc_GroupId_3;
// IMPORTANT: usually we use the same group as master!
adcGroupConfig.master = adcGroupConfig.groupId;
// enable background scan
// enable gate in "always" mode (no edge detection)
// initialize the group
IfxVadc_Adc_initGroup(&adcGroup, &adcGroupConfig);
// create channel config
IfxVadc_Adc_ChannelConfig adcChannelConfig2;
IfxVadc_Adc_initChannelConfig(&adcChannelConfig2, &adcGroup);
adcChannelConfig2.backgroundChannel = TRUE;
adcChannelConfig2.globalResultUsage = TRUE;
// change channel (default is ChannelId0, change to ChannelId2)
adcChannelConfig2.channelId = IfxVadc_ChannelId2;
// initialize the channel
IfxVadc_Adc_Channel adcChannel2;
IfxVadc_Adc_initChannel(&adcChannel2, &adcChannelConfig2);
// create channel config
IfxVadc_Adc_ChannelConfig adcChannelConfig5;
IfxVadc_Adc_initChannelConfig(&adcChannelConfig5, &adcGroup);
adcChannelConfig5.backgroundChannel = TRUE;
adcChannelConfig5.globalResultUsage = TRUE;
// change channel (default is ChannelId0, change to ChannelId5)
adcChannelConfig5.channelId = IfxVadc_ChannelId5;
// initialize the channel
IfxVadc_Adc_Channel adcChannel5;
IfxVadc_Adc_initChannel(&adcChannel5, &adcChannelConfig5);
uint32 channels = (1 << 5) | (1 << 2); // enable channel #5 and #2
uint32 mask = (1 << 7) | (1 << 5) | (1 << 2); // modify the selection for channel #7, #5 and #2; channel #7 will be disabled
//configure wait for read mode
// configure background scan
IfxVadc_Adc_setBackgroundScan(&vadc, &adcGroupConfig, channels, mask);
// start the background scan
// wait for valid result for channel 2
Ifx_VADC_GLOBRES resultChannel2;
do {
resultChannel2 = IfxVadc_Adc_getGlobalResult(&vadc);
} while( !resultChannel2.B.VF );
// wait for valid result for channel 5
Ifx_VADC_GLOBRES resultChannel5;
do {
resultChannel5 = IfxVadc_Adc_getGlobalResult(&vadc);
} while( !resultChannel5.B.VF );

Definition at line 1189 of file IfxVadc_Adc.h.

IFX_INLINE void IfxVadc_Adc_setBackgroundScan ( IfxVadc_Adc vadc,
IfxVadc_Adc_Group group,
uint32  channels,
uint32  mask 
)

configures a background scan

Parameters
vadcpointer to the VADC module
grouppointer to the VADC group
channelsspecifies the channels which should be enabled/disabled
maskspecifies the channels which should be modified
Returns
None

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

Definition at line 1251 of file IfxVadc_Adc.h.

IFX_INLINE void IfxVadc_Adc_startBackgroundScan ( IfxVadc_Adc vadc)

Starts a background scan.

Parameters
vadcpointer to the VADC module
Returns
None

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

Definition at line 1263 of file IfxVadc_Adc.h.