File: C:\Mariano\Temp\SLUG_Autopilot\Stable\controlMCUSlugsMKII_dspic\sources\rtwtypes.h1 /* 2 * File: rtwtypes.h 3 * 4 * Definitions required by Real-Time Workshop generated code. 5 * 6 * Real-Time Workshop version: 6.6 7 * Generated on: 2010-11-27 11:44:05 8 */ 9 10 #ifndef __RTWTYPES_H__ 11 #define __RTWTYPES_H__ 12 #ifndef TRUE 13 # define TRUE (1U) 14 #endif 15 16 #ifndef FALSE 17 # define FALSE (0U) 18 #endif 19 20 #ifndef __TMWTYPES__ 21 #define __TMWTYPES__ 22 #include <limits.h> 23 24 /*=======================================================================* 25 * Target hardware information 26 * Device type: 16-bit Generic 27 * Number of bits: char: 8 short: 16 int: 16 28 * long: 32 native word size: 16 29 * Byte ordering: LittleEndian 30 * Signed integer division rounds to: Undefined 31 * Shift right on a signed integer as arithmetic shift: on 32 *=======================================================================*/ 33 34 /*=======================================================================* 35 * Fixed width word size data types: * 36 * int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers * 37 * uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers * 38 * real32_T, real64_T - 32 and 64 bit floating point numbers * 39 *=======================================================================*/ 40 typedef signed char int8_T; 41 typedef unsigned char uint8_T; 42 typedef int int16_T; 43 typedef unsigned int uint16_T; 44 typedef long int32_T; 45 typedef unsigned long uint32_T; 46 typedef float real32_T; 47 typedef double real64_T; 48 49 /*===========================================================================* 50 * Generic type definitions: real_T, time_T, boolean_T, char_T, int_T, * 51 * uint_T and byte_T. * 52 *===========================================================================*/ 53 typedef double real_T; 54 typedef double time_T; 55 typedef unsigned char boolean_T; 56 typedef int int_T; 57 typedef unsigned int uint_T; 58 typedef char char_T; 59 typedef char_T byte_T; 60 61 /*===========================================================================* 62 * Complex number type definitions * 63 *===========================================================================*/ 64 #define CREAL_T 65 66 typedef struct { 67 real32_T re; 68 real32_T im; 69 } creal32_T; 70 71 typedef struct { 72 real64_T re; 73 real64_T im; 74 } creal64_T; 75 76 typedef struct { 77 real_T re; 78 real_T im; 79 } creal_T; 80 81 typedef struct { 82 int8_T re; 83 int8_T im; 84 } cint8_T; 85 86 typedef struct { 87 uint8_T re; 88 uint8_T im; 89 } cuint8_T; 90 91 typedef struct { 92 int16_T re; 93 int16_T im; 94 } cint16_T; 95 96 typedef struct { 97 uint16_T re; 98 uint16_T im; 99 } cuint16_T; 100 101 typedef struct { 102 int32_T re; 103 int32_T im; 104 } cint32_T; 105 106 typedef struct { 107 uint32_T re; 108 uint32_T im; 109 } cuint32_T; 110 111 /*=======================================================================* 112 * Min and Max: * 113 * int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers * 114 * uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers * 115 *=======================================================================*/ 116 #define MAX_int8_T ((int8_T)(127)) 117 #define MIN_int8_T ((int8_T)(-128)) 118 #define MAX_uint8_T ((uint8_T)(255U)) 119 #define MIN_uint8_T ((uint8_T)(0U)) 120 #define MAX_int16_T ((int16_T)(32767)) 121 #define MIN_int16_T ((int16_T)(-32768)) 122 #define MAX_uint16_T ((uint16_T)(65535U)) 123 #define MIN_uint16_T ((uint16_T)(0U)) 124 #define MAX_int32_T ((int32_T)(2147483647)) 125 #define MIN_int32_T ((int32_T)(-2147483647-1)) 126 #define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU)) 127 #define MIN_uint32_T ((uint32_T)(0U)) 128 129 /* Logical type definitions */ 130 #if !defined(__cplusplus) && !defined(__true_false_are_keywords) 131 # ifndef false 132 # define false (0U) 133 # endif 134 135 # ifndef true 136 # define true (1U) 137 # endif 138 #endif 139 140 /* 141 * Real-Time Workshop assumes the code is compiled on a target using a 2's compliment representation 142 * for signed integer values. 143 */ 144 #if ((SCHAR_MIN + 1) != -SCHAR_MAX) 145 #error "This code must be compiled using a 2's complement representation for signed integer values" 146 #endif 147 148 /* 149 * Maximum length of a MATLAB identifier (function/variable/model) 150 * including the null-termination character. Referenced by 151 * rt_logging.c and rt_matrx.c. 152 */ 153 #define TMW_NAME_LENGTH_MAX 64 154 155 /* This ID is used to detect inclusion of an incompatible rtwtypes.h */ 156 #define RTWTYPES_ID_C08S16I16L32N16F1 157 #else /* __TMWTYPES__ */ 158 #define TMWTYPES_PREVIOUSLY_INCLUDED 159 #endif /* __TMWTYPES__ */ 160 161 /* Block D-Work pointer type */ 162 typedef void * pointer_T; 163 164 /* Simulink specific types */ 165 #ifndef __SIMSTRUC_TYPES_H__ 166 #define __SIMSTRUC_TYPES_H__ 167 168 /* States of an enabled subsystem */ 169 typedef enum { 170 SUBSYS_DISABLED = 0, 171 SUBSYS_ENABLED = 2, 172 SUBSYS_BECOMING_DISABLED = 4, 173 SUBSYS_BECOMING_ENABLED = 8, 174 SUBSYS_TRIGGERED = 16 175 } CondStates; 176 177 /* Trigger directions: falling, either, and rising */ 178 typedef enum { 179 FALLING_ZERO_CROSSING = -1, 180 ANY_ZERO_CROSSING = 0, 181 RISING_ZERO_CROSSING = 1 182 } ZCDirection; 183 184 /* Previous state of a trigger signal */ 185 typedef enum { 186 NEG_ZCSIG = -1, 187 ZERO_ZCSIG = 0, 188 POS_ZCSIG = 1, 189 ZERO_RISING_EV_ZCSIG = 100, /* zero and had a rising event */ 190 ZERO_FALLING_EV_ZCSIG = 101, /* zero and had a falling event */ 191 UNINITIALIZED_ZCSIG = INT_MAX 192 } ZCSigState; 193 194 /* Current state of a trigger signal */ 195 typedef enum { 196 FALLING_ZCEVENT = -1, 197 NO_ZCEVENT = 0, 198 RISING_ZCEVENT = 1 199 } ZCEventType; 200 201 /* Enumeration of built-in data types */ 202 typedef enum { 203 SS_DOUBLE = 0, /* real_T */ 204 SS_SINGLE = 1, /* real32_T */ 205 SS_INT8 = 2, /* int8_T */ 206 SS_UINT8 = 3, /* uint8_T */ 207 SS_INT16 = 4, /* int16_T */ 208 SS_UINT16 = 5, /* uint16_T */ 209 SS_INT32 = 6, /* int32_T */ 210 SS_UINT32 = 7, /* uint32_T */ 211 SS_BOOLEAN = 8 /* boolean_T */ 212 } BuiltInDTypeId; 213 214 #define SS_NUM_BUILT_IN_DTYPE ((int_T)SS_BOOLEAN+1) 215 216 typedef int_T DTypeId; 217 218 #endif /* __SIMSTRUC_TYPES_H__ */ 219 #endif /* __RTWTYPES_H__ */ |