iLLD_TC27xD  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
IfxVadc_ChannelResolution 
IfxVadc_getGlobalResolution (Ifx_VADC *vadc, uint8 inputClassNum)
 get global input class resolution More...
 
IFX_INLINE Ifx_VADC_GLOBRES IfxVadc_getGlobalResult (Ifx_VADC *vadc)
 return conversion result stored in the Global result Register More...
 
IFX_INLINE float32 IfxVadc_getGlobalSampleTime (Ifx_VADC *vadc, uint8 inputClassNum, float32 analogFrequency)
 get global input class sample time in sec 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)
 Enables/Disables continuous background auto scan. 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)
 Starts a background scan. 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 1721 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 1727 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 1754 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 1816 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 1822 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 1828 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 1834 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 181 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 1840 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 1846 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_INLINE IfxVadc_ChannelResolution IfxVadc_getGlobalResolution ( Ifx_VADC *  vadc,
uint8  inputClassNum 
)

get global input class resolution

Parameters
vadcPointer to the VADC Group
inputClassNumglobal input class number
Returns
ADC input class channel resolution.

Definition at line 1922 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getModuleConfig().

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
//confiure wait for read mode for global result register
// configure background scan
IfxVadc_setBackgroundScan(vadc, groupId, channels, mask);
// enable auto scan
IfxVadc_SetAutoBackgroundScan(vadc, TRUE);
// start the background scan
Ifx_VADC_GLOBRES result;
result = IfxVadc_getGlobalResult (vadc);

Definition at line 1928 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGlobalResult().

IFX_INLINE float32 IfxVadc_getGlobalSampleTime ( Ifx_VADC *  vadc,
uint8  inputClassNum,
float32  analogFrequency 
)

get global input class sample time in sec

Parameters
vadcPointer to the VADC Group Register space
inputClassNumADC input class number
analogFrequencyADC module analog frequency in Hz.
Returns
ADC input class channel sample time in sec.

Definition at line 1938 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getModuleConfig().

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
//confiure wait for read mode for global result register
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult0, TRUE);
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult1, TRUE);
// configure scan
IfxVadc_setScan(group, channels, mask);
// enable auto scan
// start the scan
// 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 1957 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
//confiure wait for read mode for global result register
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult0, TRUE);
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult1, TRUE);
// configure scan
IfxVadc_setScan(group, channels, mask);
// enable auto scan
// start the scan
// 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 2025 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
//confiure wait for read mode for global result register
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult0, TRUE);
IfxVadc_configureWaitForReadMode(group,IfxVadc_ChannelResult1, TRUE);
// configure scan
IfxVadc_setScan(group, channels, mask);
// start the scan
// 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 280 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 2097 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 2109 of file IfxVadc.h.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_INLINE void IfxVadc_setAutoBackgroundScan ( Ifx_VADC *  vadc,
boolean  autoBackgroundScanEnable 
)

Enables/Disables continuous background auto scan.

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

Definition at line 2145 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
//confiure wait for read mode for global result register
// configure background scan
IfxVadc_setBackgroundScan(vadc, groupId, channels, mask);
// enable auto scan
// start the background scan

Definition at line 2169 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 2176 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 2187 of file IfxVadc.h.

Referenced by IfxVadc_Adc_initGroup().

IFX_INLINE void IfxVadc_startBackgroundScan ( Ifx_VADC *  vadc)

Starts a background scan.

Parameters
vadcpointer to the VADC module
Returns
None
See Also
IfxVadc_setBackgroundScan

Definition at line 2394 of file IfxVadc.h.

Referenced by IfxVadc_Adc_startBackgroundScan().