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

Functions

IFX_INLINE void IfxVadc_configureWaitForReadMode (Ifx_VADC_G *group, uint32 resultIdx, boolean waitForRead)
 access function to enable/disable wait for read mode for result registers More...
 
IFX_INLINE void IfxVadc_configureWaitForReadModeForGlobalResultRegister (Ifx_VADC *vadc, boolean waitForRead)
 access function to enable/disable wait for read mode for global result register More...
 
IFX_INLINE void IfxVadc_enableBackgroundScanSlotExternalTrigger (Ifx_VADC *vadc)
 Enables the background sacn external trigger. More...
 
IFX_INLINE IfxVadc_GatingMode IfxVadc_getBackgroundScanGatingMode (Ifx_VADC *vadc)
 Gets the background scan gating mode. More...
 
IFX_INLINE IfxVadc_GatingSource IfxVadc_getBackgroundScanGatingSource (Ifx_VADC *vadc)
 Gets the gating input selection. More...
 
IFX_INLINE
IfxVadc_RequestSlotPriority 
IfxVadc_getBackgroundScanSlotPriority (Ifx_VADC_G *vadcG)
 Gets the requested background scan slot priority. More...
 
IFX_INLINE
IfxVadc_RequestSlotStartMode 
IfxVadc_getBackgroundScanSlotStartMode (Ifx_VADC_G *vadcG)
 Gets the requested background scan slot start mode. More...
 
IFX_INLINE IfxVadc_TriggerSource IfxVadc_getBackgroundScanTriggerInput (Ifx_VADC *vadc)
 Gets the background scan trigger input. More...
 
IFX_INLINE IfxVadc_TriggerMode IfxVadc_getBackgroundScanTriggerMode (Ifx_VADC *vadc)
 Gets the background scan external trigger mode. More...
 
IFX_INLINE Ifx_VADC_GLOBRES IfxVadc_getGlobalResult (Ifx_VADC *vadc)
 return conversion result stored in the Global result Register More...
 
IFX_INLINE void IfxVadc_getGroupResult (Ifx_VADC_G *group, Ifx_VADC_RES *results, uint32 resultOffset, uint32 numResults)
 Get conversion result for the group. More...
 
IFX_INLINE Ifx_VADC_RES IfxVadc_getResult (Ifx_VADC_G *group, uint32 resultIdx)
 Get conversion result (Function does not care about the alignment) value = raw * gain + offset. More...
 
IFX_INLINE boolean IfxVadc_isAutoBackgroundScanEnabled (Ifx_VADC *vadc)
 Returns the auto background scan status. More...
 
IFX_INLINE boolean IfxVadc_isRequestBackgroundScanSlotEnabled (Ifx_VADC_G *vadcG)
 Returns the background scan slot requested status. More...
 
IFX_INLINE void IfxVadc_setAutoBackgroundScan (Ifx_VADC *vadc, boolean autoBackgroundScanEnable)
 Sets the auto background scan to enable or disable. More...
 
IFX_INLINE void IfxVadc_setBackgroundScan (Ifx_VADC *vadc, IfxVadc_GroupId groupId, uint32 channels, uint32 mask)
 configures a background scan; can also stop autoscan if all channels are 0 More...
 
IFX_INLINE void IfxVadc_setBackgroundScanSlotGatingConfig (Ifx_VADC *vadc, IfxVadc_GatingSource gatingSource, IfxVadc_GatingMode gatingMode)
 Sets the background scan slot gating configurations. More...
 
IFX_INLINE void IfxVadc_setBackgroundScanSlotTriggerConfig (Ifx_VADC *vadc, IfxVadc_TriggerMode triggerMode, IfxVadc_TriggerSource triggerSource)
 Sets the background scan exteranal trigger operating configurations. More...
 
IFX_INLINE void IfxVadc_startBackgroundScan (Ifx_VADC *vadc, boolean continuous)
 Starts a background scan in either continuous or single shot conversion mode as per the parameter. More...
 
