iLLD_TC27xC  1.0
IfxGtm_PinMap.c
Go to the documentation of this file.
1 /**
2  * \file IfxGtm_PinMap.c
3  * \brief GTM I/O map
4  * \ingroup IfxLld_Gtm
5  *
6  * \version iLLD_0_1_0_10
7  * \copyright Copyright (c) 2013 Infineon Technologies AG. All rights reserved.
8  *
9  *
10  * IMPORTANT NOTICE
11  *
12  *
13  * Infineon Technologies AG (Infineon) is supplying this file for use
14  * exclusively with Infineon's microcontroller products. This file can be freely
15  * distributed within development tools that are supporting such microcontroller
16  * products.
17  *
18  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
19  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
20  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
21  * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
22  * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
23  *
24  */
25 
26 #include "IfxGtm_PinMap.h"
27 
769 
770 #include "IfxGtm_bf.h"
771 
773 {
774  uint32 shift = config->channel * 4;
775 
776  __ldmst_c(&(MODULE_GTM.INOUTSEL.TIM[config->tim].INSEL.U), (0xFU << shift), ((uint32)config->select) << shift);
777 
778  if (inputMode != IfxPort_InputMode_undefined)
779  {
780  IfxPort_setPinModeInput(config->pin.port, config->pin.pinIndex, inputMode);
781  }
782 }
783 
785 {
786  uint32 outselReg = (config->toutn >> 4);
787  uint32 shift = (config->toutn & 0xFU) * 2;
788  uint32 outsel = (uint32)config->toutSel << shift;
789  uint32 mask = 0x3U << shift;
790 
791  __ldmst_c(&(MODULE_GTM.INOUTSEL.T.OUTSEL[outselReg].U), mask, outsel);
792  IfxPort_setPinModeOutput(config->pin.port, config->pin.pinIndex, outputMode, config->select);
793  IfxPort_setPinPadDriver(config->pin.port, config->pin.pinIndex, padDriver);
794 }
795 
797 {
798  uint32 outselReg = (config->toutn >> 4);
799  uint32 shift = (config->toutn & 0xFU) * 2;
800  uint32 outsel = (uint32)config->toutSel << shift;
801  uint32 mask = 0x3U << shift;
802 
803  __ldmst_c(&(MODULE_GTM.INOUTSEL.T.OUTSEL[outselReg].U), mask, outsel);
804  IfxPort_setPinModeOutput(config->pin.port, config->pin.pinIndex, outputMode, config->select);
805  IfxPort_setPinPadDriver(config->pin.port, config->pin.pinIndex, padDriver);
806 }