iLLD_TC27xC  1.0
Channel Functions
Collaboration diagram for Channel Functions:

Functions

IFX_EXTERN void IfxDsadc_Dsadc_initChannel (IfxDsadc_Dsadc_Channel *channel, const IfxDsadc_Dsadc_ChannelConfig *config)
 Initialise a DSADC channel with the supplied configuration. More...
 
IFX_EXTERN void IfxDsadc_Dsadc_initChannelConfig (IfxDsadc_Dsadc_ChannelConfig *config, IfxDsadc_Dsadc *dsadc)
 Initialise the config struct with default DSADC channel configuration. More...
 

Detailed Description

Function Documentation

IFX_EXTERN void IfxDsadc_Dsadc_initChannel ( IfxDsadc_Dsadc_Channel channel,
const IfxDsadc_Dsadc_ChannelConfig config 
)

Initialise a DSADC channel with the supplied configuration.

Parameters
channelpointer to the DSADC channel handle (it will be initialized by this function)
configpointer to the DSADC module configuration
Returns
None
// disable pull-up devices for analog pads of P00 (assigned to some analog pins)
P00_IOCR0.U = 0x00000000;
P00_IOCR4.U = 0x00000000;
P00_IOCR8.U = 0x00000000;
P00_IOCR12.U = 0x00000000;
// create module config
IfxDsadc_Dsadc_initModuleConfig(&dsadcConfig, &MODULE_DSADC);
// initialize module
IfxDsadc_Dsadc_initModule(&dsadc, &dsadcConfig);
// create channel config
IfxDsadc_Dsadc_ChannelConfig dsadcChannelConfig;
IfxDsadc_Dsadc_initChannelConfig(&dsadcChannelConfig, &dsadc);
// modify default configuration
dsadcChannelConfig.modulator.inputPin = IfxDsadc_InputPin_a;
dsadcChannelConfig.modulator.modulatorClockFreq = 10.0e6;
dsadcChannelConfig.combFilter.bypassed = FALSE;
dsadcChannelConfig.combFilter.decimationFactor = 32;
dsadcChannelConfig.combFilter.startValue = 32;
dsadcChannelConfig.firFilter.fir0Enabled = TRUE;
dsadcChannelConfig.firFilter.fir1Enabled = TRUE;
dsadcChannelConfig.firFilter.offsetCompensation = FALSE;
// initialize channels
for(int chn=0; chn<IFXDSADC_NUM_CHANNELS; ++chn) {
dsadcChannelConfig.channelId = (IfxDsadc_ChannelId)chn;
IfxDsadc_Dsadc_initChannel(&dsadcChannel[chn], &dsadcChannelConfig);
}
// start conversions
IfxDsadc_Dsadc_startScan(&dsadc, 0x3f, 0x3f);

Definition at line 181 of file IfxDsadc_Dsadc.c.

IFX_EXTERN void IfxDsadc_Dsadc_initChannelConfig ( IfxDsadc_Dsadc_ChannelConfig config,
IfxDsadc_Dsadc dsadc 
)

Initialise the config struct with default DSADC channel configuration.

Parameters
configpointer to the DSADC module configuration
dsadcpointer to the DSADC handle (it will be initialized by this function)
Returns
None

A coding example can be found in IfxDsadc_Dsadc_initChannel

Definition at line 239 of file IfxDsadc_Dsadc.c.