IFX_EXTERN IfxVadc_Status IfxVadc_getBackgroundScanStatus (Ifx_VADC *vadc)
 Gives the background scan status for a group. More...
 
IFX_EXTERN Ifx_VADC_RES IfxVadc_getResultBasedOnRequestSource (Ifx_VADC *vadc, Ifx_VADC_G *group, IfxVadc_ChannelId channel, IfxVadc_RequestSource sourceType)
 Get conversion result (Function does not care about the alignment) value = raw * gain + offset. More...
 

Detailed Description

Function Documentation

IFX_INLINE void IfxVadc_configureWaitForReadMode ( Ifx_VADC_G *  group,
uint32  resultIdx,
boolean  waitForRead 
)

access function to enable/disable wait for read mode for result registers

Parameters
grouppointer to the VADC group
resultIdxresult register index
waitForReadwait for read mode enabled/disabled
Returns
None

Definition at line 1404 of file IfxVadc.h.

Referenced by IfxVadc_Adc_configureWaitForReadMode().

IFX_INLINE void IfxVadc_configureWaitForReadModeForGlobalResultRegister ( Ifx_VADC *  vadc,
boolean  waitForRead 
)

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

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

Definition at line 1410 of file IfxVadc.h.

Referenced by IfxVadc_Adc_configureWaitForReadModeForGlobalResultRegister().

IFX_INLINE void IfxVadc_enableBackgroundScanSlotExternalTrigger ( Ifx_VADC *  vadc)

Enables the background sacn external trigger.

Parameters
vadcpointer to the base of VADC registers.
Returns
None

Definition at line 1416 of file IfxVadc.h.

Referenced by IfxVadc_Adc_initGroup().

IFX_INLINE IfxVadc_GatingMode IfxVadc_getBackgroundScanGatingMode ( Ifx_VADC *  vadc)

Gets the background scan gating mode.

Parameters
vadcpointer to the base of VADC registers.
Returns
background scan gating mode.

Definition at line 1422 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_INLINE IfxVadc_GatingSource IfxVadc_getBackgroundScanGatingSource ( Ifx_VADC *  vadc)

Gets the gating input selection.

Parameters
vadcpointer to the base of VADC registers.
Returns
background scan gating input selection.

Definition at line 1428 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_INLINE IfxVadc_RequestSlotPriority IfxVadc_getBackgroundScanSlotPriority ( Ifx_VADC_G *  vadcG)

Gets the requested background scan slot priority.

Parameters
vadcGpointer to VADC group registers.
Returns
requested background scan slot priority.

Definition at line 1434 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_INLINE IfxVadc_RequestSlotStartMode IfxVadc_getBackgroundScanSlotStartMode ( Ifx_VADC_G *  vadcG)

Gets the requested background scan slot start mode.

Parameters
vadcGpointer to VADC group registers.
Returns
requested background scan slot start mode.

Definition at line 1440 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_EXTERN IfxVadc_Status IfxVadc_getBackgroundScanStatus ( Ifx_VADC *  vadc)

Gives the background scan status for a group.

Parameters
vadcpointer to the VADC module
Returns
IfxVadc_Status

Definition at line 107 of file IfxVadc.c.

Referenced by IfxVadc_Adc_getBackgroundScanStatus().

IFX_INLINE IfxVadc_TriggerSource IfxVadc_getBackgroundScanTriggerInput ( Ifx_VADC *  vadc)

Gets the background scan trigger input.

Parameters
vadcpointer to the base of VADC registers.
Returns
Gets the background scan external trigger source.

Definition at line 1446 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_INLINE IfxVadc_TriggerMode IfxVadc_getBackgroundScanTriggerMode ( Ifx_VADC *  vadc)

Gets the background scan external trigger mode.

Parameters
vadcpointer to the base of VADC registers.
Returns
background scan external trigger mode.

