iLLD_TC27xD  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 114 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 211 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

Ifx_VADC* 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 IfxVadc_setAutoScan(group, TRUE);

// start the scan IfxVadc_startScan(group);

// 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 1195 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
// 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 GroupId0, change to GroupId2)
adcGroupConfig.groupId = IfxVadc_GroupId2;
adcGroupConfig.master = adcGroupConfig.groupId;
// enable gate in "always" mode (no edge detection)
// enable auto scan
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
// configure wait for read mode
// configure scan
IfxVadc_Adc_setScan(&adcGroup, channels, mask);
// start the scan
// 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 1201 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 78 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 104 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 1245 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

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

Definition at line 442 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: How to use the VADC ADC Interface driver?

Definition at line 665 of file IfxVadc_Adc.c.