iLLD_TC27xC  1.0
Group Functions
Collaboration diagram for Group Functions:

Functions

IFX_INLINE IfxVadc_GroupId IfxVadc_Adc_getMasterId (IfxVadc_GroupId slave, IfxVadc_Adc_SYNCTR_STSEL masterIndex)
 Gets the master id. More...
 
IFX_INLINE IfxVadc_Adc_SYNCTR_STSEL IfxVadc_Adc_getMasterKernelIndex (IfxVadc_GroupId slave, IfxVadc_GroupId master)
 Gets the current master kernel index. More...
 
IFX_INLINE Ifx_VADC_G * IfxVadc_Adc_getGroupRegsFromGroup (const IfxVadc_Adc_Group *group)
 Gets the current group register set. More...
 
IFX_INLINE void IfxVadc_Adc_getGroupResult (IfxVadc_Adc_Group *group, Ifx_VADC_RES *results, uint32 resultOffset, uint32 numResults)
 Get conversion result for the group. More...
 
IFX_INLINE Ifx_VADC * IfxVadc_Adc_getVadcFromGroup (const IfxVadc_Adc_Group *group)
 Gets the current group module register address. More...
 
IFX_EXTERN void IfxVadc_Adc_deInitGroup (IfxVadc_Adc_Group *group)
 Reset the VADC group. More...
 
IFX_EXTERN void IfxVadc_Adc_getGroupConfig (IfxVadc_Adc_Group *group, IfxVadc_Adc_GroupConfig *config)
 Get the current group configuration (e.g. vadc frequency) More...
 
IFX_EXTERN IfxVadc_Status IfxVadc_Adc_initGroup (IfxVadc_Adc_Group *group, const IfxVadc_Adc_GroupConfig *config)
 Initialise the VADC group (also autoscan and queue modes) Slave Groups must initialize first. More...
 
IFX_EXTERN void IfxVadc_Adc_initGroupConfig (IfxVadc_Adc_GroupConfig *config, IfxVadc_Adc *vadc)
 Initialise buffer with default VADC configuration. More...
 

Detailed Description

Function Documentation

IFX_EXTERN void IfxVadc_Adc_deInitGroup ( IfxVadc_Adc_Group group)

Reset the VADC group.

Parameters
grouppointer to the VADC group
Returns
None

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

Definition at line 115 of file IfxVadc_Adc.c.

IFX_EXTERN void IfxVadc_Adc_getGroupConfig ( IfxVadc_Adc_Group group,
IfxVadc_Adc_GroupConfig config 
)

Get the current group configuration (e.g. vadc frequency)

Parameters
grouppointer to the VADC group
configpointer to the VADC group configuration
Returns
None

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

Definition at line 201 of file IfxVadc_Adc.c.

IFX_INLINE Ifx_VADC_G * IfxVadc_Adc_getGroupRegsFromGroup ( const IfxVadc_Adc_Group group)

Gets the current group register set.

Parameters
groupGroup handle data structure
Returns
Group register set

Definition at line 1080 of file IfxVadc_Adc.h.

Referenced by IfxVadc_Adc_deInitGroup(), IfxVadc_Adc_getChannelConfig(), and IfxVadc_Adc_initChannel().

IFX_INLINE void IfxVadc_Adc_getGroupResult ( IfxVadc_Adc_Group 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
// 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.scanRequest.autoscanEnabled = TRUE;
// initialize the group
IfxVadc_Adc_initGroup(&adcGroup, &adcGroupConfig);
// create channel config
IfxVadc_Adc_ChannelConfig adcChannelConfig2;
IfxVadc_Adc_initChannelConfig(&adcChannelConfig2, &adcGroup);
// 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);
// change channel (default is ChannelId0, change to ChannelId5)
adcChannelConfig5.channelId = IfxVadc_ChannelId5;
// change channel result register (default is ChannelResult0, change to ChannelResult1)
adcChannelConfig5.resultRegister = IfxVadc_ChannelResult1;
// 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; // continuous autoscan
// configure wait for read mode
// configure autoscan
IfxVadc_Adc_setScan(&adcGroup, channels, mask, continuous);
// start the autoscan
// wait for conversion to finish
IfxVadc_Status scanStatus;
do
{
scanStatus = IfxVadc_Adc_getScanStatus(&adcGroup);
} while(scanStatus==IfxVadc_Status_ChannelsStillPending);
// fetch the 2 results of conversion for group 0
Ifx_VADC_RES results[10];
IfxVadc_Adc_getGroupResult(&adcGroup, results, 0, 2);

Definition at line 1086 of file IfxVadc_Adc.h.

IFX_INLINE IfxVadc_GroupId IfxVadc_Adc_getMasterId ( IfxVadc_GroupId  slave,
IfxVadc_Adc_SYNCTR_STSEL  masterIndex 
)

Gets the master id.

Parameters
slaveIndex of the group
masterIndexmaster kernel index
Returns
Master Group Id

Definition at line 79 of file IfxVadc_Adc.c.

Referenced by IfxVadc_Adc_getGroupConfig().

IFX_INLINE IfxVadc_Adc_SYNCTR_STSEL IfxVadc_Adc_getMasterKernelIndex ( IfxVadc_GroupId  slave,
IfxVadc_GroupId  master 
)

Gets the current master kernel index.

Parameters
slaveIndex of the group
masterIndex of the group
Returns
current master kernel index

Definition at line 105 of file IfxVadc_Adc.c.

Referenced by IfxVadc_Adc_initGroup().

IFX_INLINE Ifx_VADC * IfxVadc_Adc_getVadcFromGroup ( const IfxVadc_Adc_Group group)

Gets the current group module register address.

Parameters
groupGroup handle data structure
Returns
Group module register base address

Definition at line 1092 of file IfxVadc_Adc.h.

Referenced by IfxVadc_Adc_deInitGroup(), and IfxVadc_Adc_initChannel().

IFX_EXTERN IfxVadc_Status IfxVadc_Adc_initGroup ( IfxVadc_Adc_Group group,
const IfxVadc_Adc_GroupConfig config 
)

Initialise the VADC group (also autoscan and queue modes) Slave Groups must initialize first.

Parameters
grouppointer to the VADC group
configpointer to the VADC group configuration
Returns
IfxVadc_Status
// 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;
// initialize the group
IfxVadc_Adc_initGroup(&adcGroup, &adcGroupConfig);

Definition at line 430 of file IfxVadc_Adc.c.

IFX_EXTERN void IfxVadc_Adc_initGroupConfig ( IfxVadc_Adc_GroupConfig config,
IfxVadc_Adc vadc 
)

Initialise buffer with default VADC configuration.

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

For coding example see: IfxVadc_Adc_initGroup

Definition at line 653 of file IfxVadc_Adc.c.