iLLD_TC27xC  1.0
Ifx_Types.h
Go to the documentation of this file.
1 /**
2  * \file Ifx_Types.h
3  * \brief This files defines all types used by the IFX HAL and libraries
4  *
5  * \version iLLD_1_0_0_11_0
6  * \copyright Copyright (c) 2013 Infineon Technologies AG. All rights reserved.
7  *
8  *
9  * IMPORTANT NOTICE
10  *
11  *
12  * Infineon Technologies AG (Infineon) is supplying this file for use
13  * exclusively with Infineon's microcontroller products. This file can be freely
14  * distributed within development tools that are supporting such microcontroller
15  * products.
16  *
17  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
18  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
19  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
20  * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
21  * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
22  *
23  */
24 
25 #ifndef IFX_TYPES_H
26 #define IFX_TYPES_H 1
27 
28 /******************************************************************************/
29 #include "Tricore/Compilers/Compilers.h" /* mapping compiler specific keywords */
30 #include "Platform_Types.h"
31 
32 /*******************************************************************************
33 ** Global Data Types **
34 ** (Types not defined by AUTOSAR) **
35 *******************************************************************************/
36 typedef signed long long sint64; /**< \brief -9223372036854775808 .. +9223372036854775807 */
37 typedef unsigned long long uint64; /**< \brief 0 .. 18446744073709551615 */
38 
39 typedef const char *pchar; /**< \brief const char pointer */
40 typedef void *pvoid; /**< \brief void pointer */
41 typedef volatile void *vvoid; /**< \brief volatile void pointer */
42 
43 typedef sint64 Ifx_TickTime; /**< \brief Time in ticks */
44 #define TIME_INFINITE ((Ifx_TickTime)0x7FFFFFFFFFFFFFFFLL)
45 #define TIME_NULL ((Ifx_TickTime)0x0000000000000000LL)
46 
47 #define IFX_ONES (0xFFFFFFFFFFFFFFFFU)
48 #define IFX_ZEROS (0x0000000000000000U)
49 
50 
51 #if CFG_LONG_SIZE_T
52 #define IFX_SIZET_MAX (0x7FFFFFFFL)
53 typedef sint32 Ifx_SizeT; /**< \brief Type used for data stream size */
54 #else
55 #define IFX_SIZET_MAX (0x7FFF)
56 typedef sint16 Ifx_SizeT; /**< \brief Type used for data stream size */
57 #endif
58 
59 /** \brief Circular buffer definition. */
60 typedef struct
61 {
62  void *base; /**< \brief buffer base address */
63  uint16 index; /**< \brief buffer current index */
64  uint16 length; /**< \brief buffer length*/
66 
67 typedef uint16 Ifx_Priority; /**< \brief Used in interrupt service priorities */
68 typedef uint32 Ifx_TimerValue; /**< \brief Used in timer values */
69 typedef sint32 Ifx_SignedTimerVal; /**< \brief Used in signed timer values */
70 
71 typedef pvoid Ifx_AddressValue; /**< \brief Used in address values */
72 
73 typedef struct
74 {
78 
79 /** \brief Signal active state definition. */
80 typedef enum
81 {
82  Ifx_ActiveState_low = 0, /**< \brief The signal is low active */
83  Ifx_ActiveState_high = 1 /**< \brief The signal is high active */
85 
86 typedef enum
87 {
91 
92 /** \brief input multiplexer definition used in PinMaps
93  */
94 typedef enum
95 {
104 } Ifx_RxSel;
105 
106 /** \brief Module address and index map */
107 typedef struct
108 {
109  volatile void *module; /**< \brief Module address */
110  sint32 index; /**< \brief Module index */
112 
113 typedef struct
114 {
118 
119 /*
120  * typedef struct
121  * {
122  * Ifx_TickTime timestamp;
123  * uint8 count[1]; // Number of valid data
124  * uint8 data[7];
125  * }Ifx_DataBufferMode_TimeStampBurst;
126  */
127 
128 typedef enum
129 {
130  Ifx_DataBufferMode_normal = 0, /**< \brief normal mode, each received byte is moved to the rx fifo */
131  Ifx_DataBufferMode_timeStampSingle, /**< \brief Single byte type stamp mode. The rx fifo is filled in with Ifx_DataBufferMode_TimeStampSingle items. */
132 // Ifx_DataBufferMode_timeStameBurst /**< \brief Burst byte type stamp mode. The rx fifo is filled in with Ifx_DataBufferMode_TimeStampBurst items. */
134 
135 /**
136  * Defines the PWM modes
137  *
138  * The 1st member shall start with value 0, and the next members value shall be the previous member +1
139  * pwmMode_off shall be the member with the higher index
140  */
141 typedef enum
142 {
143  Ifx_Pwm_Mode_centerAligned = 0, /**< \brief Center aligned mode */
144  Ifx_Pwm_Mode_centerAlignedInverted = 1, /**< \brief Center aligned inverted aligned mode */
145  Ifx_Pwm_Mode_leftAligned = 2, /**< \brief Left aligned mode */
146  Ifx_Pwm_Mode_rightAligned = 3, /**< \brief Right aligned mode */
147  Ifx_Pwm_Mode_off = 4, /**< \brief All switch open */
148  Ifx_Pwm_Mode_init = 5, /**< \brief Initialisation mode, do not use at run time */
149  Ifx_Pwm_Mode_count = 6 /**< \brief Number of modes */
150 } Ifx_Pwm_Mode;
151 
152 #ifdef __DCC__
153 #include "Ifx_TypesDcc.h"
154 
155 #elif defined(__TASKING__)
156 #include "Ifx_TypesTasking.h"
157 
158 #elif defined(__GNUC__)
159 #include "Ifx_TypesGnuc.h"
160 
161 #elif defined(__MSVC__)
162 #include "Ifx_TypesMsvc.h"
163 #else
164 #error Unsupported compiler.
165 #endif
166 
167 #define IFX_PI (3.1415926535897932384626433832795)
168 #define IFX_TWO_OVER_PI (2.0 / IFX_PI)
169 #define IFX_ONE_OVER_SQRT_THREE (0.57735026918962576450914878050196)
170 #define IFX_SQRT_TWO (1.4142135623730950488016887242097)
171 
172 #endif /* IFX_TYPES_H */