Infineon MOTIX™ MCU TLE987x Device Family SDK
types.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  **********************************************************************************************************************/
21 /*******************************************************************************
22 ** Author(s) Identity **
23 ********************************************************************************
24 ** **
25 ** Initials Name **
26 ** ---------------------------------------------------------------------------**
27 ** SS Steffen Storandt **
28 ** DM Daniel Mysliwitz **
29 ** JO Julia Ott **
30 ** BG Blandine Guillot **
31 ** PS Patrik Schwarz **
32 ** VO Vanessa Ongaro **
33 *******************************************************************************/
34 
35 /*******************************************************************************
36 ** Revision Control History **
37 ********************************************************************************
38 ** V0.1.0: 2012-11-12, SS: Initial version **
39 ** V0.2.0: 2012-12-13, SS: Formal changes **
40 ** V0.2.1: 2017-11-13, DM: Register access macros added **
41 ** V0.2.2: 2018-02-14, DM: MISRA 2012 compliance, the following PC-Lint **
42 ** rules are globally deactivated: **
43 ** - Info 793: ANSI/ISO limit of 6 'significant **
44 ** characters in an external identifier **
45 ** - Info 835: A zero has been given as right **
46 ** argument to operator **
47 ** - Info 845: The left argument to operator '&' **
48 ** is certain to be 0 **
49 ** Field_Rd1() return typecase changed to (uint8) **
50 ** V0.2.3: 2019-03-11, JO: Changed 'typedef signed long long int64' to **
51 ** 'typedef signed long long sint64' **
52 ** V0.2.4: 2019-09-12, JO: For ARM GCC compatibility: **
53 ** - Added #include <stdint.h> **
54 ** - Use intx_t for defining sintx **
55 ** - Use uintx_t for defining uint **
56 ** V0.2.5: 2020-04-15, BG: Updated revision history format **
57 ** V0.2.6: 2020-07-21, BG: EP-439: Formatted .h/.c files **
58 ** V0.2.7: 2020-07-28, JO: EP-431: Checked if __CC_ARM is defined before **
59 ** checking its value **
60 ** V0.2.8: 2021-06-30, BG: EP-855: Added "defined" in condition for IAR **
61 ** V0.2.9: 2022-02-28, JO: EP-936: Updated copyright and branding **
62 ** V0.3.0: 2022-10-18, PS: EP-1153: Replaced boolean type with bool **
63 ** V0.3.1: 2022-10-18, VO: EP-1252: Removed ARMCC V6.18 warnings, **
64 ** Added __inline for C90 support **
65 ** V0.3.2: 2025-01-02, JO: EP-1493: Updated license **
66 *******************************************************************************/
67 
68 #ifndef TYPES_H
69 #define TYPES_H
70 
71 #include <stdint.h>
72 
73 /*******************************************************************************
74 ** Includes **
75 *******************************************************************************/
76 
77 /*******************************************************************************
78 ** Global Macro Definitions **
79 *******************************************************************************/
82 #define STD_REAL_FIX_POINT_16 (1)
83 #define STD_REAL_FIX_POINT_32 (2)
84 #define STD_REAL_FLOAT_32 (3)
85 
86 #ifndef STD_REAL_TYPE
87  #define STD_REAL_TYPE (STD_REAL_FIX_POINT_16)
88 #endif
89 
92 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
93  #include <stdbool.h>
94 #else
95  #define bool unsigned int
96  #define true 1
97  #define false 0
98 #endif
99 
102 #define STD_REAL_SHIFT_Qn8_y (-8 - 1)
103 #define STD_REAL_SHIFT_Qn7_y (-7 - 1)
104 #define STD_REAL_SHIFT_Qn6_y (-6 - 1)
105 #define STD_REAL_SHIFT_Qn5_y (-5 - 1)
106 #define STD_REAL_SHIFT_Qn4_y (-4 - 1)
107 #define STD_REAL_SHIFT_Qn3_y (-3 - 1)
108 #define STD_REAL_SHIFT_Qn2_y (-2 - 1)
109 #define STD_REAL_SHIFT_Qn1_y (-1 - 1)
111 #define STD_REAL_SHIFT_Q0_y ( 0 - 1)
112 #define STD_REAL_SHIFT_Q1_y ( 1 - 1)
113 #define STD_REAL_SHIFT_Q2_y ( 2 - 1)
114 #define STD_REAL_SHIFT_Q3_y ( 3 - 1)
115 #define STD_REAL_SHIFT_Q4_y ( 4 - 1)
116 #define STD_REAL_SHIFT_Q5_y ( 5 - 1)
117 #define STD_REAL_SHIFT_Q6_y ( 6 - 1)
118 #define STD_REAL_SHIFT_Q7_y ( 7 - 1)
119 #define STD_REAL_SHIFT_Q8_y ( 8 - 1)
120 #define STD_REAL_SHIFT_Q9_y ( 9 - 1)
121 #define STD_REAL_SHIFT_Q10_y ( 10 - 1)
122 #define STD_REAL_SHIFT_Q11_y ( 11 - 1)
123 #define STD_REAL_SHIFT_Q12_y ( 12 - 1)
124 #define STD_REAL_SHIFT_Q13_y ( 13 - 1)
125 #define STD_REAL_SHIFT_Q14_y ( 14 - 1)
126 #define STD_REAL_SHIFT_Q15_y ( 15 - 1)
127 #define STD_REAL_SHIFT_Q16_y ( 16 - 1)
128 #define STD_REAL_SHIFT_Q32_y ( 32 - 1)
130 #define NULL_PTR ((void*)0)
131 
132 #define INLINE __STATIC_INLINE
133 
134 /*******************************************************************************
135 ** Global Type Definitions **
136 *******************************************************************************/
137 typedef uint8_t uint8;
138 typedef uint16_t uint16;
139 typedef uint32_t uint32;
140 typedef uint64_t uint64;
142 typedef int8_t sint8;
143 typedef int16_t sint16;
144 typedef int32_t sint32;
145 typedef int64_t sint64;
147 typedef float float32;
148 typedef double float64;
150 typedef short FixPoint16;
151 typedef long FixPoint32;
156 #if (STD_REAL_TYPE == STD_REAL_FIX_POINT_16)
159 #elif (STD_REAL_TYPE == STD_REAL_FIX_POINT_32)
160  typedef FixPoint32 TStdReal;
161  typedef FixPoint32 TLongStdReal;
162 #elif (STD_REAL_TYPE == STD_REAL_FLOAT_32)
163  typedef float32 TStdReal;
164  typedef float32 TLongStdReal;
165 #endif
166 
167 
170 typedef struct StdRealComplex
171 {
175 
178 typedef struct Complex
179 {
183 
186 typedef struct PhaseCurr
187 {
191 
192 #endif /* TYPES_H */
193 
Complex type definition.
Definition: types.h:179
sint16 Real
Real part.
Definition: types.h:180
sint16 Imag
Imaginary part.
Definition: types.h:181
2 phase currents type definition
Definition: types.h:187
sint16 A
Phase A current.
Definition: types.h:188
sint16 B
Phase B current.
Definition: types.h:189
Complex type definition based on TStdReal.
Definition: types.h:171
TStdReal imag
Imaginary part.
Definition: types.h:172
TStdReal real
Real part.
Definition: types.h:173
short FixPoint16
16 bit fix point value
Definition: types.h:150
FixPoint32 TLongStdReal
Definition: types.h:158
struct PhaseCurr TPhaseCurr
2 phase currents type definition
struct StdRealComplex TStdRealComplex
Complex type definition based on TStdReal.
double float64
64 bit float value
Definition: types.h:148
uint8_t uint8
8 bit unsigned value
Definition: types.h:137
long FixPoint32
32 bit fix point value
Definition: types.h:151
int8_t sint8
8 bit signed value
Definition: types.h:142
int64_t sint64
64 bit signed value
Definition: types.h:145
int32_t sint32
32 bit signed value
Definition: types.h:144
FixPoint16 TStdReal
Standard real type definitions to ease the use of different types.
Definition: types.h:157
struct Complex TComplex
Complex type definition.
int16_t sint16
16 bit signed value
Definition: types.h:143
float float32
32 bit float value
Definition: types.h:147
uint64_t uint64
64 bit unsigned value
Definition: types.h:140
uint16_t uint16
16 bit unsigned value
Definition: types.h:138
uint32_t uint32
32 bit unsigned value
Definition: types.h:139