TLE986x Device Family SDK
timer2x.h
Go to the documentation of this file.
1 /*
2  ***********************************************************************************************************************
3  *
4  * Copyright (c) 2015, Infineon Technologies AG
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification,are permitted provided that the
8  * following conditions are met:
9  *
10  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
11  * disclaimer.
12  *
13  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
14  * following disclaimer in the documentation and/or other materials provided with the distribution.
15  *
16  * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote
17  * products derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  **********************************************************************************************************************/
37 /*******************************************************************************
38 ** Author(s) Identity **
39 ********************************************************************************
40 ** Initials Name **
41 ** ---------------------------------------------------------------------------**
42 ** DM Daniel Mysliwitz **
43 ** JO Julia Ott **
44 ** TA Thomas Albersinger **
45 ** DCM Dragos C. Molocea **
46 ** BG Blandine Guillot **
47 *******************************************************************************/
48 
49 /*******************************************************************************
50 ** Revision Control History **
51 ********************************************************************************
52 ** V0.1.0: 2014-05-13, TA: Initial version **
53 ** V0.1.1: 2014-11-02, DM: Timer values init added **
54 ** V0.1.2: 2015-02-10, DM: Individual header file added **
55 ** V0.1.3: 2017-02-16, DM: Timer2/Timer21 prefix changed to capital letters **
56 ** Macros for Timer2x bit accesses added **
57 ** Set_Reload function added **
58 ** V0.1.4: 2017-05-26, DM: API extended **
59 ** V0.1.5: 2017-10-19, DM: MISRA 2012 compliance, the following PC-Lint **
60 ** rules are globally deactivated: **
61 ** - Info 793: ANSI/ISO limit of 6 'significant **
62 ** characters in an external identifier **
63 ** - Info 835: A zero has been given as right **
64 ** argument to operator **
65 ** - Info 845: The left argument to operator '&' **
66 ** is certain to be 0 **
67 ** Replaced macros by INLINE functions **
68 ** Replaced register accesses within functions by **
69 ** function calls **
70 ** Replaced __STATIC_INLINE by INLINE **
71 ** V0.1.6: 2018-06-27, DCM: Added handling in case of timer_interval_us **
72 ** value in invalid range **
73 ** V0.1.7: 2018-12-03, JO: Doxygen update, moved revision history from **
74 ** timer2x.c to timer2x.h **
75 ** Replaced __STATIC_INLINE by INLINE **
76 ** V0.1.8: 2020-02-28, BG: Updated revision history format **
77 ** V0.1.9: 2020-10-12, JO: EP-506: remove ARMCC v6 Compiler warnings **
78 ** - Added typecasts to remove 'implicit typecast' **
79 ** warning **
80 *******************************************************************************/
81 
82 #ifndef TIMER2X_H
83 #define TIMER2X_H
84 
85 /*******************************************************************************
86 ** Includes **
87 *******************************************************************************/
88 #include "tle986x.h"
89 #include "types.h"
90 #include "sfr_access.h"
91 
92 /*******************************************************************************
93 ** Global Type Definitions **
94 *******************************************************************************/
98 typedef enum
99 {
100  TIMER2_T2IN_P00 = 0u,
101  TIMER2_T2IN_P25 = 1u
103 
107 typedef enum
108 {
109  TIMER2_T2EX_LIN = 0u,
110  TIMER2_T2EX_P12 = 1u,
113 
117 typedef enum
118 {
119  TIMER21_T2IN_P01 = 0u,
120  TIMER21_T2IN_P11 = 1u,
121  TIMER21_T2IN_P04 = 2u
123 
127 typedef enum
128 {
130  TIMER21_T2EX_P14 = 1u,
131  TIMER21_T2EX_P23 = 2u,
132  TIMER21_T2EX_P12 = 3u,
135 
139 typedef enum
140 {
145  TIMER2x_Clk_Div_16 = 4u,
146  TIMER2x_Clk_Div_32 = 5u,
147  TIMER2x_Clk_Div_64 = 6u,
148  TIMER2x_Clk_Div_128 = 7u
150 
151 /*******************************************************************************
152 ** Global Macro Definitions **
153 *******************************************************************************/
154 #define MIN_TIMER_INTERVAL_US 1u
155 #define T2_REG_MAX_UPCOUNT_TICKS 0u
156 #define T2_REG_MIN_UPCOUNT_TICKS 0xFFFFu
157 
158 
159 /*******************************************************************************
160 ** Global Inline Function Definitions **
161 *******************************************************************************/
175 {
177 }
178 
192 {
194 }
195 
210 {
212 }
213 
232 {
234 }
235 
257 {
259 }
260 
281 {
283 }
284 
306 {
308 }
309 
327 {
329 }
330 
344 {
346 }
347 
361 {
363 }
364 
380 {
382 }
383 
399 {
401 }
402 
415 INLINE void TIMER2_UpDownCount_En(void)
416 {
418 }
419 
435 {
437 }
438 
453 {
455 }
456 
470 {
472 }
473 
487 {
489 }
490 
503 INLINE void TIMER2_Mode_Timer_Set(void)
504 {
506 }
507 
527 {
529 }
530 
550 {
552 }
553 
573 {
575 }
576 
596 {
598 }
599 
619 {
621 }
622 
642 {
644 }
645 
659 {
661 }
662 
676 {
678 }
679 
696 {
698 }
699 
718 {
720 }
721 
743 {
745 }
746 
767 {
769 }
770 
792 {
794 }
795 
813 {
815 }
816 
830 {
832 }
833 
847 {
849 }
850 
864 {
866 }
867 
881 {
883 }
884 
898 {
900 }
901 
917 {
919 }
920 
935 {
937 }
938 
952 {
954 }
955 
969 {
971 }
972 
986 {
988 }
989 
1009 {
1011 }
1012 
1032 {
1034 }
1035 
1055 {
1057 }
1058 
1078 {
1080 }
1081 
1101 {
1103 }
1104 
1105 
1125 {
1127 }
1128 
1129 /*******************************************************************************
1130 ** Global Function Declarations **
1131 *******************************************************************************/
1136 void TIMER2_Init(void);
1137 
1142 void TIMER21_Init(void);
1143 
1160 bool TIMER2_Interval_Timer_Setup(uint32 timer_interval_us);
1161 
1178 bool TIMER21_Interval_Timer_Setup(uint32 timer_interval_us);
1179 
1180 /*******************************************************************************
1181 ** Global Inline Function Declarations **
1182 *******************************************************************************/
1183 INLINE void TIMER2_Start(void);
1184 INLINE void TIMER2_Stop(void);
1185 INLINE void TIMER2_ExtStart(void);
1186 INLINE void TIMER2_ExtStop(void);
1191 INLINE void TIMER2_Clear_Count(void);
1192 INLINE void TIMER2_Set_Reload(uint16 value);
1195 INLINE void TIMER21_Start(void);
1196 INLINE void TIMER21_Stop(void);
1197 INLINE void TIMER21_ExtStart(void);
1198 INLINE void TIMER21_ExtStop(void);
1203 INLINE void TIMER21_Clear_Count(void);
1204 INLINE void TIMER21_Set_Reload(uint16 value);
1207 
1208 /*******************************************************************************
1209 ** Global Inline Function Definitions **
1210 *******************************************************************************/
1223 INLINE void TIMER2_Start(void)
1224 {
1226 }
1227 
1241 INLINE void TIMER2_Stop(void)
1242 {
1244 }
1245 
1260 INLINE void TIMER2_ExtStart(void)
1261 {
1263 }
1264 
1279 INLINE void TIMER2_ExtStop(void)
1280 {
1282 }
1283 
1300 {
1301  uint16 res;
1304  return (res);
1305 }
1306 
1324 {
1325  uint16 res;
1328  return (res);
1329 }
1330 
1348 {
1349  uint16 res;
1352  return (res);
1353 }
1354 
1372 {
1373  uint16 res;
1376  return (res);
1377 }
1378 
1392 INLINE void TIMER2_Clear_Count(void)
1393 {
1396 }
1397 
1413 INLINE void TIMER2_Set_Reload(uint16 value)
1414 {
1415  Field_Wrt8(&TIMER2->RC2H.reg, (uint8)TIMER2_RC2H_RC2_Pos, (uint8)TIMER2_RC2H_RC2_Msk, (uint8)(value >> 8u));
1416  Field_Wrt8(&TIMER2->RC2L.reg, (uint8)TIMER2_RC2L_RC2_Pos, (uint8)TIMER2_RC2L_RC2_Msk, (uint8)(value & (uint16)0xFFu));
1417 }
1418 
1434 {
1436 }
1437 
1453 {
1454  if (pinsel < TIMER2_T2EX_CCU6_CC60)
1455  {
1458  }
1459  else
1460  {
1462  }
1463 }
1464 
1477 INLINE void TIMER21_Start(void)
1478 {
1480 }
1481 
1495 INLINE void TIMER21_Stop(void)
1496 {
1498 }
1499 
1514 INLINE void TIMER21_ExtStart(void)
1515 {
1517 }
1518 
1533 INLINE void TIMER21_ExtStop(void)
1534 {
1536 }
1537 
1555 {
1556  uint16 res;
1559  return (res);
1560 }
1561 
1579 {
1580  uint16 res;
1583  return (res);
1584 }
1585 
1603 {
1604  uint16 res;
1607  return (res);
1608 }
1609 
1627 {
1628  uint16 res;
1631  return (res);
1632 }
1633 
1647 INLINE void TIMER21_Clear_Count(void)
1648 {
1651 }
1652 
1668 INLINE void TIMER21_Set_Reload(uint16 value)
1669 {
1672 }
1673 
1689 {
1691 }
1692 
1708 {
1709  if (pinsel < TIMER21_T2EX_CCU6_COUT60)
1710  {
1713  }
1714  else
1715  {
1717  }
1718 }
1719 
1735 {
1738 }
1739 
1756 {
1759 }
1760 
1776 {
1779 }
1780 
1797 {
1800 }
1801 
1802 #endif
TIMER2_RC2L_RC2_Pos
#define TIMER2_RC2L_RC2_Pos
Definition: tle986x.h:9703
TIMER2_External_Int_Dis
INLINE void TIMER2_External_Int_Dis(void)
Disables TIMER2 External Interrupt.
Definition: timer2x.h:635
TIMER2_ExtStop
INLINE void TIMER2_ExtStop(void)
disable TIMER2 to be started externally
Definition: timer2x.h:1270
TIMER2x_Clk_Div_4
Definition: timer2x.h:139
TIMER2x_Clk_Div_2
Definition: timer2x.h:138
TIMER21_T2MOD_T2PRE_Msk
#define TIMER21_T2MOD_T2PRE_Msk
Definition: tle986x.h:9792
TIMER21_UpDownCount_Dis
INLINE void TIMER21_UpDownCount_Dis(void)
Disables Up/Down Counter for TIMER21.
Definition: timer2x.h:910
TIMER2_Reload_Capture_RisingEdge_Set
INLINE void TIMER2_Reload_Capture_RisingEdge_Set(void)
sets Rising Edge to Capture/Reload Mode for TIMER2.
Definition: timer2x.h:337
TIMER21_Clk_Prescaler_Sel
INLINE void TIMER21_Clk_Prescaler_Sel(uint8 t2pre)
sets TIMER21 clock prescaler.
Definition: timer2x.h:689
SCU_MODPISEL2_T2EXIS_Msk
#define SCU_MODPISEL2_T2EXIS_Msk
Definition: tle986x.h:9033
TIMER21_T2CON_EXEN2_Msk
#define TIMER21_T2CON_EXEN2_Msk
Definition: tle986x.h:9767
TIMER2_T2MOD_EDGESEL_Pos
#define TIMER2_T2MOD_EDGESEL_Pos
Definition: tle986x.h:9741
TIMER21_T2MOD_PREN_Msk
#define TIMER21_T2MOD_PREN_Msk
Definition: tle986x.h:9794
TIMER2x_Clk_Div_64
Definition: timer2x.h:143
TIMER21_T2L_T2L_Pos
#define TIMER21_T2L_T2L_Pos
Definition: tle986x.h:9786
TIMER2_T2CON1_TF2EN_Msk
#define TIMER2_T2CON1_TF2EN_Msk
Definition: tle986x.h:9722
TIMER2_External_Sts
INLINE uint8 TIMER2_External_Sts(void)
reads TIMER2 External Status.
Definition: timer2x.h:274
TIMER21_T2IN_P01
Definition: timer2x.h:115
TIMER21_Overflow_Int_En
INLINE void TIMER21_Overflow_Int_En(void)
Enables TIMER21 Overflow Interrupt.
Definition: timer2x.h:1048
TIMER2_RC2H_RC2_Msk
#define TIMER2_RC2H_RC2_Msk
Definition: tle986x.h:9701
TIMER21_Clk_Prescaler_En
INLINE void TIMER21_Clk_Prescaler_En(void)
enables TIMER21 clock prescaler.
Definition: timer2x.h:652
types.h
General type declarations.
TIMER2_Reload_Capture_FallingEdge_Set
INLINE void TIMER2_Reload_Capture_FallingEdge_Set(void)
sets Falling Edge to Capture/Reload Mode for TIMER2.
Definition: timer2x.h:354
TIMER2_Clk_Prescaler_En
INLINE void TIMER2_Clk_Prescaler_En(void)
enables TIMER2 clock prescaler.
Definition: timer2x.h:168
TIMER21_T2CON_TR2_Msk
#define TIMER21_T2CON_TR2_Msk
Definition: tle986x.h:9765
TIMER21_T2CON_C_T2_Pos
#define TIMER21_T2CON_C_T2_Pos
Definition: tle986x.h:9762
TIMER2
#define TIMER2
Definition: tle986x.h:6008
TIMER2_ExternalCtrl_Dis
INLINE void TIMER2_ExternalCtrl_Dis(void)
disables TIMER2 External Control.
Definition: timer2x.h:320
TIMER2_Overflow_Int_Dis
INLINE void TIMER2_Overflow_Int_Dis(void)
Disables TIMER2 Overflow Interrupt.
Definition: timer2x.h:589
TIMER21_Capture_Value_Get
INLINE uint16 TIMER21_Capture_Value_Get(void)
reads the TIMER21 capture value
Definition: timer2x.h:1617
TIMER2_Overflow_Int_Clr
INLINE void TIMER2_Overflow_Int_Clr(void)
Clears TIMER2 Overflow Interrupt flag.
Definition: timer2x.h:520
TTIMER21_T2IN_Pxx
TTIMER21_T2IN_Pxx
This enum lists the T21IN Inputs.
Definition: timer2x.h:113
TIMER21_T2L_T2L_Msk
#define TIMER21_T2L_T2L_Msk
Definition: tle986x.h:9787
TTIMER21_T2EX_Pxx
TTIMER21_T2EX_Pxx
This enum lists the T21EX Inputs.
Definition: timer2x.h:123
TIMER21_UpDownCount_En
INLINE void TIMER21_UpDownCount_En(void)
enables Up/Down Counter for TIMER21.
Definition: timer2x.h:891
TIMER21_ExtStart
INLINE void TIMER21_ExtStart(void)
prepares TIMER21 to be started externally
Definition: timer2x.h:1505
TIMER21_External_Sts
INLINE uint8 TIMER21_External_Sts(void)
reads TIMER21 External Status.
Definition: timer2x.h:760
TIMER2_Clk_Prescaler_Get
INLINE uint8 TIMER2_Clk_Prescaler_Get(void)
reads TIMER2 clock prescaler.
Definition: timer2x.h:225
TIMER2_T2MOD_T2REGS_Pos
#define TIMER2_T2MOD_T2REGS_Pos
Definition: tle986x.h:9745
TIMER21_T2EX_P12
Definition: timer2x.h:128
TIMER2_T2CON_EXEN2_Msk
#define TIMER2_T2CON_EXEN2_Msk
Definition: tle986x.h:9713
TIMER2_Get_Capture
INLINE uint16 TIMER2_Get_Capture(void)
reads the TIMER2 capture value
Definition: timer2x.h:1338
TIMER2_Capture_Value_Get
INLINE uint16 TIMER2_Capture_Value_Get(void)
reads the TIMER2 capture value
Definition: timer2x.h:1362
TIMER2_Select_T2IN
INLINE void TIMER2_Select_T2IN(TTIMER2_T2IN_Pxx pinsel)
sets TIMER2 T2IN Pin
Definition: timer2x.h:1424
TIMER2_Set_Reload
INLINE void TIMER2_Set_Reload(uint16 value)
sets TIMER2 reload value
Definition: timer2x.h:1404
TIMER2x_Clk_Div_128
Definition: timer2x.h:144
TIMER2_T2CON1_EXF2EN_Pos
#define TIMER2_T2CON1_EXF2EN_Pos
Definition: tle986x.h:9719
TIMER21_T2MOD_EDGESEL_Msk
#define TIMER21_T2MOD_EDGESEL_Msk
Definition: tle986x.h:9796
TIMER21_T2MOD_DCEN_Msk
#define TIMER21_T2MOD_DCEN_Msk
Definition: tle986x.h:9790
TIMER2_Clk_Prescaler_Dis
INLINE void TIMER2_Clk_Prescaler_Dis(void)
disables TIMER2 clock prescaler.
Definition: timer2x.h:185
TIMER2_UpDownCount_En
INLINE void TIMER2_UpDownCount_En(void)
enables Up/Down Counter for TIMER2.
Definition: timer2x.h:409
TIMER21_T2IN_P11
Definition: timer2x.h:116
TIMER2_RC2H_RC2_Pos
#define TIMER2_RC2H_RC2_Pos
Definition: tle986x.h:9700
TIMER2_Mode_Reload_Set
INLINE void TIMER2_Mode_Reload_Set(void)
Selects Reload Mode for TIMER2.
Definition: timer2x.h:463
sfr_access.h
SFR low level access library.
TIMER21_T2CON_EXEN2_Pos
#define TIMER21_T2CON_EXEN2_Pos
Definition: tle986x.h:9766
TIMER2_T2H_T2H_Msk
#define TIMER2_T2H_T2H_Msk
Definition: tle986x.h:9725
SCU_MODPISEL1_T2EXCON_Pos
#define SCU_MODPISEL1_T2EXCON_Pos
Definition: tle986x.h:9025
INLINE
#define INLINE
Definition: types.h:134
Field_Mod8
INLINE void Field_Mod8(volatile uint8 *reg, uint8 pos, uint8 msk, uint8 val)
This function writes a bit field in a 8-bit register.
Definition: sfr_access.h:346
TIMER21_T2EX_P23
Definition: timer2x.h:127
u1_Field_Rd8
INLINE uint8 u1_Field_Rd8(const volatile uint8 *reg, uint8 pos, uint8 msk)
This function reads a 1-bit field of a 8-bit register.
Definition: sfr_access.h:391
TIMER2_T2IN_P25
Definition: timer2x.h:97
TIMER2_T2CON_TR2_Pos
#define TIMER2_T2CON_TR2_Pos
Definition: tle986x.h:9710
TIMER2_Value_Get
INLINE uint16 TIMER2_Value_Get(void)
reads the TIMER2 count value
Definition: timer2x.h:1314
TIMER2_Mode_Counter_Set
INLINE void TIMER2_Mode_Counter_Set(void)
Selects Mode Counter for TIMER2.
Definition: timer2x.h:480
TIMER2_Stop
INLINE void TIMER2_Stop(void)
stops the TIMER2 by software
Definition: timer2x.h:1232
TIMER21_Overflow_Int_Dis
INLINE void TIMER21_Overflow_Int_Dis(void)
Disables TIMER21 Overflow Interrupt.
Definition: timer2x.h:1071
TIMER2_External_Int_Clr
INLINE void TIMER2_External_Int_Clr(void)
Clears TIMER2 External Interrupt flag.
Definition: timer2x.h:543
TIMER21_Clk_Prescaler_Get
INLINE uint8 TIMER21_Clk_Prescaler_Get(void)
reads TIMER21 clock prescaler.
Definition: timer2x.h:711
TTIMER2_T2IN_Pxx
TTIMER2_T2IN_Pxx
This enum lists the T2IN Inputs.
Definition: timer2x.h:94
TIMER2_ExtStart_FallingEdge_Set
INLINE void TIMER2_ExtStart_FallingEdge_Set(void)
sets Falling Edge to External Start for TIMER2.
Definition: timer2x.h:392
TIMER21_Reload_Value_Set
INLINE void TIMER21_Reload_Value_Set(uint16 t21)
Sets TIMER21 Reload Value.
Definition: timer2x.h:1787
TIMER21
#define TIMER21
Definition: tle986x.h:6009
TIMER2x_Clk_Div_1
Definition: timer2x.h:137
TIMER2_T2CON_CP_RL2_Msk
#define TIMER2_T2CON_CP_RL2_Msk
Definition: tle986x.h:9707
uint16
unsigned short uint16
16 bit unsigned value
Definition: types.h:140
TIMER2_Mode_Timer_Set
INLINE void TIMER2_Mode_Timer_Set(void)
Selects Mode Timer for TIMER2.
Definition: timer2x.h:497
TIMER2x_Clock_Prescaler
TIMER2x_Clock_Prescaler
This enum lists TIMER2x Clock Prescaler Configuration.
Definition: timer2x.h:135
TIMER2_UpDownCount_Dis
INLINE void TIMER2_UpDownCount_Dis(void)
Disables Up/Down Counter for TIMER2.
Definition: timer2x.h:428
TIMER21_Value_Set
INLINE void TIMER21_Value_Set(uint16 t21)
Sets TIMER21 Value.
Definition: timer2x.h:1766
TIMER21_T2H_T2H_Pos
#define TIMER21_T2H_T2H_Pos
Definition: tle986x.h:9778
TIMER2_Mode_Capture_Set
INLINE void TIMER2_Mode_Capture_Set(void)
Selects Capture Mode for TIMER2.
Definition: timer2x.h:446
TIMER21_T2MOD_T2RHEN_Msk
#define TIMER21_T2MOD_T2RHEN_Msk
Definition: tle986x.h:9798
TIMER21_Reload_Capture_FallingEdge_Set
INLINE void TIMER21_Reload_Capture_FallingEdge_Set(void)
sets Falling Edge to Capture/Reload Mode for TIMER21.
Definition: timer2x.h:840
TIMER21_Overflow_Int_Clr
INLINE void TIMER21_Overflow_Int_Clr(void)
Clears TIMER21 Overflow Interrupt status.
Definition: timer2x.h:1002
SCU_MODPISEL2_T2EXIS_Pos
#define SCU_MODPISEL2_T2EXIS_Pos
Definition: tle986x.h:9032
TIMER21_T2EX_CCU6_COUT60
Definition: timer2x.h:129
TIMER2_T2EX_LIN
Definition: timer2x.h:105
TIMER21_Clear_Count
INLINE void TIMER21_Clear_Count(void)
clears the TIMER21 count value
Definition: timer2x.h:1638
TIMER21_External_Int_Dis
INLINE void TIMER21_External_Int_Dis(void)
Disables TIMER21 External Interrupt.
Definition: timer2x.h:1118
TIMER21_RC2H_RC2_Msk
#define TIMER21_RC2H_RC2_Msk
Definition: tle986x.h:9755
TIMER21_T2EX_P14
Definition: timer2x.h:126
TIMER21_ExternalCtrl_En
INLINE void TIMER21_ExternalCtrl_En(void)
enables TIMER21 External Control.
Definition: timer2x.h:785
TIMER2_T2CON_C_T2_Pos
#define TIMER2_T2CON_C_T2_Pos
Definition: tle986x.h:9708
TIMER2x_Clk_Div_32
Definition: timer2x.h:142
TIMER21_T2MOD_T2RHEN_Pos
#define TIMER21_T2MOD_T2RHEN_Pos
Definition: tle986x.h:9797
TIMER2_T2CON_TF2_Msk
#define TIMER2_T2CON_TF2_Msk
Definition: tle986x.h:9717
TIMER21_Interval_Timer_Setup
bool TIMER21_Interval_Timer_Setup(uint32 timer_interval_us)
Initializes the TIMER21 in Reload Mode.
SCU_MODPISEL2_T21IS_Msk
#define SCU_MODPISEL2_T21IS_Msk
Definition: tle986x.h:9035
TIMER21_T2IN_P04
Definition: timer2x.h:117
TIMER2_Interval_Timer_Setup
bool TIMER2_Interval_Timer_Setup(uint32 timer_interval_us)
Initializes the TIMER2 in Reload Mode.
TIMER21_T2EX_P02
Definition: timer2x.h:125
TIMER2_T2EX_P12
Definition: timer2x.h:106
TIMER2_T2H_T2H_Pos
#define TIMER2_T2H_T2H_Pos
Definition: tle986x.h:9724
TIMER21_RC2L_RC2_Pos
#define TIMER21_RC2L_RC2_Pos
Definition: tle986x.h:9757
TIMER2_T2EX_CCU6_CC60
Definition: timer2x.h:107
uint8
unsigned char uint8
8 bit unsigned value
Definition: types.h:139
TIMER21_T2CON_CP_RL2_Pos
#define TIMER21_T2CON_CP_RL2_Pos
Definition: tle986x.h:9760
TIMER2_T2MOD_T2RHEN_Msk
#define TIMER2_T2MOD_T2RHEN_Msk
Definition: tle986x.h:9744
TIMER2_Init
void TIMER2_Init(void)
Initializes the Timer2 module.
TIMER2_T2ICLR_TF2CLR_Pos
#define TIMER2_T2ICLR_TF2CLR_Pos
Definition: tle986x.h:9729
SCU_MODPISEL1_T2EXCON_Msk
#define SCU_MODPISEL1_T2EXCON_Msk
Definition: tle986x.h:9026
TIMER21_Init
void TIMER21_Init(void)
Initializes the Timer21 module.
TIMER21_Mode_Reload_Set
INLINE void TIMER21_Mode_Reload_Set(void)
Selects Reload Mode for TIMER21.
Definition: timer2x.h:945
TIMER21_T2MOD_PREN_Pos
#define TIMER21_T2MOD_PREN_Pos
Definition: tle986x.h:9793
TIMER2_T2CON_C_T2_Msk
#define TIMER2_T2CON_C_T2_Msk
Definition: tle986x.h:9709
TIMER2_T2MOD_PREN_Msk
#define TIMER2_T2MOD_PREN_Msk
Definition: tle986x.h:9740
TIMER2_T2IN_P00
Definition: timer2x.h:96
u8_Field_Rd8
INLINE uint8 u8_Field_Rd8(const volatile uint8 *reg, uint8 pos, uint8 msk)
This function reads a 8-bit field of a 8-bit register.
Definition: sfr_access.h:406
TIMER21_ExternalCtrl_Dis
INLINE void TIMER21_ExternalCtrl_Dis(void)
disables TIMER21 External Control.
Definition: timer2x.h:806
TIMER2_T2ICLR_EXF2CLR_Msk
#define TIMER2_T2ICLR_EXF2CLR_Msk
Definition: tle986x.h:9728
TIMER2_T2L_T2L_Msk
#define TIMER2_T2L_T2L_Msk
Definition: tle986x.h:9733
TIMER21_Stop
INLINE void TIMER21_Stop(void)
stops the TIMER21 by software
Definition: timer2x.h:1486
TIMER2_ExtStart
INLINE void TIMER2_ExtStart(void)
prepares TIMER2 to be started externally
Definition: timer2x.h:1251
uint32
unsigned int uint32
32 bit unsigned value
Definition: types.h:141
TIMER21_T2ICLR_TF2CLR_Pos
#define TIMER21_T2ICLR_TF2CLR_Pos
Definition: tle986x.h:9783
TIMER2_Reload_Value_Set
INLINE void TIMER2_Reload_Value_Set(uint16 t2)
Sets TIMER2 Reload Value.
Definition: timer2x.h:1746
TIMER2_T2CON_EXF2_Pos
#define TIMER2_T2CON_EXF2_Pos
Definition: tle986x.h:9714
TIMER2_T2MOD_T2RHEN_Pos
#define TIMER2_T2MOD_T2RHEN_Pos
Definition: tle986x.h:9743
TIMER21_Clk_Prescaler_Dis
INLINE void TIMER21_Clk_Prescaler_Dis(void)
disables TIMER21 clock prescaler.
Definition: timer2x.h:669
TIMER2_T2CON_TR2_Msk
#define TIMER2_T2CON_TR2_Msk
Definition: tle986x.h:9711
TIMER21_External_Int_En
INLINE void TIMER21_External_Int_En(void)
Enables TIMER21 External Interrupt.
Definition: timer2x.h:1094
TIMER2_Clear_Count
INLINE void TIMER2_Clear_Count(void)
clears the TIMER2 count value
Definition: timer2x.h:1383
TIMER21_T2MOD_EDGESEL_Pos
#define TIMER21_T2MOD_EDGESEL_Pos
Definition: tle986x.h:9795
TIMER2_External_Int_En
INLINE void TIMER2_External_Int_En(void)
Enables TIMER2 External Interrupt.
Definition: timer2x.h:612
TIMER2x_Clk_Div_8
Definition: timer2x.h:140
TIMER21_T2CON1_TF2EN_Msk
#define TIMER21_T2CON1_TF2EN_Msk
Definition: tle986x.h:9776
TIMER2_T2MOD_T2REGS_Msk
#define TIMER2_T2MOD_T2REGS_Msk
Definition: tle986x.h:9746
TIMER2_ExternalCtrl_En
INLINE void TIMER2_ExternalCtrl_En(void)
enables TIMER2 External Control.
Definition: timer2x.h:299
TIMER21_T2CON1_TF2EN_Pos
#define TIMER21_T2CON1_TF2EN_Pos
Definition: tle986x.h:9775
TIMER2_Clk_Prescaler_Sel
INLINE void TIMER2_Clk_Prescaler_Sel(uint8 t2pre)
sets TIMER2 clock prescaler.
Definition: timer2x.h:203
TIMER21_T2MOD_T2PRE_Pos
#define TIMER21_T2MOD_T2PRE_Pos
Definition: tle986x.h:9791
TIMER2_T2MOD_DCEN_Pos
#define TIMER2_T2MOD_DCEN_Pos
Definition: tle986x.h:9735
TIMER21_T2CON1_EXF2EN_Pos
#define TIMER21_T2CON1_EXF2EN_Pos
Definition: tle986x.h:9773
TIMER2_Start
INLINE void TIMER2_Start(void)
starts the TIMER2 by software
Definition: timer2x.h:1214
TIMER2_Value_Set
INLINE void TIMER2_Value_Set(uint16 t2)
Sets TIMER2 Value.
Definition: timer2x.h:1725
TIMER2_ExtStart_RisingEdge_Set
INLINE void TIMER2_ExtStart_RisingEdge_Set(void)
sets Rising Edge to External Start for TIMER2.
Definition: timer2x.h:373
TIMER21_T2CON_CP_RL2_Msk
#define TIMER21_T2CON_CP_RL2_Msk
Definition: tle986x.h:9761
TIMER21_T2MOD_T2REGS_Msk
#define TIMER21_T2MOD_T2REGS_Msk
Definition: tle986x.h:9800
TIMER21_T2CON1_EXF2EN_Msk
#define TIMER21_T2CON1_EXF2EN_Msk
Definition: tle986x.h:9774
tle986x.h
CMSIS register HeaderFile.
SCU
#define SCU
Definition: tle986x.h:6004
TIMER21_Overflow_Sts
INLINE uint8 TIMER21_Overflow_Sts(void)
reads TIMER21 Overflow Status.
Definition: timer2x.h:736
TIMER2_T2CON_EXF2_Msk
#define TIMER2_T2CON_EXF2_Msk
Definition: tle986x.h:9715
TIMER21_RC2L_RC2_Msk
#define TIMER21_RC2L_RC2_Msk
Definition: tle986x.h:9758
TIMER21_RC2H_RC2_Pos
#define TIMER21_RC2H_RC2_Pos
Definition: tle986x.h:9754
TIMER2_T2ICLR_TF2CLR_Msk
#define TIMER2_T2ICLR_TF2CLR_Msk
Definition: tle986x.h:9730
TIMER21_Mode_Counter_Set
INLINE void TIMER21_Mode_Counter_Set(void)
Selects Mode Counter for TIMER21.
Definition: timer2x.h:962
TTIMER2_T2EX_Pxx
TTIMER2_T2EX_Pxx
This enum lists the T2EX Inputs.
Definition: timer2x.h:103
SCU_MODPISEL1_T21EXCON_Msk
#define SCU_MODPISEL1_T21EXCON_Msk
Definition: tle986x.h:9024
TIMER2_T2CON_CP_RL2_Pos
#define TIMER2_T2CON_CP_RL2_Pos
Definition: tle986x.h:9706
TIMER21_Select_T2EX
INLINE void TIMER21_Select_T2EX(TTIMER21_T2EX_Pxx pinsel)
sets TIMER21 T2EX Pin
Definition: timer2x.h:1698
TIMER2_T2ICLR_EXF2CLR_Pos
#define TIMER2_T2ICLR_EXF2CLR_Pos
Definition: tle986x.h:9727
TIMER21_T2CON_EXF2_Pos
#define TIMER21_T2CON_EXF2_Pos
Definition: tle986x.h:9768
SCU_MODPISEL1_T21EXCON_Pos
#define SCU_MODPISEL1_T21EXCON_Pos
Definition: tle986x.h:9023
TIMER2_T2CON_EXEN2_Pos
#define TIMER2_T2CON_EXEN2_Pos
Definition: tle986x.h:9712
TIMER2_T2MOD_DCEN_Msk
#define TIMER2_T2MOD_DCEN_Msk
Definition: tle986x.h:9736
TIMER21_Mode_Capture_Set
INLINE void TIMER21_Mode_Capture_Set(void)
Selects Capture Mode for TIMER21.
Definition: timer2x.h:928
SCU_MODPISEL2_T2IS_Pos
#define SCU_MODPISEL2_T2IS_Pos
Definition: tle986x.h:9036
TIMER21_T2CON_TR2_Pos
#define TIMER21_T2CON_TR2_Pos
Definition: tle986x.h:9764
TIMER2_T2L_T2L_Pos
#define TIMER2_T2L_T2L_Pos
Definition: tle986x.h:9732
TIMER21_T2ICLR_EXF2CLR_Msk
#define TIMER21_T2ICLR_EXF2CLR_Msk
Definition: tle986x.h:9782
TIMER2_T2MOD_T2PRE_Msk
#define TIMER2_T2MOD_T2PRE_Msk
Definition: tle986x.h:9738
TIMER21_T2ICLR_EXF2CLR_Pos
#define TIMER21_T2ICLR_EXF2CLR_Pos
Definition: tle986x.h:9781
TIMER21_T2ICLR_TF2CLR_Msk
#define TIMER21_T2ICLR_TF2CLR_Msk
Definition: tle986x.h:9784
TIMER21_T2CON_C_T2_Msk
#define TIMER21_T2CON_C_T2_Msk
Definition: tle986x.h:9763
TIMER2_T2MOD_PREN_Pos
#define TIMER2_T2MOD_PREN_Pos
Definition: tle986x.h:9739
TIMER2_Get_Count
INLINE uint16 TIMER2_Get_Count(void)
reads the TIMER2 count value
Definition: timer2x.h:1290
TIMER21_Select_T2IN
INLINE void TIMER21_Select_T2IN(TTIMER21_T2IN_Pxx pinsel)
sets TIMER21 T2IN Pin
Definition: timer2x.h:1679
TIMER21_Mode_Timer_Set
INLINE void TIMER21_Mode_Timer_Set(void)
Selects Mode Timer for TIMER21.
Definition: timer2x.h:979
TIMER2_Select_T2EX
INLINE void TIMER2_Select_T2EX(TTIMER2_T2EX_Pxx pinsel)
sets TIMER2 T2EX Pin
Definition: timer2x.h:1443
TIMER21_T2CON_TF2_Msk
#define TIMER21_T2CON_TF2_Msk
Definition: tle986x.h:9771
SCU_MODPISEL2_T21EXIS_Msk
#define SCU_MODPISEL2_T21EXIS_Msk
Definition: tle986x.h:9031
TIMER2_RC2L_RC2_Msk
#define TIMER2_RC2L_RC2_Msk
Definition: tle986x.h:9704
TIMER21_Value_Get
INLINE uint16 TIMER21_Value_Get(void)
reads the TIMER21 count value
Definition: timer2x.h:1569
TIMER21_Get_Capture
INLINE uint16 TIMER21_Get_Capture(void)
reads the TIMER21 capture value
Definition: timer2x.h:1593
TIMER2_Overflow_Int_En
INLINE void TIMER2_Overflow_Int_En(void)
Enables TIMER2 Overflow Interrupt.
Definition: timer2x.h:566
TIMER21_T2CON_TF2_Pos
#define TIMER21_T2CON_TF2_Pos
Definition: tle986x.h:9770
SCU_MODPISEL2_T21IS_Pos
#define SCU_MODPISEL2_T21IS_Pos
Definition: tle986x.h:9034
TIMER21_T2CON_EXF2_Msk
#define TIMER21_T2CON_EXF2_Msk
Definition: tle986x.h:9769
TIMER21_T2H_T2H_Msk
#define TIMER21_T2H_T2H_Msk
Definition: tle986x.h:9779
TIMER21_Start
INLINE void TIMER21_Start(void)
starts the TIMER21 by software
Definition: timer2x.h:1468
TIMER2_T2CON1_EXF2EN_Msk
#define TIMER2_T2CON1_EXF2EN_Msk
Definition: tle986x.h:9720
Field_Wrt8
INLINE void Field_Wrt8(volatile uint8 *reg, uint8 pos, uint8 msk, uint8 val)
This function writes a bit field in a 8-bit register.
Definition: sfr_access.h:331
TIMER2_T2MOD_T2PRE_Pos
#define TIMER2_T2MOD_T2PRE_Pos
Definition: tle986x.h:9737
TIMER21_External_Int_Clr
INLINE void TIMER21_External_Int_Clr(void)
Clears TIMER21 External Interrupt status.
Definition: timer2x.h:1025
TIMER21_ExtStart_RisingEdge_Set
INLINE void TIMER21_ExtStart_RisingEdge_Set(void)
sets Rising Edge to External Start for TIMER21.
Definition: timer2x.h:857
SCU_MODPISEL2_T21EXIS_Pos
#define SCU_MODPISEL2_T21EXIS_Pos
Definition: tle986x.h:9030
TIMER21_Set_Reload
INLINE void TIMER21_Set_Reload(uint16 value)
sets TIMER21 reload value
Definition: timer2x.h:1659
TIMER2x_Clk_Div_16
Definition: timer2x.h:141
TIMER21_Reload_Capture_RisingEdge_Set
INLINE void TIMER21_Reload_Capture_RisingEdge_Set(void)
sets Rising Edge to Capture/Reload Mode for TIMER21.
Definition: timer2x.h:823
SCU_MODPISEL2_T2IS_Msk
#define SCU_MODPISEL2_T2IS_Msk
Definition: tle986x.h:9037
TIMER2_Overflow_Sts
INLINE uint8 TIMER2_Overflow_Sts(void)
reads TIMER2 Overflow Status.
Definition: timer2x.h:250
TIMER21_T2MOD_T2REGS_Pos
#define TIMER21_T2MOD_T2REGS_Pos
Definition: tle986x.h:9799
TIMER21_ExtStart_FallingEdge_Set
INLINE void TIMER21_ExtStart_FallingEdge_Set(void)
sets Falling Edge to External Start for TIMER21.
Definition: timer2x.h:874
TIMER2_T2CON_TF2_Pos
#define TIMER2_T2CON_TF2_Pos
Definition: tle986x.h:9716
TIMER2_T2CON1_TF2EN_Pos
#define TIMER2_T2CON1_TF2EN_Pos
Definition: tle986x.h:9721
TIMER21_ExtStop
INLINE void TIMER21_ExtStop(void)
disable TIMER21 to be started externally
Definition: timer2x.h:1524
TIMER21_Get_Count
INLINE uint16 TIMER21_Get_Count(void)
reads the TIMER21 count value
Definition: timer2x.h:1545
TIMER2_T2MOD_EDGESEL_Msk
#define TIMER2_T2MOD_EDGESEL_Msk
Definition: tle986x.h:9742
TIMER21_T2MOD_DCEN_Pos
#define TIMER21_T2MOD_DCEN_Pos
Definition: tle986x.h:9789