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_0_1_0_10
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 ONES (0xFFFFFFFFFFFFFFFFU)
48 #define ZEROS (0x0000000000000000U)
49 
50 #if CFG_LONG_SIZE_T
51 #define IFX_SIZET_MAX (0x7FFFFFFFL)
52 typedef sint32 Ifx_SizeT; /**< \brief Type used for data stream size */
53 #else
54 #define IFX_SIZET_MAX (0x7FFF)
55 typedef sint16 Ifx_SizeT; /**< \brief Type used for data stream size */
56 #endif
57 
58 /** \brief Circular buffer definition. */
59 typedef struct
60 {
61  void *base; /**< \brief buffer base address */
62  uint16 index; /**< \brief buffer current index */
63  uint16 length; /**< \brief buffer length*/
65 
66 typedef uint16 Ifx_Priority; /**< \brief Used in interrupt service priorities */
67 typedef uint32 Ifx_TimerValue; /**< \brief Used in timer values */
68 typedef sint32 Ifx_SignedTimerVal; /**< \brief Used in signed timer values */
69 
70 typedef pvoid Ifx_AddressValue; /**< \brief Used in address values */
71 
72 typedef struct
73 {
77 
78 /** \brief Signal active state definition. */
79 typedef enum
80 {
81  Ifx_ActiveState_low = 0, /**< \brief The signal is low active */
82  Ifx_ActiveState_high = 1 /**< \brief The signal is high active */
84 
85 typedef enum
86 {
90 
91 /** \brief input multiplexer definition used in PinMaps
92  */
93 typedef enum
94 {
103 } Ifx_RxSel;
104 
105 /** \brief Module address and index map */
106 typedef struct
107 {
108  volatile void *module; /**< \brief Module address */
109  sint32 index; /**< \brief Module index */
111 
112 typedef struct
113 {
117 
118 /*
119  * typedef struct
120  * {
121  * Ifx_TickTime timestamp;
122  * uint8 count[1]; // Number of valid data
123  * uint8 data[7];
124  * }Ifx_DataBufferMode_TimeStampBurst;
125  */
126 
127 typedef enum
128 {
129  Ifx_DataBufferMode_normal = 0, /**< \brief normal mode, each received byte is moved to the rx fifo */
130  Ifx_DataBufferMode_timeStampSingle, /**< \brief Single byte type stamp mode. The rx fifo is filled in with Ifx_DataBufferMode_TimeStampSingle items. */
131 // Ifx_DataBufferMode_timeStameBurst /**< \brief Burst byte type stamp mode. The rx fifo is filled in with Ifx_DataBufferMode_TimeStampBurst items. */
133 
134 /**
135  * Defines the PWM modes
136  *
137  * The 1st member shall start with value 0, and the next members value shall be the previous member +1
138  * pwmMode_off shall be the member with the higher index
139  */
140 typedef enum
141 {
142  Ifx_Pwm_Mode_centerAligned = 0, /**< \brief Center aligned mode */
143  Ifx_Pwm_Mode_centerAlignedInverted = 1, /**< \brief Center aligned inverted aligned mode */
144  Ifx_Pwm_Mode_leftAligned = 2, /**< \brief Left aligned mode */
145  Ifx_Pwm_Mode_rightAligned = 3, /**< \brief Right aligned mode */
146  Ifx_Pwm_Mode_off = 4, /**< \brief All switch open */
147  Ifx_Pwm_Mode_init = 5 /**< \brief Initialisation mode, do not use at run time */
148 } Ifx_Pwm_Mode;
149 
150 #ifdef __DCC__
151 #include "Ifx_TypesDcc.h"
152 
153 #elif defined(__TASKING__)
154 #include "Ifx_TypesTasking.h"
155 
156 #elif defined(__GNUC__)
157 #include "Ifx_TypesGnuc.h"
158 
159 #elif defined(__MSVC__)
160 #include "Ifx_TypesMsvc.h"
161 #else
162 #error Unsupported compiler.
163 #endif
164 
165 #define IFX_PI (3.1415926535897932384626433832795)
166 #define IFX_TWO_OVER_PI (2.0 / IFX_PI)
167 #define IFX_ONE_OVER_SQRT_THREE (0.57735026918962576450914878050196)
168 #define IFX_SQRT_TWO (1.4142135623730950488016887242097)
169 
170 #endif /* IFX_TYPES_H */