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  * 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  **********************************************************************************************************************/
28 
29 /* Generated by generate_functions_02_xlsx2func.py, version 0.9.0 on 15. Oct 2020
30  * from File 'gpt12.xlsx', version 0.2.0
31  */
32 
48 /*******************************************************************************
49 ** Author(s) Identity **
50 ********************************************************************************
51 ** Initials Name **
52 ** ---------------------------------------------------------------------------**
53 ** JO Julia Ott **
54 ** BG Blandine Guillot **
55 ** DM Daniel Mysliwitz **
56 *******************************************************************************/
57 
58 /*******************************************************************************
59 ** Revision Control History **
60 ********************************************************************************
61 ** V0.1.0: 2019-10-28, DM: Initial version **
62 ** V0.2.0: 2020-04-28, BG: Updated revision history format **
63 ** V0.3.0: 2020-04-28, BG: Added first functions **
64 ** V0.4.0: 2020-07-10, BG: Added inline functions list **
65 ** V0.4.1: 2020-09-16, BG: Added interrupt enable/disable functions **
66 ** V0.4.2: 2020-09-24, JO: EP-472: Added functions to start/stop the timers **
67 ** and get/set the timer value/CapRel value **
68 ** V0.5.0: 2020-09-25, JO: EP-475: Removed the GPT1 and GPT2 before Tx/CR **
69 ** in function names **
70 ** Renamed CR to CapRel in function names **
71 ** V0.5.1: 2020-10-06, BG: EP-492: Removed MISRA 2012 errors **
72 ** V0.5.2: 2020-10-15, JO: EP-523: Updated parameter names **
73 ** V0.5.3: 2020-10-20, BG: EP-532: Matched deprecated function names **
74 ** V0.5.4: 2020-10-21, BG: EP-539: Considered the enable checkbox in CW in **
75 ** the initialization function **
76 ** V0.5.5: 2020-11-12, JO: EP-590: Removed \param none and \return none to **
77 ** avoid doxygen warning **
78 ** V0.5.6: 2020-11-20, BG: EP-610: Corrected MISRA 2012 errors **
79 ** The following rules are globally deactivated: **
80 ** - Info 774: Boolean within 'if' always evaluates **
81 ** to False/True **
82 ** V0.5.7: 2020-12-18, BG: EP-652: Corrected name of error code variable **
83 ** V0.5.8: 2021-04-06, BG: EP-760: Replaced if instructions to check if the **
84 ** module is enabled with preprocessor directives to**
85 ** avoid compiler warnings **
86 ** V0.5.9: 2021-05-06, JO: EP-811: Corrected function name of function **
87 ** GPT12_disT2Int in declaration **
88 ** V0.6.0: 2021-10-07, BG: EP-920: Corrected frequency unit in the functions**
89 ** GPT12_setIntervalTimerT3/GPT12_setIntervalTimerT6**
90 ** so that the calculations of ticks are correct **
91 ** V0.6.1: 2021-11-12, JO: EP-937: Updated copyright and branding **
92 ** V0.6.2: 2022-04-25, JO: EP-1139: Corrected MISRA violations **
93 *******************************************************************************/
94 
95 #ifndef _GPT12_H
96 #define _GPT12_H
97 
98 /*******************************************************************************
99 ** Includes **
100 *******************************************************************************/
101 #include "tle_variants.h"
102 #include "types.h"
103 #include "tle989x.h"
104 #include "gpt12_defines.h"
105 #include "scu_defines.h"
106 
107 /*******************************************************************************
108 ** Global Macro Declarations **
109 *******************************************************************************/
110 
111 /*******************************************************************************
112 ** Global Type Declarations **
113 *******************************************************************************/
114 
115 /*******************************************************************************
116 ** Global Function Declarations **
117 *******************************************************************************/
118 
119 sint8 GPT12_init(void);
120 sint8 GPT12_setIntervalTimerT3(uint32 u32_timeInterval_us);
121 sint8 GPT12_setIntervalTimerT6(uint32 u32_timeInterval_us);
122 INLINE void GPT12_setCapRelVal(uint16 u16_value);
124 INLINE void GPT12_setT2Val(uint16 u16_value);
126 INLINE void GPT12_startT2(void);
127 INLINE void GPT12_stopT2(void);
128 INLINE void GPT12_setT3Val(uint16 u16_value);
130 INLINE void GPT12_startT3(void);
131 INLINE void GPT12_stopT3(void);
132 INLINE void GPT12_setT4Val(uint16 u16_value);
134 INLINE void GPT12_startT4(void);
135 INLINE void GPT12_stopT4(void);
136 INLINE void GPT12_setT5Val(uint16 u16_value);
138 INLINE void GPT12_startT5(void);
139 INLINE void GPT12_stopT5(void);
140 INLINE void GPT12_setT6Val(uint16 u16_value);
142 INLINE void GPT12_startT6(void);
143 INLINE void GPT12_stopT6(void);
144 INLINE void GPT12_enT2Int(void);
145 INLINE void GPT12_enT3Int(void);
146 INLINE void GPT12_enT4Int(void);
147 INLINE void GPT12_enT5Int(void);
148 INLINE void GPT12_enT6Int(void);
149 INLINE void GPT12_enCapRelInt(void);
150 INLINE void GPT12_disT2Int(void);
151 INLINE void GPT12_disT3Int(void);
152 INLINE void GPT12_disT4Int(void);
153 INLINE void GPT12_disT5Int(void);
154 INLINE void GPT12_disT6Int(void);
155 INLINE void GPT12_disCapRelInt(void);
162 INLINE void GPT12_clrT2IntSts(void);
163 INLINE void GPT12_clrT3IntSts(void);
164 INLINE void GPT12_clrT4IntSts(void);
165 INLINE void GPT12_clrT5IntSts(void);
166 INLINE void GPT12_clrT6IntSts(void);
167 INLINE void GPT12_clrCapRelIntSts(void);
168 
169 /*******************************************************************************
170 ** Deprecated Function Declarations **
171 *******************************************************************************/
172 
176 void GPT12_setT2IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
177 
181 void GPT12_setT3IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
182 
186 void GPT12_setT4IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
187 
191 void GPT12_setT5IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
192 
196 void GPT12_setT6IntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
197 
201 void GPT12_setCapRelIntNodePtr(void) __attribute__((deprecated("Do not change this at runtime, use the ConfigWizard to configure this feature!")));
202 
203 /*******************************************************************************
204 ** Global Inline Function Definitions **
205 *******************************************************************************/
211 {
212  GPT12->CAPREL.bit.CAPREL = u16_value;
213 }
214 
220 {
221  return (uint16)GPT12->CAPREL.bit.CAPREL;
222 }
223 
228 INLINE void GPT12_setT2Val(uint16 u16_value)
229 {
230  GPT12->T2.bit.T2 = u16_value;
231 }
232 
238 {
239  return (uint16)GPT12->T2.bit.T2;
240 }
241 
245 {
246  GPT12->T2CON.bit.T2R = 1u;
247 }
248 
252 {
253  GPT12->T2CON.bit.T2R = 0u;
254 }
255 
260 INLINE void GPT12_setT3Val(uint16 u16_value)
261 {
262  GPT12->T3.bit.T3 = u16_value;
263 }
264 
270 {
271  return (uint16)GPT12->T3.bit.T3;
272 }
273 
277 {
278  GPT12->T3CON.bit.T3R = 1u;
279 }
280 
284 {
285  GPT12->T3CON.bit.T3R = 0u;
286 }
287 
292 INLINE void GPT12_setT4Val(uint16 u16_value)
293 {
294  GPT12->T4.bit.T4 = u16_value;
295 }
296 
302 {
303  return (uint16)GPT12->T4.bit.T4;
304 }
305 
309 {
310  GPT12->T4CON.bit.T4R = 1u;
311 }
312 
316 {
317  GPT12->T4CON.bit.T4R = 0u;
318 }
319 
324 INLINE void GPT12_setT5Val(uint16 u16_value)
325 {
326  GPT12->T5.bit.T5 = u16_value;
327 }
328 
334 {
335  return (uint16)GPT12->T5.bit.T5;
336 }
337 
341 {
342  GPT12->T5CON.bit.T5R = 1u;
343 }
344 
348 {
349  GPT12->T5CON.bit.T5R = 0u;
350 }
351 
356 INLINE void GPT12_setT6Val(uint16 u16_value)
357 {
358  GPT12->T6.bit.T6 = u16_value;
359 }
360 
366 {
367  return (uint16)GPT12->T6.bit.T6;
368 }
369 
373 {
374  GPT12->T6CON.bit.T6R = 1u;
375 }
376 
380 {
381  GPT12->T6CON.bit.T6R = 0u;
382 }
383 
387 {
388  SCU->GPTIEN.bit.GPT1T2EN = 1u;
389 }
390 
394 {
395  SCU->GPTIEN.bit.GPT1T3EN = 1u;
396 }
397 
401 {
402  SCU->GPTIEN.bit.GPT1T4EN = 1u;
403 }
404 
408 {
409  SCU->GPTIEN.bit.GPT2T5EN = 1u;
410 }
411 
415 {
416  SCU->GPTIEN.bit.GPT2T6EN = 1u;
417 }
418 
422 {
423  SCU->GPTIEN.bit.GPT2CREN = 1u;
424 }
425 
429 {
430  SCU->GPTIEN.bit.GPT1T2EN = 0u;
431 }
432 
436 {
437  SCU->GPTIEN.bit.GPT1T3EN = 0u;
438 }
439 
443 {
444  SCU->GPTIEN.bit.GPT1T4EN = 0u;
445 }
446 
450 {
451  SCU->GPTIEN.bit.GPT2T5EN = 0u;
452 }
453 
457 {
458  SCU->GPTIEN.bit.GPT2T6EN = 0u;
459 }
460 
464 {
465  SCU->GPTIEN.bit.GPT2CREN = 0u;
466 }
467 
473 {
474  return (uint8)SCU->GPTIS.bit.GPT1T2;
475 }
476 
482 {
483  return (uint8)SCU->GPTIS.bit.GPT1T3;
484 }
485 
491 {
492  return (uint8)SCU->GPTIS.bit.GPT1T4;
493 }
494 
500 {
501  return (uint8)SCU->GPTIS.bit.GPT2T5;
502 }
503 
509 {
510  return (uint8)SCU->GPTIS.bit.GPT2T6;
511 }
512 
518 {
519  return (uint8)SCU->GPTIS.bit.GPT2CR;
520 }
521 
525 {
526  SCU->GPTISC.bit.GPT1T2CLR = 1u;
527 }
528 
532 {
533  SCU->GPTISC.bit.GPT1T3CLR = 1u;
534 }
535 
539 {
540  SCU->GPTISC.bit.GPT1T4CLR = 1u;
541 }
542 
546 {
547  SCU->GPTISC.bit.GPT2T5CLR = 1u;
548 }
549 
553 {
554  SCU->GPTISC.bit.GPT2T6CLR = 1u;
555 }
556 
560 {
561  SCU->GPTISC.bit.GPT2CRCLR = 1u;
562 }
563 
566 #endif /* _GPT12_H */
#define GPT12
Definition: internal/tle989x.h:25609
#define SCU
Definition: internal/tle989x.h:25613
INLINE uint8 GPT12_getCapRelIntSts(void)
Get GPT2.CR Interrupt Status SCU.GPTIS.GPT2CR.
Definition: gpt12.h:517
INLINE void GPT12_setT6Val(uint16 u16_value)
Set Timer T6 Current Value.
Definition: gpt12.h:356
INLINE void GPT12_startT5(void)
Start Timer T5.
Definition: gpt12.h:340
INLINE void GPT12_startT4(void)
Start Timer T4.
Definition: gpt12.h:308
INLINE void GPT12_disT4Int(void)
Disable GPT1.T4 Interrupt.
Definition: gpt12.h:442
INLINE void GPT12_clrT6IntSts(void)
Clear GPT2.T6 Interrupt Status SCU.GPTISC.GPT2T6CLR.
Definition: gpt12.h:552
INLINE void GPT12_stopT5(void)
Stop Timer T5.
Definition: gpt12.h:347
INLINE void GPT12_clrT4IntSts(void)
Clear GPT1.T4 Interrupt Status SCU.GPTISC.GPT1T4CLR.
Definition: gpt12.h:538
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:59
INLINE void GPT12_setCapRelVal(uint16 u16_value)
Set Current reload value or Captured value.
Definition: gpt12.h:210
INLINE void GPT12_stopT2(void)
Stop Timer T2.
Definition: gpt12.h:251
INLINE void GPT12_disT5Int(void)
Disable GPT2.T5 Interrupt.
Definition: gpt12.h:449
INLINE void GPT12_clrCapRelIntSts(void)
Clear GPT2.CR Interrupt Status SCU.GPTISC.GPT2CRCLR.
Definition: gpt12.h:559
INLINE uint8 GPT12_getT5IntSts(void)
Get GPT2.T5 Interrupt Status SCU.GPTIS.GPT2T5.
Definition: gpt12.h:499
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:428
INLINE uint16 GPT12_getT5Val(void)
Get Timer T5 Current Value.
Definition: gpt12.h:333
INLINE void GPT12_stopT6(void)
Stop Timer T6.
Definition: gpt12.h:379
INLINE void GPT12_stopT3(void)
Stop Timer T3.
Definition: gpt12.h:283
INLINE uint16 GPT12_getT6Val(void)
Get Timer T6 Current Value.
Definition: gpt12.h:365
INLINE void GPT12_disT6Int(void)
Disable GPT2.T6 Interrupt.
Definition: gpt12.h:456
INLINE void GPT12_enT2Int(void)
Enable GPT1.T2 Interrupt.
Definition: gpt12.h:386
INLINE void GPT12_setT2Val(uint16 u16_value)
Set Timer T2 Current Value.
Definition: gpt12.h:228
INLINE void GPT12_setT3Val(uint16 u16_value)
Set Timer T3 Current Value.
Definition: gpt12.h:260
INLINE uint16 GPT12_getT3Val(void)
Get Timer T3 Current Value.
Definition: gpt12.h:269
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:524
INLINE void GPT12_setT4Val(uint16 u16_value)
Set Timer T4 Current Value.
Definition: gpt12.h:292
INLINE void GPT12_enT5Int(void)
Enable GPT2.T5 Interrupt.
Definition: gpt12.h:407
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:276
INLINE void GPT12_setT5Val(uint16 u16_value)
Set Timer T5 Current Value.
Definition: gpt12.h:324
INLINE void GPT12_enT4Int(void)
Enable GPT1.T4 Interrupt.
Definition: gpt12.h:400
INLINE uint16 GPT12_getT4Val(void)
Get Timer T4 Current Value.
Definition: gpt12.h:301
INLINE uint16 GPT12_getCapRelVal(void)
Get Current reload value or Captured value.
Definition: gpt12.h:219
INLINE void GPT12_stopT4(void)
Stop Timer T4.
Definition: gpt12.h:315
INLINE void GPT12_startT2(void)
Start Timer T2.
Definition: gpt12.h:244
INLINE void GPT12_startT6(void)
Start Timer T6.
Definition: gpt12.h:372
INLINE uint8 GPT12_getT2IntSts(void)
Get GPT1.T2 Interrupt Status SCU.GPTIS.GPT1T2.
Definition: gpt12.h:472
INLINE void GPT12_clrT3IntSts(void)
Clear GPT1.T3 Interrupt Status SCU.GPTISC.GPT1T3CLR.
Definition: gpt12.h:531
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:86
INLINE void GPT12_disT3Int(void)
Disable GPT1.T3 Interrupt.
Definition: gpt12.h:435
INLINE uint8 GPT12_getT4IntSts(void)
Get GPT1.T4 Interrupt Status SCU.GPTIS.GPT1T4.
Definition: gpt12.h:490
INLINE uint8 GPT12_getT6IntSts(void)
Get GPT2.T6 Interrupt Status SCU.GPTIS.GPT2T6.
Definition: gpt12.h:508
INLINE void GPT12_enCapRelInt(void)
Enable GPT2.CR Interrupt.
Definition: gpt12.h:421
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:414
INLINE void GPT12_clrT5IntSts(void)
Clear GPT2.T5 Interrupt Status SCU.GPTISC.GPT2T5CLR.
Definition: gpt12.h:545
INLINE void GPT12_enT3Int(void)
Enable GPT1.T3 Interrupt.
Definition: gpt12.h:393
sint8 GPT12_setIntervalTimerT6(uint32 u32_timeInterval_us)
Define an interval timer with the core timer T6.
Definition: gpt12.c:139
INLINE uint16 GPT12_getT2Val(void)
Get Timer T2 Current Value.
Definition: gpt12.h:237
INLINE uint8 GPT12_getT3IntSts(void)
Get GPT1.T3 Interrupt Status SCU.GPTIS.GPT1T3.
Definition: gpt12.h:481
INLINE void GPT12_disCapRelInt(void)
Disable GPT2.CR Interrupt.
Definition: gpt12.h:463
__attribute__((noreturn))
Definition: startup_tle989x.c:221
Device specific memory layout defines and features.
General type declarations.
#define INLINE
Definition: types.h:167
uint8_t uint8
8 bit unsigned value
Definition: types.h:220
int8_t sint8
8 bit signed value
Definition: types.h:225
uint16_t uint16
16 bit unsigned value
Definition: types.h:221
uint32_t uint32
32 bit unsigned value
Definition: types.h:222