| 1 | /* |
| 2 | * File: rtwtypes.h |
| 3 | * |
| 4 | * Code generated for Simulink model 'rtwdemo_pmsmfoc'. |
| 5 | * |
| 6 | * Model version : 1.2949 |
| 7 | * Simulink Coder version : 8.7 (R2014b) 11-Aug-2014 |
| 8 | * C/C++ source code generated on : Sat Oct 11 02:05:41 2014 |
| 9 | * |
| 10 | * Target selection: ert.tlc |
| 11 | * Embedded hardware selection: ARM Compatible->ARM Cortex |
| 12 | * Code generation objective: Execution efficiency |
| 13 | * Validation result: Not run |
| 14 | */ |
| 15 | |
| 16 | #ifndef __RTWTYPES_H__ |
| 17 | #define __RTWTYPES_H__ |
| 18 | |
| 19 | /* Logical type definitions */ |
| 20 | #if (!defined(__cplusplus)) |
| 21 | # ifndef false |
| 22 | # define false (0U) |
| 23 | # endif |
| 24 | |
| 25 | # ifndef true |
| 26 | # define true (1U) |
| 27 | # endif |
| 28 | #endif |
| 29 | |
| 30 | #define __TMWTYPES__ |
| 31 | |
| 32 | /*=======================================================================* |
| 33 | * Target hardware information |
| 34 | * Device type: ARM Compatible->ARM Cortex |
| 35 | * Number of bits: char: 8 short: 16 int: 32 |
| 36 | * long: 32 |
| 37 | * native word size: 32 |
| 38 | * Byte ordering: LittleEndian |
| 39 | * Signed integer division rounds to: Undefined |
| 40 | * Shift right on a signed integer as arithmetic shift: on |
| 41 | *=======================================================================*/ |
| 42 | #ifdef PORTABLE_WORDSIZES /* PORTABLE_WORDSIZES defined */ |
| 43 | |
| 44 | /*=======================================================================* |
| 45 | * Host information |
| 46 | * Number of bits: char: 8 short: 16 int: 32 |
| 47 | * long: 32 |
| 48 | * long long: 64 |
| 49 | * native word size: 32 |
| 50 | *=======================================================================*/ |
| 51 | |
| 52 | /*=======================================================================* |
| 53 | * Fixed width word size data types: * |
| 54 | * int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers * |
| 55 | * uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers * |
| 56 | * real32_T, real64_T - 32 and 64 bit floating point numbers * |
| 57 | *=======================================================================*/ |
| 58 | typedef signed char int8_T; |
| 59 | typedef unsigned char uint8_T; |
| 60 | typedef short int16_T; |
| 61 | typedef unsigned short uint16_T; |
| 62 | typedef int int32_T; |
| 63 | typedef unsigned int uint32_T; |
| 64 | typedef float real32_T; |
| 65 | typedef double real64_T; |
| 66 | |
| 67 | /*===========================================================================* |
| 68 | * Generic type definitions: real_T, time_T, boolean_T, int_T, uint_T, * |
| 69 | * ulong_T, char_T , ulonglong_T and byte_T. * |
| 70 | *===========================================================================*/ |
| 71 | typedef double real_T; |
| 72 | typedef double time_T; |
| 73 | typedef unsigned char boolean_T; |
| 74 | typedef int int_T; |
| 75 | typedef unsigned int uint_T; |
| 76 | typedef unsigned int ulong_T; |
| 77 | typedef char char_T; |
| 78 | typedef unsigned char uchar_T; |
| 79 | typedef char_T byte_T; |
| 80 | |
| 81 | #else /* PORTABLE_WORDSIZES not defined */ |
| 82 | |
| 83 | /*=======================================================================* |
| 84 | * Fixed width word size data types: * |
| 85 | * int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers * |
| 86 | * uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers * |
| 87 | * real32_T, real64_T - 32 and 64 bit floating point numbers * |
| 88 | *=======================================================================*/ |
| 89 | typedef signed char int8_T; |
| 90 | typedef unsigned char uint8_T; |
| 91 | typedef short int16_T; |
| 92 | typedef unsigned short uint16_T; |
| 93 | typedef int int32_T; |
| 94 | typedef unsigned int uint32_T; |
| 95 | typedef float real32_T; |
| 96 | typedef double real64_T; |
| 97 | |
| 98 | /*===========================================================================* |
| 99 | * Generic type definitions: real_T, time_T, boolean_T, int_T, uint_T, * |
| 100 | * ulong_T, char_T and byte_T. * |
| 101 | *===========================================================================*/ |
| 102 | typedef double real_T; |
| 103 | typedef double time_T; |
| 104 | typedef unsigned char boolean_T; |
| 105 | typedef int int_T; |
| 106 | typedef unsigned int uint_T; |
| 107 | typedef unsigned long ulong_T; |
| 108 | typedef char char_T; |
| 109 | typedef unsigned char uchar_T; |
| 110 | typedef char_T byte_T; |
| 111 | |
| 112 | #endif /* PORTABLE_WORDSIZES */ |
| 113 | |
| 114 | /*===========================================================================* |
| 115 | * Complex number type definitions * |
| 116 | *===========================================================================*/ |
| 117 | #define CREAL_T |
| 118 | |
| 119 | typedef struct { |
| 120 | real32_T re; |
| 121 | real32_T im; |
| 122 | } creal32_T; |
| 123 | |
| 124 | typedef struct { |
| 125 | real64_T re; |
| 126 | real64_T im; |
| 127 | } creal64_T; |
| 128 | |
| 129 | typedef struct { |
| 130 | real_T re; |
| 131 | real_T im; |
| 132 | } creal_T; |
| 133 | |
| 134 | #define CINT8_T |
| 135 | |
| 136 | typedef struct { |
| 137 | int8_T re; |
| 138 | int8_T im; |
| 139 | } cint8_T; |
| 140 | |
| 141 | #define CUINT8_T |
| 142 | |
| 143 | typedef struct { |
| 144 | uint8_T re; |
| 145 | uint8_T im; |
| 146 | } cuint8_T; |
| 147 | |
| 148 | #define CINT16_T |
| 149 | |
| 150 | typedef struct { |
| 151 | int16_T re; |
| 152 | int16_T im; |
| 153 | } cint16_T; |
| 154 | |
| 155 | #define CUINT16_T |
| 156 | |
| 157 | typedef struct { |
| 158 | uint16_T re; |
| 159 | uint16_T im; |
| 160 | } cuint16_T; |
| 161 | |
| 162 | #define CINT32_T |
| 163 | |
| 164 | typedef struct { |
| 165 | int32_T re; |
| 166 | int32_T im; |
| 167 | } cint32_T; |
| 168 | |
| 169 | #define CUINT32_T |
| 170 | |
| 171 | typedef struct { |
| 172 | uint32_T re; |
| 173 | uint32_T im; |
| 174 | } cuint32_T; |
| 175 | |
| 176 | /*=======================================================================* |
| 177 | * Min and Max: * |
| 178 | * int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers * |
| 179 | * uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers * |
| 180 | *=======================================================================*/ |
| 181 | #define MAX_int8_T ((int8_T)(127)) |
| 182 | #define MIN_int8_T ((int8_T)(-128)) |
| 183 | #define MAX_uint8_T ((uint8_T)(255U)) |
| 184 | #define MIN_uint8_T ((uint8_T)(0U)) |
| 185 | #define MAX_int16_T ((int16_T)(32767)) |
| 186 | #define MIN_int16_T ((int16_T)(-32768)) |
| 187 | #define MAX_uint16_T ((uint16_T)(65535U)) |
| 188 | #define MIN_uint16_T ((uint16_T)(0U)) |
| 189 | #define MAX_int32_T ((int32_T)(2147483647)) |
| 190 | #define MIN_int32_T ((int32_T)(-2147483647-1)) |
| 191 | #define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU)) |
| 192 | #define MIN_uint32_T ((uint32_T)(0U)) |
| 193 | |
| 194 | /* Block D-Work pointer type */ |
| 195 | typedef void * pointer_T; |
| 196 | |
| 197 | /* Simulink specific types */ |
| 198 | #ifndef __ZERO_CROSSING_TYPES__ |
| 199 | #define __ZERO_CROSSING_TYPES__ |
| 200 | |
| 201 | /* Trigger directions: falling, either, and rising */ |
| 202 | typedef enum { |
| 203 | FALLING_ZERO_CROSSING = -1, |
| 204 | ANY_ZERO_CROSSING = 0, |
| 205 | RISING_ZERO_CROSSING = 1 |
| 206 | } ZCDirection; |
| 207 | |
| 208 | /* Previous state of a trigger signal */ |
| 209 | typedef uint8_T ZCSigState; |
| 210 | |
| 211 | /* Initial value of a trigger zero crossing signal */ |
| 212 | #define UNINITIALIZED_ZCSIG 0x03U |
| 213 | #define NEG_ZCSIG 0x02U |
| 214 | #define POS_ZCSIG 0x01U |
| 215 | #define ZERO_ZCSIG 0x00U |
| 216 | |
| 217 | /* Current state of a trigger signal */ |
| 218 | typedef enum { |
| 219 | FALLING_ZCEVENT = -1, |
| 220 | NO_ZCEVENT = 0, |
| 221 | RISING_ZCEVENT = 1 |
| 222 | } ZCEventType; |
| 223 | |
| 224 | #endif /* __ZERO_CROSSING_TYPES__ */ |
| 225 | #endif /* __RTWTYPES_H__ */ |
| 226 | |
| 227 | /* |
| 228 | * File trailer for generated code. |
| 229 | * |
| 230 | * [EOF] |
| 231 | */ |
| 232 | |