iLLD_TC27xD  1.0
IfxVadc_Adc.c
Go to the documentation of this file.
1 /**
2  * \file IfxVadc_Adc.c
3  * \brief VADC ADC details
4  *
5  * \version iLLD_1_0_0_11_0
6  * \copyright Copyright (c) 2013 Infineon Technologies AG. All rights reserved.
7  *
8  *
9  * IMPORTANT NOTICE
10  *
11  *
12  * Infineon Technologies AG (Infineon) is supplying this file for use
13  * exclusively with Infineon's microcontroller products. This file can be freely
14  * distributed within development tools that are supporting such microcontroller
15  * products.
16  *
17  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
18  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
19  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
20  * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
21  * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
22  *
23  */
24 
25 /******************************************************************************/
26 /*----------------------------------Includes----------------------------------*/
27 /******************************************************************************/
28 
29 #include "IfxVadc_Adc.h"
30 
31 /** \addtogroup IfxLld_Vadc_Adc_Group
32  * \{ */
33 /******************************************************************************/
34 /*------------------------Inline Function Prototypes--------------------------*/
35 /******************************************************************************/
36 
37 /** \brief Gets the master id
38  * \param slave Index of the group
39  * \param masterIndex master kernel index
40  * \return Master Group Id
41  */
43 
44 /** \brief Gets the current master kernel index.
45  * \param slave Index of the group
46  * \param master Index of the group
47  * \return current master kernel index
48  */
50 
51 /** \} */
52 
53 /** \addtogroup IfxLld_Vadc_Adc_Variables
54  * \{ */
55 
56 /******************************************************************************/
57 /*------------------------Private Variables/Constants-------------------------*/
58 /******************************************************************************/
59 
61  /* 0 1 2 3 4 5 6 7 */
62  {0, 1, 2, 3, 0, 0, 0, 0}, /* Grp 0 */
63  {1, 0, 2, 3, 0, 0, 0, 0}, /* Grp 1 */
64  {1, 2, 0, 3, 0, 0, 0, 0}, /* Grp 2 */
65  {1, 2, 3, 0, 0, 0, 0, 0}, /* Grp 3 */
66  {0, 0, 0, 0, 0, 1, 2, 3}, /* Grp 4 */
67  {0, 0, 0, 0, 1, 0, 2, 3}, /* Grp 5 */
68  {0, 0, 0, 0, 1, 2, 0, 3}, /* Grp 6 */
69  {0, 0, 0, 0, 1, 2, 3, 0} /* Grp 7 */
70 };
71 
72 /** \} */
73 
74 /******************************************************************************/
75 /*---------------------Inline Function Implementations------------------------*/
76 /******************************************************************************/
77 
79 {
80  uint8 i, idxOffset;
81  IfxVadc_GroupId masterId = slave;
82 
83  if (masterIndex == 0)
84  {
85  masterId = slave;
86  }
87  else
88  {
89  idxOffset = (slave < 4) ? 0 : 4; /* 4 is the index in the above IfxVadc_Adc_masterIndex about which symmetry is observed */
90 
91  for (i = 0; i < 4; i++)
92  {
93  if (IfxVadc_Adc_masterIndex[slave][i + idxOffset] == masterIndex)
94  {
95  return i + idxOffset;
96  }
97  }
98  }
99 
100  return masterId;
101 }
102 
103 
105 {
106  return IfxVadc_Adc_masterIndex[slave][master];
107 }
108 
109 
110 /******************************************************************************/
111 /*-------------------------Function Implementations---------------------------*/
112 /******************************************************************************/
113 
115 {
116  Ifx_VADC *vadc = IfxVadc_Adc_getVadcFromGroup(group);
117  Ifx_VADC_G *vadcG = IfxVadc_Adc_getGroupRegsFromGroup(group);
118  /* Get group index */
119  IfxVadc_GroupId groupIndex = group->groupId;
120 
121  /* Request Access to configuration registers */
123  IfxVadc_resetGroup(vadcG);
125 }
126 
127 
128 void IfxVadc_Adc_disableModule(Ifx_VADC *vadc)
129 {
130  IfxVadc_disableModule(vadc);
131 }
132 
133 
135 {
136  Ifx_VADC_G *vadcG = IfxVadc_Adc_getGroupRegsFromGroup(channel->group);
137  IfxVadc_ChannelId channelIndex = channel->channel;
138 
139  config->channelId = channel->channel;
140  config->group = channel->group;
141 
142  Ifx_VADC_CHCTR tempChctr;
143  tempChctr.U = 0;
144  tempChctr = IfxVadc_getChannelControlConfig(vadcG, channelIndex);
145 
146  config->inputClass = tempChctr.B.ICLSEL;
147  config->reference = tempChctr.B.REFSEL;
148  config->resultRegister = tempChctr.B.RESREG;
149  config->globalResultUsage = tempChctr.B.RESTBS;
150  config->lowerBoundary = tempChctr.B.BNDSELL;
151  config->upperBoundary = tempChctr.B.BNDSELU;
152  config->boundaryMode = tempChctr.B.BNDSELX;
153  config->limitCheck = tempChctr.B.CHEVMODE;
154  config->synchonize = tempChctr.B.SYNC;
155  config->rightAlignedStorage = tempChctr.B.RESPOS;
156 
157  config->backgroundChannel = ((IfxVadc_getAssignedChannels(vadcG)).U & (1 << channelIndex)) ? FALSE : TRUE;
158  uint32 channelServiceRequestNodePtr;
159  /* Get Channel index */
160  IfxVadc_GroupId groupIndex = channel->group->groupId;
161  channelServiceRequestNodePtr = ((IfxVadc_getChannelServiceRequestNodePointer0(vadcG)).U >> (channel->channel * 4)) & 0xF;
162  volatile Ifx_SRC_SRCR *src = IfxVadc_getSrcAddress(groupIndex, channelServiceRequestNodePtr);
163 
164  if (src->B.SRE == 1)
165  {
166  config->channelSrcNr = channelServiceRequestNodePtr;
167  config->channelPriority = src->B.SRPN;
168  config->channelServProvider = src->B.TOS;
169  }
170  else
171  {
172  config->channelSrcNr = 0;
173  config->channelPriority = 0;
174  config->channelServProvider = 0;
175  }
176 
177  uint32 resultServiceRequestNodePtr;
178 
180  {
181  resultServiceRequestNodePtr = ((IfxVadc_getChannelResultServiceRequestNodePointer0(vadcG)).U >> (channel->channel * 4)) & 0xF;
182  }
183  else
184  {
185  resultServiceRequestNodePtr = ((IfxVadc_getChannelResultServiceRequestNodePointer1(vadcG)).U >> ((channel->channel - IfxVadc_ChannelResult_8) * 4)) & 0xF;
186  }
187 
188  src = IfxVadc_getSrcAddress(groupIndex, resultServiceRequestNodePtr);
189 
190  if (src->B.SRE == 1)
191  {
192  config->resultSrcNr = resultServiceRequestNodePtr;
193  config->resultPriority = src->B.SRPN;
194  config->resultServProvider = src->B.TOS;
195  }
196  else
197  {
198  config->resultSrcNr = 0;
199  config->resultPriority = 0;
200  config->resultServProvider = 0;
201  }
202 }
203 
204 
206 {
208 }
209 
210 
212 {
213  uint8 inputClassNum;
214  Ifx_VADC_G *vadcG = group->group;
215  Ifx_VADC *vadc = group->module.vadc;
216  float32 analogFrequency = IfxVadc_getAdcAnalogFrequency(vadc);
217 
218  config->groupId = group->groupId;
219  config->module = &group->module;
220 
222 
223  for (inputClassNum = 0; inputClassNum < IFXVADC_NUM_INPUTCLASSES; inputClassNum++)
224  {
225  config->inputClass[inputClassNum].resolution = IfxVadc_getGroupResolution(vadcG, inputClassNum);
226  config->inputClass[inputClassNum].sampleTime = IfxVadc_getGroupSampleTime(vadcG, inputClassNum, analogFrequency);
227  }
228 
230  {
234 
237 
239  {
241  }
243  {
245  }
246 
249  }
250  else
251  {
254  config->scanRequest.triggerConfig.gatingSource = IfxVadc_GatingSource_0; /* Use CCU6061 TRIG0 */
256  config->scanRequest.triggerConfig.triggerSource = IfxVadc_TriggerSource_0; /* Trigger source taken from Gating Input */
257  }
258 
260  {
264 
267 
269  {
271  }
273  {
275  }
276 
279  }
280  else
281  {
284  config->queueRequest.triggerConfig.gatingSource = IfxVadc_GatingSource_0; /* Use CCU6061 TRIG0 */
286  config->queueRequest.triggerConfig.triggerSource = IfxVadc_TriggerSource_0; /* Trigger source taken from Gating Input */
287  }
288 
290  {
294 
297 
299  {
301  }
303  {
305  }
306 
309  }
310  else
311  {
316  config->backgroundScanRequest.triggerConfig.triggerSource = IfxVadc_TriggerSource_0; /* Trigger source taken from Gating Input */
317  }
318 
320 
321  config->disablePostCalibration = ((IfxVadc_getGlobalConfigValue(vadc)).U >> (IFX_VADC_GLOBCFG_DPCAL0_OFF + group->groupId)) & 0x1;
322 }
323 
324 
326 {
328  Ifx_VADC *vadc = IfxVadc_Adc_getVadcFromGroup(config->group);
329  Ifx_VADC_G *vadcG = IfxVadc_Adc_getGroupRegsFromGroup(config->group);
330 
331  channel->group = config->group;
332  IfxVadc_GroupId groupIndex = channel->group->groupId;
333  IfxVadc_ChannelId channelIndex = config->channelId;
334 
335  /* Request Access to configuration registers */
337 
338  /* Configure Channel */
339  {
340  IfxVadc_setReferenceInput(vadcG, channelIndex, config->reference);
341  IfxVadc_storeGroupResult(vadcG, channelIndex, config->resultRegister);
342  IfxVadc_setLowerBoundary(vadcG, channelIndex, config->lowerBoundary);
343  IfxVadc_setUpperBoundary(vadcG, channelIndex, config->lowerBoundary);
344  IfxVadc_setSyncRequest(vadcG, channelIndex, config->synchonize);
345  IfxVadc_setChannelInputClass(vadcG, channelIndex, config->inputClass);
346  IfxVadc_setChannelLimitCheckMode(vadcG, channelIndex, config->limitCheck);
347  IfxVadc_setResultPosition(vadcG, channelIndex, config->rightAlignedStorage);
348  IfxVadc_setBackgroundResultTarget(vadcG, channelIndex, config->globalResultUsage);
349  IfxVadc_setBoundaryMode(vadcG, channelIndex, config->boundaryMode);
350  }
351 
353 
354  if (config->backgroundChannel == FALSE)
355  {
356  IfxVadc_setGroupPriorityChannel(vadcG, channelIndex);
357  }
358  else
359  {
360  IfxVadc_setBackgroundPriorityChannel(vadcG, channelIndex);
361  }
362 
364 
365  if (config->channelPriority > 0)
366  {
367  volatile Ifx_SRC_SRCR *src = IfxVadc_getSrcAddress(groupIndex, config->channelSrcNr);
368 
369  IfxVadc_setChannelEventNodePointer0(vadcG, config->channelSrcNr, channel->channel);
370 
371  IfxVadc_clearChannelRequest(vadcG, config->channelId);
372  IfxSrc_init(src, config->channelServProvider, config->channelPriority);
373  IfxSrc_enable(src);
374  }
375  else
376  {
377  /* do nothing */
378  /* FIXME disable the interrupt generation? */
379  }
380 
381  if (config->resultPriority > 0)
382  {
383  volatile Ifx_SRC_SRCR *src = IfxVadc_getSrcAddress(groupIndex, config->resultSrcNr);
385 
387  {
389  }
390  else
391  {
393  }
394 
396  IfxSrc_init(src, config->resultServProvider, config->resultPriority);
397  IfxSrc_enable(src);
398  }
399  else
400  {
401  /* do nothing */
402  /* FIXME disable the interrupt generation? */
403  }
404 
406  /* Software initialization */
407  channel->resultreg = config->resultRegister;
408  channel->channel = config->channelId;
409 
410  return Status;
411 }
412 
413 
415 {
416  static const IfxVadc_Adc_ChannelConfig IfxVadc_Adc_defaultChannelConfig = {
418  .group = NULL_PTR,
419  .inputClass = IfxVadc_InputClasses_group0,
421  .resultRegister = IfxVadc_ChannelResult_0,
422  .globalResultUsage = FALSE,
423  .lowerBoundary = IfxVadc_BoundarySelection_group0,
424  .upperBoundary = IfxVadc_BoundarySelection_group0,
425  .boundaryMode = IfxVadc_BoundaryExtension_standard,
426  .limitCheck = IfxVadc_LimitCheck_noCheck,
427  .synchonize = FALSE,
428  .backgroundChannel = FALSE,
429  .rightAlignedStorage = FALSE,
430  .resultPriority = 0,
431  .resultSrcNr = IfxVadc_SrcNr_group0,
432  .resultServProvider = IfxSrc_Tos_cpu0,
433  .channelPriority = 0,
434  .channelSrcNr = IfxVadc_SrcNr_group0,
435  .channelServProvider = IfxSrc_Tos_cpu0
436  };
437  *config = IfxVadc_Adc_defaultChannelConfig;
438  config->group = group;
439 }
440 
441 
443 {
445  Ifx_VADC *vadc = config->module->vadc;
446  Ifx_VADC_G *vadcG = &vadc->G[config->groupId];
447 
448  /* check for write access */
449  group->group = vadcG;
450  group->module = *config->module;
451  IfxVadc_GroupId groupIndex = config->groupId;
452  group->groupId = groupIndex;
453  float32 analogFrequency = IfxVadc_getAdcAnalogFrequency(vadc);
454 
455  uint8 inputClassNum;
456 
457  /* Request Access to configuration registers */
459 
460  if (config->arbiter.requestSlotQueueEnabled == TRUE)
461  {
462  /* Enable Arbiter slot, set Priority and start mode */
464  }
465  else
466  {
467  /* Disable the slot */
469  }
470 
471  if (config->arbiter.requestSlotScanEnabled == TRUE)
472  {
473  /* Setup Arbitration priority and turn on enabled slot */
474  /* Enable Arbiter slot, set Priority and start mode */
476  }
477  else
478  {
479  /* Disable the slot */
481  }
482 
484  {
485  /* Setup Arbitration priority and turn on enabled slot */
486  /* Enable Arbiter slot, set Priority and start mode */
488  }
489  else
490  {
491  /* Disable the slot */
493  }
494 
495  /* master slave configuration */
496  if (config->master != groupIndex)
497  {
498  uint8 masterIndex = IfxVadc_Adc_getMasterKernelIndex(groupIndex, config->master);
499  IfxVadc_setMasterIndex(vadcG, masterIndex);
500  }
501  else
502  {
503  /* do nothing */
504  /* FIXME check if something needs to be done? */
505  }
506 
507  /* Setup arbiter */
508  /* turn off the group during initialization, see UM for sync mode */
510 
512 
513  /* Setup queue request if enabled */
514  if (config->arbiter.requestSlotQueueEnabled == TRUE)
515  {
516  const IfxVadc_Adc_QueueConfig *queueSlot = &config->queueRequest;
517 
518  /* configure external Trigger if enabled */
520  {
521  /* enable external trigger */
524 
525  /* if last input is used the trigger input selection is extend by Gating inputs */
527  {
529  }
530  else
531  {
532  /* do nothing, gating is configured later */
533  }
534  }
535  else
536  {
537  /* disable external trigger */
539  }
540 
541  /* configure Gating if enabled */
543  {
545  }
546  else
547  {
548  /* do nothing, handled by trigger settings */
549  }
550 
551  IfxVadc_clearQueue(vadcG, (queueSlot->flushQueueAfterInit) ? 1 : 0);
552  }
553  else
554  {
555  /* do nothing */
556  }
557 
558  /* Setup scan request if enabled */
559  if (config->arbiter.requestSlotScanEnabled == TRUE)
560  {
561  const IfxVadc_Adc_ScanConfig *scanSlot = &config->scanRequest;
562 
563  /* configure external Trigger if enabled */
565  {
566  /* enable external trigger */
568 
570 
571  if (scanSlot->triggerConfig.triggerSource == IfxVadc_TriggerSource_15) /* if last input is used the trigger input selection is extend by Gating inputs */
572  {
574  }
575  else
576  {
577  /* do nothing, gating is configured later */
578  }
579  }
580  else
581  {
583  }
584 
585  /* configure Gating if enabled */
587  {
589  }
590  else
591  {
592  /* do nothing, handled by trigger settings */
593  }
594 
595  IfxVadc_setAutoScan(vadcG, scanSlot->autoscanEnabled ? 1 : 0);
596  }
597  else
598  {
599  /* do nothing */
600  }
601 
603  {
604  const IfxVadc_Adc_BackgroundScanConfig *backgroundScanSlot = &config->backgroundScanRequest;
605 
606  /* configure external Trigger if enabled */
608  {
610 
612 
613  if (backgroundScanSlot->triggerConfig.triggerSource == IfxVadc_TriggerSource_15) /* if last input is used the trigger input selection is extend by Gating inputs */
614  {
616  }
617  else
618  {
619  /* do nothing, gating is configured later */
620  }
621  }
622  else
623  {
624  /* do nothing */
625  }
626 
627  /* configure Gating if enabled */
628  if ((backgroundScanSlot->triggerConfig.triggerSource != IfxVadc_TriggerSource_15))
629  {
630  IfxVadc_setBackgroundScanSlotGatingConfig(vadc, backgroundScanSlot->triggerConfig.gatingSource, backgroundScanSlot->triggerConfig.gatingMode);
631  }
632  else
633  {
634  /* do nothing, handled by trigger settings */
635  }
636 
637  IfxVadc_setAutoBackgroundScan(vadc, backgroundScanSlot->autoBackgroundScanEnabled ? 1 : 0);
638  }
639  else
640  {
641  /* do nothing */
642  }
643 
644  /* turn on group after initialisation, only in master mode */
646  IfxVadc_setAnalogConvertControl(vadcG, convertMode);
647 
648  /* Post Calibration */
649  IfxVadc_disablePostCalibration(vadc, groupIndex, config->disablePostCalibration);
650 
651  for (inputClassNum = 0; inputClassNum < IFXVADC_NUM_INPUTCLASSES; inputClassNum++)
652  {
653  /* configure Group input class registers */
654  IfxVadc_setGroupResolution(vadcG, inputClassNum, config->inputClass[inputClassNum].resolution);
655  /* Calculate Sample time ticks */
656  IfxVadc_setGroupSampleTime(vadcG, inputClassNum, analogFrequency, config->inputClass[inputClassNum].sampleTime);
657  }
658 
660 
661  return status;
662 }
663 
664 
666 {
667  static const IfxVadc_Adc_GroupConfig IfxVadc_Adc_defaultGroupConfig = {
668  .arbiter = {
670  .requestSlotQueueEnabled = FALSE,
671  .requestSlotScanEnabled = FALSE,
672  .requestSlotBackgroundScanEnabled = FALSE,
673  },
674  .backgroundScanRequest = {
675  .autoBackgroundScanEnabled = FALSE,
676  .triggerConfig.gatingMode = IfxVadc_GatingMode_disabled,
677  .triggerConfig.triggerMode = IfxVadc_TriggerMode_noExternalTrigger,
678  .triggerConfig.gatingSource = IfxVadc_GatingSource_0,
679  .triggerConfig.triggerSource = IfxVadc_TriggerSource_0,
680  .requestSlotPrio = IfxVadc_RequestSlotPriority_low,
681  .requestSlotStartMode = IfxVadc_RequestSlotStartMode_waitForStart,
682  },
683  .scanRequest = {
684  .autoscanEnabled = FALSE,
685  .triggerConfig.gatingMode = IfxVadc_GatingMode_disabled,
686  .triggerConfig.gatingSource = IfxVadc_GatingSource_0,
687  .triggerConfig.triggerMode = IfxVadc_TriggerMode_noExternalTrigger,
688  .triggerConfig.triggerSource = IfxVadc_TriggerSource_0,
689  .requestSlotPrio = IfxVadc_RequestSlotPriority_low,
690  .requestSlotStartMode = IfxVadc_RequestSlotStartMode_waitForStart,
691  },
692  .queueRequest = {
693  .flushQueueAfterInit = TRUE,
694  .triggerConfig.gatingMode = IfxVadc_GatingMode_disabled,
695  .triggerConfig.gatingSource = IfxVadc_GatingSource_0,
696  .triggerConfig.triggerMode = IfxVadc_TriggerMode_noExternalTrigger,
697  .triggerConfig.triggerSource = IfxVadc_TriggerSource_0,
698  .requestSlotPrio = IfxVadc_RequestSlotPriority_low,
699  .requestSlotStartMode = IfxVadc_RequestSlotStartMode_waitForStart,
700  },
701 
702  .inputClass[0].resolution = IfxVadc_ChannelResolution_12bit,
703  .inputClass[0].sampleTime = 1.0e-6, /* Set sample time to 1us */
704  .inputClass[1].resolution = IfxVadc_ChannelResolution_12bit,
705  .inputClass[1].sampleTime = 1.0e-6, /* Set sample time to 1us */
706  };
707 
708  *config = IfxVadc_Adc_defaultGroupConfig;
709  config->groupId = IfxVadc_GroupId_0;
710  config->module = vadc;
711  config->master = config->groupId;
712  config->disablePostCalibration = FALSE;
713 }
714 
715 
717 {
719  Ifx_VADC *vadcSFR = config->vadc;
720  vadc->vadc = vadcSFR;
721  float32 analogFrequency;
722  uint8 inputClassNum, groupNum;
723 
724  /* Enable VADC kernel clock */
725  IfxVadc_enableModule(vadcSFR);
727 
728  /* Set Analog Frequency */
729  if (IfxVadc_initializeFAdcI(vadcSFR, config->analogFrequency) == 0)
730  {
732  }
733  else
734  {
735  /* do nothing */
736  }
737 
738  /* Set digital Frequency */
739  IfxVadc_initializeFAdcD(vadcSFR, config->digitalFrequency);
740 
741  analogFrequency = IfxVadc_getAdcAnalogFrequency(vadcSFR);
742 
743  /* configure Global input class registers */
744  for (inputClassNum = 0; inputClassNum < IFXVADC_NUM_GLOBAL_INPUTCLASSES; inputClassNum++)
745  {
746  /* configure ADC channel resolution ( conversion mode ) */
747  IfxVadc_setGlobalResolution(vadcSFR, inputClassNum, config->globalInputClass[inputClassNum].resolution);
748  /* configure Sample time ticks */
749  IfxVadc_setGlobalSampleTime(vadcSFR, inputClassNum, analogFrequency, config->globalInputClass[inputClassNum].sampleTime);
750  }
751 
752  /* Start up calibration is requested */
753  if (config->startupCalibration == TRUE)
754  {
755  /* Ensure that all groups are enabled */
756  for (groupNum = 0; groupNum < IFXVADC_NUM_ADC_GROUPS; groupNum++)
757  {
761  }
762 
763  // execute calibration
765  }
766 
767  return status;
768 }
769 
770 
772 {
773  config->vadc = vadc;
775 
779  config->globalInputClass[0].sampleTime = 1.0e-6;
781  config->globalInputClass[1].sampleTime = 1.0e-6;
782  config->startupCalibration = FALSE;
784 }
785 
786 
788 {
789  emuxConfig->vadc = vadc;
790  emuxConfig->channels = 0;
791  emuxConfig->groupId = IfxVadc_GroupId_0;
798  IfxVadc_Adc_EmuxPinConfig defaultConfig = {
799  .pins = {NULL_PTR},
800  .outputMode = IfxPort_OutputMode_pushPull,
801  .padDriver = 0,
802  };
803 
804  emuxConfig->emuxOutPinConfig = defaultConfig;
805 }
806 
807 
808 void IfxVadc_Adc_initExternalMultiplexerMode(Ifx_VADC *vadc, const IfxVadc_Adc_EmuxControl *emuxControl)
809 {
810  uint8 count = 0;
811  Ifx_VADC_G *vadcG = &vadc->G[emuxControl->groupId];
812  IfxVadc_setEmuxInterfaceForGroup(vadc, emuxControl->emuxInterface, emuxControl->groupId);
813 
814  for (count = 0; count < 3; count++)
815  {
816  if (emuxControl->emuxOutPinConfig.pins[count] != NULL_PTR)
817  {
818  IfxVadc_initEmuxPin(emuxControl->emuxOutPinConfig.pins[count], emuxControl->emuxOutPinConfig.outputMode, emuxControl->emuxOutPinConfig.padDriver);
819  }
820  }
821 
822  IfxVadc_configExternalMultiplexerMode(vadc, vadcG, emuxControl->mode, emuxControl->channels, emuxControl->startChannel, emuxControl->code, emuxControl->sampleTimeControl, emuxControl->channelSelectionStyle);
823 }