iLLD_TC27xC  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; can also stop autoscan if all channels are 0 More...
 
IFX_INLINE void IfxVadc_Adc_startBackgroundScan (IfxVadc_Adc *vadc, boolean continuous)
 Starts a background scan in either continuous or single shot conversion mode as per the parameter. 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 1110 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 1116 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
// initialize module pointer
vadc.vadc = &MODULE_VADC;
// 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 ;
adcGroupConfig.backgroundScanRequest.autoscanEnabled = TRUE;
// 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
boolean continuous = TRUE; // disable continuous background scan
//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 1122 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; can also stop autoscan if all channels are 0

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: IfxVadc_Adc_getGlobalResult

Definition at line 1128 of file IfxVadc_Adc.h.

IFX_INLINE void IfxVadc_Adc_startBackgroundScan ( IfxVadc_Adc vadc,
boolean  continuous 
)

Starts a background scan in either continuous or single shot conversion mode as per the parameter.

Parameters
vadcpointer to the VADC module
continuouscontinuous or single shot conversion
Returns
None

For coding example see: IfxVadc_Adc_getGlobalResult

Definition at line 1134 of file IfxVadc_Adc.h.