Infineon MOTIX™ MCU TLE988x/9x Device Family SDK
gpt12.h
Go to the documentation of this file.
1 /*
2  ***********************************************************************************************************************
3  *
4  * Copyright (c) Infineon Technologies AG
5  * All rights reserved.
6  *
7  * The applicable license agreement can be found at this pack's installation directory in the file
8  * license/IFX_SW_Licence_MOTIX_LITIX.txt
9  *
10  **********************************************************************************************************************/
26 /* Generated by generate_functions_02_xlsx2func.py, version 0.9.0 on 15. Oct 2020
27  * from File 'gpt12.xlsx', version 0.2.0
28  */
29 
30 /*******************************************************************************
31 ** Author(s) Identity **
32 ********************************************************************************
33 ** Initials Name **
34 ** ---------------------------------------------------------------------------**
35 ** JO Julia Ott **
36 ** BG Blandine Guillot **
37 ** DM Daniel Mysliwitz **
38 *******************************************************************************/
39 
40 /*******************************************************************************
41 ** Revision Control History **
42 ********************************************************************************
43 ** V0.1.0: 2019-10-28, DM: Initial version **
44 ** V0.2.0: 2020-04-28, BG: Updated revision history format **
45 ** V0.3.0: 2020-04-28, BG: Added first functions **
46 ** V0.4.0: 2020-07-10, BG: Added inline functions list **
47 ** V0.4.1: 2020-09-16, BG: Added interrupt enable/disable functions **
48 ** V0.4.2: 2020-09-24, JO: EP-472: Added functions to start/stop the timers **
49 ** and get/set the timer value/CapRel value **
50 ** V0.5.0: 2020-09-25, JO: EP-475: Removed the GPT1 and GPT2 before Tx/CR **
51 ** in function names **
52 ** Renamed CR to CapRel in function names **
53 ** V0.5.1: 2020-10-06, BG: EP-492: Removed MISRA 2012 errors **
54 ** V0.5.2: 2020-10-15, JO: EP-523: Updated parameter names **
55 ** V0.5.3: 2020-10-20, BG: EP-532: Matched deprecated function names **
56 ** V0.5.4: 2020-10-21, BG: EP-539: Considered the enable checkbox in CW in **
57 ** the initialization function **
58 ** V0.5.5: 2020-11-12, JO: EP-590: Removed \param none and \return none to **
59 ** avoid doxygen warning **
60 ** V0.5.6: 2020-11-20, BG: EP-610: Corrected MISRA 2012 errors **
61 ** The following rules are globally deactivated: **
62 ** - Info 774: Boolean within 'if' always evaluates **
63 ** to False/True **
64 ** V0.5.7: 2020-12-18, BG: EP-652: Corrected name of error code variable **
65 ** V0.5.8: 2021-04-06, BG: EP-760: Replaced if instructions to check if the **
66 ** module is enabled with preprocessor directives to**
67 ** avoid compiler warnings **
68 ** V0.5.9: 2021-05-06, JO: EP-811: Corrected function name of function **
69 ** GPT12_disT2Int in declaration **
70 ** V0.6.0: 2021-10-07, BG: EP-920: Corrected frequency unit in the functions**
71 ** GPT12_setIntervalTimerT3/GPT12_setIntervalTimerT6**
72 ** so that the calculations of ticks are correct **
73 ** V0.6.1: 2021-11-12, JO: EP-937: Updated copyright and branding **
74 ** V0.6.2: 2022-04-25, JO: EP-1139: Corrected MISRA violations **
75 ** V0.6.3: 2024-11-05, JO: EP-1494: Updated license **
76 *******************************************************************************/
77 
78 #ifndef _GPT12_H
79 #define _GPT12_H
80 
81 /*******************************************************************************
82 ** Includes **
83 *******************************************************************************/
84 #include "tle_variants.h"
85 #include "types.h"
86 #include "tle989x.h"
87 #include "gpt12_defines.h"
88 #include "scu_defines.h"
89 
90 /*******************************************************************************
91 ** Global Macro Declarations **
92 *******************************************************************************/
93 
94 /*******************************************************************************
95 ** Global Type Declarations **
96 *******************************************************************************/
97 
98 /*******************************************************************************
99 ** Global Function Declarations **
100 *******************************************************************************/
101 
102 sint8 GPT12_init(void);
103 sint8 GPT12_setIntervalTimerT3(uint32 u32_timeInterval_us);
104 sint8 GPT12_setIntervalTimerT6(uint32 u32_timeInterval_us);
105 INLINE void GPT12_setCapRelVal(uint16 u16_value);
107 INLINE void GPT12_setT2Val(uint16 u16_value);
109 INLINE void GPT12_startT2(void);
110 INLINE void GPT12_stopT2(void);
111 INLINE void GPT12_setT3Val(uint16 u16_value);
113 INLINE void GPT12_startT3(void);
114 INLINE void GPT12_stopT3(void);
115 INLINE void GPT12_setT4Val(uint16 u16_value);
117 INLINE void GPT12_startT4(void);
118 INLINE void GPT12_stopT4(void);
119 INLINE void GPT12_setT5Val(uint16 u16_value);
121 INLINE void GPT12_startT5(void);
122 INLINE void GPT12_stopT5(void);
123 INLINE void GPT12_setT6Val(uint16 u16_value);
125 INLINE void GPT12_startT6(void);
126 INLINE void GPT12_stopT6(void);
127 INLINE void GPT12_enT2Int(void);
128 INLINE void GPT12_enT3Int(void);
129 INLINE void GPT12_enT4Int(void);
130 INLINE void GPT12_enT5Int(void);
131 INLINE void GPT12_enT6Int(void);
132 INLINE void GPT12_enCapRelInt(void);
133 INLINE void GPT12_disT2Int(void);
134 INLINE void GPT12_disT3Int(void);
135 INLINE void GPT12_disT4Int(void);
136 INLINE void GPT12_disT5Int(void);
137 INLINE void GPT12_disT6Int(void);
138 INLINE void GPT12_disCapRelInt(void);
145 INLINE void GPT12_clrT2IntSts(void);
146 INLINE void GPT12_clrT3IntSts(void);
147 INLINE void GPT12_clrT4IntSts(void);
148 INLINE void GPT12_clrT5IntSts(void);
149 INLINE void GPT12_clrT6IntSts(void);
150 INLINE void GPT12_clrCapRelIntSts(void);
151 
152 /*******************************************************************************
153 ** Deprecated Function Declarations **
154 *******************************************************************************/
155 
159 void GPT12_setT2IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
160 
164 void GPT12_setT3IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
165 
169 void GPT12_setT4IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
170 
174 void GPT12_setT5IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
175 
179 void GPT12_setT6IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
180 
184 void GPT12_setCapRelIntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
185 
186 /*******************************************************************************
187 ** Global Inline Function Definitions **
188 *******************************************************************************/
194 {
195  GPT12->CAPREL.bit.CAPREL = u16_value;
196 }
197 
203 {
204  return (uint16)GPT12->CAPREL.bit.CAPREL;
205 }
206 
211 INLINE void GPT12_setT2Val(uint16 u16_value)
212 {
213  GPT12->T2.bit.T2 = u16_value;
214 }
215 
221 {
222  return (uint16)GPT12->T2.bit.T2;
223 }
224 
228 {
229  GPT12->T2CON.bit.T2R = 1u;
230 }
231 
235 {
236  GPT12->T2CON.bit.T2R = 0u;
237 }
238 
243 INLINE void GPT12_setT3Val(uint16 u16_value)
244 {
245  GPT12->T3.bit.T3 = u16_value;
246 }
247 
253 {
254  return (uint16)GPT12->T3.bit.T3;
255 }
256 
260 {
261  GPT12->T3CON.bit.T3R = 1u;
262 }
263 
267 {
268  GPT12->T3CON.bit.T3R = 0u;
269 }
270 
275 INLINE void GPT12_setT4Val(uint16 u16_value)
276 {
277  GPT12->T4.bit.T4 = u16_value;
278 }
279 
285 {
286  return (uint16)GPT12->T4.bit.T4;
287 }
288 
292 {
293  GPT12->T4CON.bit.T4R = 1u;
294 }
295 
299 {
300  GPT12->T4CON.bit.T4R = 0u;
301 }
302 
307 INLINE void GPT12_setT5Val(uint16 u16_value)
308 {
309  GPT12->T5.bit.T5 = u16_value;
310 }
311 
317 {
318  return (uint16)GPT12->T5.bit.T5;
319 }
320 
324 {
325  GPT12->T5CON.bit.T5R = 1u;
326 }
327 
331 {
332  GPT12->T5CON.bit.T5R = 0u;
333 }
334 
339 INLINE void GPT12_setT6Val(uint16 u16_value)
340 {
341  GPT12->T6.bit.T6 = u16_value;
342 }
343 
349 {
350  return (uint16)GPT12->T6.bit.T6;
351 }
352 
356 {
357  GPT12->T6CON.bit.T6R = 1u;
358 }
359 
363 {
364  GPT12->T6CON.bit.T6R = 0u;
365 }
366 
370 {
371  SCU->GPTIEN.bit.GPT1T2EN = 1u;
372 }
373 
377 {
378  SCU->GPTIEN.bit.GPT1T3EN = 1u;
379 }
380 
384 {
385  SCU->GPTIEN.bit.GPT1T4EN = 1u;
386 }
387 
391 {
392  SCU->GPTIEN.bit.GPT2T5EN = 1u;
393 }
394 
398 {
399  SCU->GPTIEN.bit.GPT2T6EN = 1u;
400 }
401 
405 {
406  SCU->GPTIEN.bit.GPT2CREN = 1u;
407 }
408 
412 {
413  SCU->GPTIEN.bit.GPT1T2EN = 0u;
414 }
415 
419 {
420  SCU->GPTIEN.bit.GPT1T3EN = 0u;
421 }
422 
426 {
427  SCU->GPTIEN.bit.GPT1T4EN = 0u;
428 }
429 
433 {
434  SCU->GPTIEN.bit.GPT2T5EN = 0u;
435 }
436 
440 {
441  SCU->GPTIEN.bit.GPT2T6EN = 0u;
442 }
443 
447 {
448  SCU->GPTIEN.bit.GPT2CREN = 0u;
449 }
450 
456 {
457  return (uint8)SCU->GPTIS.bit.GPT1T2;
458 }
459 
465 {
466  return (uint8)SCU->GPTIS.bit.GPT1T3;
467 }
468 
474 {
475  return (uint8)SCU->GPTIS.bit.GPT1T4;
476 }
477 
483 {
484  return (uint8)SCU->GPTIS.bit.GPT2T5;
485 }
486 
492 {
493  return (uint8)SCU->GPTIS.bit.GPT2T6;
494 }
495 
501 {
502  return (uint8)SCU->GPTIS.bit.GPT2CR;
503 }
504 
508 {
509  SCU->GPTISC.bit.GPT1T2CLR = 1u;
510 }
511 
515 {
516  SCU->GPTISC.bit.GPT1T3CLR = 1u;
517 }
518 
522 {
523  SCU->GPTISC.bit.GPT1T4CLR = 1u;
524 }
525 
529 {
530  SCU->GPTISC.bit.GPT2T5CLR = 1u;
531 }
532 
536 {
537  SCU->GPTISC.bit.GPT2T6CLR = 1u;
538 }
539 
543 {
544  SCU->GPTISC.bit.GPT2CRCLR = 1u;
545 }
546 
549 #endif /* _GPT12_H */
#define GPT12
Definition: tle989x.h:24071
#define SCU
Definition: tle989x.h:24075
INLINE uint8 GPT12_getCapRelIntSts(void)
Get GPT2.CR Interrupt Status SCU.GPTIS.GPT2CR.
Definition: gpt12.h:500
INLINE void GPT12_setT6Val(uint16 u16_value)
Set Timer T6 Current Value.
Definition: gpt12.h:339
INLINE void GPT12_startT5(void)
Start Timer T5.
Definition: gpt12.h:323
INLINE void GPT12_startT4(void)
Start Timer T4.
Definition: gpt12.h:291
INLINE void GPT12_disT4Int(void)
Disable GPT1.T4 Interrupt.
Definition: gpt12.h:425
INLINE void GPT12_clrT6IntSts(void)
Clear GPT2.T6 Interrupt Status SCU.GPTISC.GPT2T6CLR.
Definition: gpt12.h:535
INLINE void GPT12_stopT5(void)
Stop Timer T5.
Definition: gpt12.h:330
INLINE void GPT12_clrT4IntSts(void)
Clear GPT1.T4 Interrupt Status SCU.GPTISC.GPT1T4CLR.
Definition: gpt12.h:521
void GPT12_setCapRelIntNodePtr(void) __attribute__((deprecated("Do not change this at runtime
Set GPT2 CAPREL Interrupt Node Pointer.
sint8 GPT12_init(void)
Initialize all CW registers of the general purpose timer 12 encoder.
Definition: gpt12.c:42
INLINE void GPT12_setCapRelVal(uint16 u16_value)
Set Current reload value or Captured value.
Definition: gpt12.h:193
INLINE void GPT12_stopT2(void)
Stop Timer T2.
Definition: gpt12.h:234
INLINE void GPT12_disT5Int(void)
Disable GPT2.T5 Interrupt.
Definition: gpt12.h:432
INLINE void GPT12_clrCapRelIntSts(void)
Clear GPT2.CR Interrupt Status SCU.GPTISC.GPT2CRCLR.
Definition: gpt12.h:542
INLINE uint8 GPT12_getT5IntSts(void)
Get GPT2.T5 Interrupt Status SCU.GPTIS.GPT2T5.
Definition: gpt12.h:482
void GPT12_setT5IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime
Set GPT2 T5 Interrupt Node Pointer.
INLINE void GPT12_disT2Int(void)
Disable GPT1.T2 Interrupt.
Definition: gpt12.h:411
INLINE uint16 GPT12_getT5Val(void)
Get Timer T5 Current Value.
Definition: gpt12.h:316
INLINE void GPT12_stopT6(void)
Stop Timer T6.
Definition: gpt12.h:362
INLINE void GPT12_stopT3(void)
Stop Timer T3.
Definition: gpt12.h:266
INLINE uint16 GPT12_getT6Val(void)
Get Timer T6 Current Value.
Definition: gpt12.h:348
INLINE void GPT12_disT6Int(void)
Disable GPT2.T6 Interrupt.
Definition: gpt12.h:439
INLINE void GPT12_enT2Int(void)
Enable GPT1.T2 Interrupt.
Definition: gpt12.h:369
INLINE void GPT12_setT2Val(uint16 u16_value)
Set Timer T2 Current Value.
Definition: gpt12.h:211
INLINE void GPT12_setT3Val(uint16 u16_value)
Set Timer T3 Current Value.
Definition: gpt12.h:243
INLINE uint16 GPT12_getT3Val(void)
Get Timer T3 Current Value.
Definition: gpt12.h:252
void GPT12_setT3IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime
Set GPT1 T3 Interrupt Node Pointer.
INLINE void GPT12_clrT2IntSts(void)
Clear GPT1.T2 Interrupt Status SCU.GPTISC.GPT1T2CLR.
Definition: gpt12.h:507
INLINE void GPT12_setT4Val(uint16 u16_value)
Set Timer T4 Current Value.
Definition: gpt12.h:275
INLINE void GPT12_enT5Int(void)
Enable GPT2.T5 Interrupt.
Definition: gpt12.h:390
void GPT12_setT6IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime
Set GPT2 T6 Interrupt Node Pointer.
INLINE void GPT12_startT3(void)
Start Timer T3.
Definition: gpt12.h:259
INLINE void GPT12_setT5Val(uint16 u16_value)
Set Timer T5 Current Value.
Definition: gpt12.h:307
INLINE void GPT12_enT4Int(void)
Enable GPT1.T4 Interrupt.
Definition: gpt12.h:383
INLINE uint16 GPT12_getT4Val(void)
Get Timer T4 Current Value.
Definition: gpt12.h:284
INLINE uint16 GPT12_getCapRelVal(void)
Get Current reload value or Captured value.
Definition: gpt12.h:202
INLINE void GPT12_stopT4(void)
Stop Timer T4.
Definition: gpt12.h:298
INLINE void GPT12_startT2(void)
Start Timer T2.
Definition: gpt12.h:227
INLINE void GPT12_startT6(void)
Start Timer T6.
Definition: gpt12.h:355
INLINE uint8 GPT12_getT2IntSts(void)
Get GPT1.T2 Interrupt Status SCU.GPTIS.GPT1T2.
Definition: gpt12.h:455
INLINE void GPT12_clrT3IntSts(void)
Clear GPT1.T3 Interrupt Status SCU.GPTISC.GPT1T3CLR.
Definition: gpt12.h:514
void GPT12_setT2IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime
Set GPT1 T2 Interrupt Node Pointer.
sint8 GPT12_setIntervalTimerT3(uint32 u32_timeInterval_us)
Define an interval timer with the core timer T3.
Definition: gpt12.c:69
INLINE void GPT12_disT3Int(void)
Disable GPT1.T3 Interrupt.
Definition: gpt12.h:418
INLINE uint8 GPT12_getT4IntSts(void)
Get GPT1.T4 Interrupt Status SCU.GPTIS.GPT1T4.
Definition: gpt12.h:473
INLINE uint8 GPT12_getT6IntSts(void)
Get GPT2.T6 Interrupt Status SCU.GPTIS.GPT2T6.
Definition: gpt12.h:491
INLINE void GPT12_enCapRelInt(void)
Enable GPT2.CR Interrupt.
Definition: gpt12.h:404
void GPT12_setT4IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime
Set GPT1 T4 Interrupt Node Pointer.
INLINE void GPT12_enT6Int(void)
Enable GPT2.T6 Interrupt.
Definition: gpt12.h:397
INLINE void GPT12_clrT5IntSts(void)
Clear GPT2.T5 Interrupt Status SCU.GPTISC.GPT2T5CLR.
Definition: gpt12.h:528
INLINE void GPT12_enT3Int(void)
Enable GPT1.T3 Interrupt.
Definition: gpt12.h:376
sint8 GPT12_setIntervalTimerT6(uint32 u32_timeInterval_us)
Define an interval timer with the core timer T6.
Definition: gpt12.c:122
INLINE uint16 GPT12_getT2Val(void)
Get Timer T2 Current Value.
Definition: gpt12.h:220
INLINE uint8 GPT12_getT3IntSts(void)
Get GPT1.T3 Interrupt Status SCU.GPTIS.GPT1T3.
Definition: gpt12.h:464
INLINE void GPT12_disCapRelInt(void)
Disable GPT2.CR Interrupt.
Definition: gpt12.h:446
__attribute__((noreturn))
Definition: startup_tle989x.c:193
Device specific memory layout defines and features.
General type declarations.
#define INLINE
Definition: types.h:151
uint8_t uint8
8 bit unsigned value
Definition: types.h:204
int8_t sint8
8 bit signed value
Definition: types.h:209
uint16_t uint16
16 bit unsigned value
Definition: types.h:205
uint32_t uint32
32 bit unsigned value
Definition: types.h:206