Definition at line 1452 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_INLINE Ifx_VADC_GLOBRES IfxVadc_getGlobalResult ( Ifx_VADC *  vadc)

return conversion result stored in the Global result Register

Parameters
vadcpointer to the VADC module
Returns
global result register
Ifx_VADC* vadc = &MODULE_VADC; // module pointer
IfxVadc_GroupId groupId = IfxVadc_GroupId0; // for group 0
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; // use continuous background scan
//confiure wait for read mode for global result register
// configure background scan
IfxVadc_setBackgroundScan(vadc, groupId, channels, mask);
// start the background scan
IfxVadc_startBackgroundScan(vadc, continuous);
Ifx_VADC_GLOBRES result;
result = IfxVadc_getGlobalResult (vadc);

Definition at line 1458 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGlobalResult().

IFX_INLINE void IfxVadc_getGroupResult ( Ifx_VADC_G *  group,
Ifx_VADC_RES *  results,
uint32  resultOffset,
uint32  numResults 
)

Get conversion result for the group.

Parameters
grouppointer to the VADC group
resultspointer to scaled conversion results
resultOffsetoffset for the first result
numResultsnumber of results
Returns
None
Ifx_VADC* vadc = &MODULE_VADC
Ifx_VADC_G* group = &MODULE_VADC.G[0]; // for group 0
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; // use continuous autoscan
//confiure wait for read mode for global result register
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult0, TRUE);
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult1, TRUE);
// configure autoscan
IfxVadc_setScan(group, channels, mask, continuous);
// start the autoscan
// wait for conversion to finish
// fetch the 2 results of conversion for group 0
Ifx_VADC_RES results[10];
result = IfxVadc_getGroupResult(group, results, 0, 2);

Definition at line 1468 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupResult().

IFX_INLINE Ifx_VADC_RES IfxVadc_getResult ( Ifx_VADC_G *  group,
uint32  resultIdx 
)

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

Parameters
grouppointer to the VADC group
resultIdxresult register index
Returns
scaled Conversion result
Ifx_VADC_G* group = &MODULE_VADC.G[0]; // for group 0
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; // use continuous autoscan
//confiure wait for read mode for global result register
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult0, TRUE);
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult1, TRUE);
// configure autoscan
IfxVadc_setScan(group, channels, mask, continuous);
// start the autoscan
// wait for conversion to finish
// fetch the result of conversion from result register 0 for group 0
Ifx_VADC_RES result;
result = IfxVadc_getResult(group, IfxVadc_ChannelResult0);

Definition at line 1479 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getResult().

IFX_EXTERN Ifx_VADC_RES IfxVadc_getResultBasedOnRequestSource ( Ifx_VADC *  vadc,
Ifx_VADC_G *  group,
IfxVadc_ChannelId  channel,
IfxVadc_RequestSource  sourceType 
)

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

Parameters
vadcVADC module pointer
grouppointer to the VADC group
channelchannel Id
sourceTypetype of request source
Returns
scaled Conversion result
Ifx_VADC vadc;
vadc.vadc = &MODULE_VADC;
Ifx_VADC_G* group = &MODULE_VADC.G[0]; // for group 0
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 = FALSE; //not using continuous autoscan
//confiure wait for read mode for global result register
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult0, TRUE);
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult1, TRUE);
// configure autoscan
IfxVadc_setScan(group, channels, mask, continuous);
// start the autoscan
// wait for conversion to finish
// fetch the result of conversion for channel 2 of group 0
Ifx_VADC_RESresult2;
result = IfxVadc_getResultBasedOnRequestSource(&vadc, group, IfxVadc_ChannelId2, IfxVadc_RequestSource_scan);
Ifx_VADC_RESresult5;
result = IfxVadc_getResultBasedOnRequestSource(&vadc, group, IfxVadc_ChannelId5, IfxVadc_RequestSource_scan);

Definition at line 146 of file IfxVadc.c.

Referenced by IfxVadc_Adc_getResultBasedOnRequestSource().

IFX_INLINE boolean IfxVadc_isAutoBackgroundScanEnabled ( Ifx_VADC *  vadc)

Returns the auto background scan status.

Parameters
vadcpointer to the base of VADC registers.
Returns
TRUE if enabled otherwise FALSE.

Definition at line 1489 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_INLINE boolean IfxVadc_isRequestBackgroundScanSlotEnabled ( Ifx_VADC_G *  vadcG)

Returns the background scan slot requested status.

Parameters
vadcGpointer to VADC group registers.
Returns
background scan slot requested status.

Definition at line 1495 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_INLINE void IfxVadc_setAutoBackgroundScan ( Ifx_VADC *  vadc,
boolean  autoBackgroundScanEnable 
)

Sets the auto background scan to enable or disable.

Parameters
vadcpointer to the base of VADC registers.
autoBackgroundScanEnablewhether auto background scan enabled or not.
Returns
None

Definition at line 1501 of file IfxVadc.h.

Referenced by IfxVadc_Adc_initGroup().

IFX_INLINE void IfxVadc_setBackgroundScan ( Ifx_VADC *  vadc,
IfxVadc_GroupId  groupId,
uint32  channels,
uint32  mask 
)

configures a background scan; can also stop autoscan if all channels are 0

Parameters
vadcpointer to the VADC module registers
groupIdgroup index
channelsspecifies the channels which should be enabled/disabled
maskspecifies the channels which should be modified
Returns
None

Background scan can be enabled/disabled for the given channels which are selected with the mask

Ifx_VADC* vadc = &MODULE_VADC; // module pointer
IfxVadc_GroupId groupId = IfxVadc_GroupId0; // for group 0
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; // use continuous background scan
//confiure wait for read mode for global result register
// configure background scan
IfxVadc_setBackgroundScan(vadc, groupId, channels, mask);
// start the background scan
IfxVadc_startBackgroundScan(vadc, continuous);

Definition at line 1507 of file IfxVadc.h.

Referenced by IfxVadc_Adc_setBackgroundScan().

IFX_INLINE void IfxVadc_setBackgroundScanSlotGatingConfig ( Ifx_VADC *  vadc,
IfxVadc_GatingSource  gatingSource,
IfxVadc_GatingMode  gatingMode 
)

Sets the background scan slot gating configurations.

Parameters
vadcpointer to the base of VADC registers.
gatingSourcegate input for group.
gatingModegating mode. High level, Low Level or Gating disabled.
Returns
None

Definition at line 1514 of file IfxVadc.h.

Referenced by IfxVadc_Adc_initGroup().

IFX_INLINE void IfxVadc_setBackgroundScanSlotTriggerConfig ( Ifx_VADC *  vadc,
IfxVadc_TriggerMode  triggerMode,
IfxVadc_TriggerSource  triggerSource 
)

Sets the background scan exteranal trigger operating configurations.

Parameters
vadcpointer to the base of VADC registers.
triggerModetrigger mode. Rising, falling any edge leads to an trigger event.
triggerSourcetrigger input for group.
Returns
None

Definition at line 1525 of file IfxVadc.h.

Referenced by IfxVadc_Adc_initGroup().

IFX_INLINE void IfxVadc_startBackgroundScan ( Ifx_VADC *  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
continuousStarts a background scan in either continuous or single shot conversion mode as per the parameter
Returns
None
Ifx_VADC* vadc = &MODULE_VADC; // module pointer
Ifx_VADC_G* group = &MODULE_VADC.G[0]; // for group 0
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; // use continuous background scan
// configure background scan
IfxVadc_setBackgroundScan(vadc, group, channels, mask);
// start the background scan
IfxVadc_startBackgroundScan(vadc, continuous);

Definition at line 1536 of file IfxVadc.h.

Referenced by IfxVadc_Adc_startBackgroundScan().