File: C:\Mariano\Temp\SLUG_Autopilot\Stable\controlMCUSlugsMKII_dspic\sources\controlMCUSlugsMKII_private.h1 /* 2 * File: controlMCUSlugsMKII_private.h 3 * 4 * Real-Time Workshop code generated for Simulink model controlMCUSlugsMKII. 5 * 6 * Model version : 1.716 7 * Real-Time Workshop file version : 6.6 (R2007a) 01-Feb-2007 8 * Real-Time Workshop file generated on : Sat Nov 27 11:43:56 2010 9 * TLC version : 6.6 (Jan 16 2007) 10 * C source code generated on : Sat Nov 27 11:43:58 2010 11 *-------------------------------------------------------------- 12 * Embedded Coder for Microchip dsPIC family. | 13 * Generate .c and .h files from your Matlab/simulink model | 14 * and compile the diagram to .hex and .coff file that can be | 15 * downloaded directly into the microcontroller | 16 * | 17 * Licence Accorded to Mariano I. Lizarraga | 18 * University of California Santa Cruz (UCSC)| 19 * | 20 * Written by Lubin KERHUEL - http://www.kerhuel.eu | 21 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 22 * Version 0.99b+ 17-Mar-2009 | 23 * For Matlab 7.4 R2007a | 24 *-------------------------------------------------------------- 25 */ 26 27 #ifndef _RTW_HEADER_controlMCUSlugsMKII_private_h_ 28 #define _RTW_HEADER_controlMCUSlugsMKII_private_h_ 29 #include "rtwtypes.h" 30 31 /* dsPIC library */ 32 #include "p33fxxxx.h" 33 #include "timer.h" 34 #define fcy 40000000 35 36 /* initialization Block: <S277>/Input Capture */ 37 #include <incap.h> 38 39 /*initialization Block: <S8>/PWM Servo Output*/ 40 #include "pwm.h" 41 # include "rtlibsrc.h" 42 #define CALL_EVENT (MAX_uint8_T) 43 44 /* Private macros used by the generated code to access rtModel */ 45 #ifndef rtmIsFirstInitCond 46 # define rtmIsFirstInitCond(rtm) (((controlMCUSlugsMKII_M->Timing.clockTick0) * 0.01 == (0.0))) 47 #endif 48 49 #ifndef UCHAR_MAX 50 #include <limits.h> 51 #endif 52 53 #if ( UCHAR_MAX != (0xFFU) ) || ( SCHAR_MAX != (0x7F) ) 54 #error Code was generated for compiler with different sized uchar/char. Consider adjusting Emulation Hardware word size settings on the Hardware Implementation pane to match your compiler word sizes as defined in the compilers limits.h header file. Alternatively, you can select 'None' for Emulation Hardware and select the 'Enable portable word sizes' option for ERT based targets, this will disable the preprocessor word size checks. 55 #endif 56 57 #if ( USHRT_MAX != (0xFFFFU) ) || ( SHRT_MAX != (0x7FFF) ) 58 #error Code was generated for compiler with different sized ushort/short. Consider adjusting Emulation Hardware word size settings on the Hardware Implementation pane to match your compiler word sizes as defined in the compilers limits.h header file. Alternatively, you can select 'None' for Emulation Hardware and select the 'Enable portable word sizes' option for ERT based targets, this will disable the preprocessor word size checks. 59 #endif 60 61 #if ( UINT_MAX != (0xFFFFU) ) || ( INT_MAX != (0x7FFF) ) 62 #error Code was generated for compiler with different sized uint/int. Consider adjusting Emulation Hardware word size settings on the Hardware Implementation pane to match your compiler word sizes as defined in the compilers limits.h header file. Alternatively, you can select 'None' for Emulation Hardware and select the 'Enable portable word sizes' option for ERT based targets, this will disable the preprocessor word size checks. 63 #endif 64 65 #if ( ULONG_MAX != (0xFFFFFFFFUL) ) || ( LONG_MAX != (0x7FFFFFFFL) ) 66 #error Code was generated for compiler with different sized ulong/long. Consider adjusting Emulation Hardware word size settings on the Hardware Implementation pane to match your compiler word sizes as defined in the compilers limits.h header file. Alternatively, you can select 'None' for Emulation Hardware and select the 'Enable portable word sizes' option for ERT based targets, this will disable the preprocessor word size checks. 67 #endif 68 69 #ifndef __RTWTYPES_H__ 70 #error This file requires rtwtypes.h to be included 71 #else 72 #ifdef TMWTYPES_PREVIOUSLY_INCLUDED 73 #error This file requires rtwtypes.h to be included before tmwtypes.h 74 #else 75 76 /* Check for inclusion of an incorrect version of rtwtypes.h */ 77 #ifndef RTWTYPES_ID_C08S16I16L32N16F1 78 #error This code was generated with a different "rtwtypes.h" than the file included 79 #endif /* RTWTYPES_ID_C08S16I16L32N16F1 */ 80 #endif /* TMWTYPES_PREVIOUSLY_INCLUDED */ 81 #endif /* __RTWTYPES_H__ */ 82 83 extern uint16_T CalculusTimeStep; /* Global Variable Used in <S11>/Calculus Time Step*/ 84 extern volatile uint16_T ic2up; 85 extern volatile uint16_T ic3up; 86 extern volatile uint16_T ic4up; 87 extern volatile uint16_T ic5up; 88 extern volatile uint16_T ic8up; 89 extern real32_T myExp(real32_T u1); 90 extern real32_T myExp(real32_T u1); 91 extern real32_T myTan(real32_T u1); 92 extern real32_T myAtan(real32_T u1); 93 extern real32_T myTan(real32_T u1); 94 extern real32_T myAtan(real32_T u1); 95 extern void getPidIdx(uint8_T u1,real32_T* y1); 96 extern void setNavLat(real32_T* u1); 97 extern void setDiagnosticShort(int16_T* u1); 98 extern real32_T myPow(real32_T u1, real32_T u2); 99 extern real32_T mySqrt(real32_T u1); 100 extern void setNavLong(real32_T* u1); 101 extern real32_T myCos(real32_T u1); 102 extern real32_T myAtan2(real32_T u1, real32_T u2); 103 extern real32_T mySqrt(real32_T u1); 104 extern real32_T myAtan2(real32_T u1, real32_T u2); 105 extern real32_T mySin(real32_T u1); 106 extern real32_T myCos(real32_T u1); 107 extern void getWP(uint8_T u1,real32_T* y1); 108 extern void getWP(uint8_T u1,real32_T* y1); 109 extern real32_T mySqrt(real32_T u1); 110 extern void getWP(uint8_T u1,real32_T* y1); 111 extern void getWP(uint8_T u1,real32_T* y1); 112 extern real32_T mySqrt(real32_T u1); 113 extern real32_T mySqrt(real32_T u1); 114 extern real32_T mySqrt(real32_T u1); 115 extern real32_T myAbs(real32_T u1); 116 extern real32_T mySqrt(real32_T u1); 117 extern real32_T mySqrt(real32_T u1); 118 extern real32_T myAsin(real32_T u1); 119 extern real32_T mySin(real32_T u1); 120 extern void setLogFloat2(real32_T* u1); 121 extern real32_T myAbs(real32_T u1); 122 extern real32_T myAbs(real32_T u1); 123 extern real32_T myAbs(real32_T u1); 124 extern void setNavNav(real32_T* u1); 125 extern void setLogFloat1(real32_T* u1); 126 extern real32_T myAtan(real32_T u1); 127 extern uint16_T meanFilter5(uint16_T* u1); 128 extern uint16_T meanFilter5(uint16_T* u1); 129 extern uint16_T meanFilter5(uint16_T* u1); 130 extern uint16_T meanFilter5(uint16_T* u1); 131 extern void setCurrentCommands(real32_T u1); 132 extern void getPassValues(uint8_T* y1); 133 extern uint8_T getApControlType(); 134 extern void gsRead(uint8_T* y1); 135 extern void readIpc(uint8_T* y1); 136 extern void protParseDecode(uint8_T* u1); 137 extern void protParseDecodeGS(uint8_T* u1); 138 extern void updateLoad(uint8_T u1); 139 extern void getMidLevelCommands(real32_T* y1); 140 extern real32_T getDynamic(); 141 extern void getPidIdx(uint8_T u1,real32_T* y1); 142 extern uint8_T isApManual(); 143 extern void getXYZ(real32_T* y1); 144 extern void getPidIdx(uint8_T u1,real32_T* y1); 145 extern void getPidIdx(uint8_T u1,real32_T* y1); 146 extern real32_T myCos(real32_T u1); 147 extern real32_T myCos(real32_T u1); 148 extern real32_T myCos(real32_T u1); 149 extern real32_T mySin(real32_T u1); 150 extern real32_T mySin(real32_T u1); 151 extern real32_T mySin(real32_T u1); 152 extern void getAttitude(real32_T* y1); 153 extern real32_T myCos(real32_T u1); 154 extern real32_T myCos(real32_T u1); 155 extern real32_T myCos(real32_T u1); 156 extern real32_T mySin(real32_T u1); 157 extern real32_T mySin(real32_T u1); 158 extern real32_T mySin(real32_T u1); 159 extern real32_T myAtan2(real32_T u1, real32_T u2); 160 extern real32_T myAsin(real32_T u1); 161 extern real32_T myAtan2(real32_T u1, real32_T u2); 162 extern void getPidIdx(uint8_T u1,real32_T* y1); 163 extern uint8_T isWpFly(); 164 extern uint8_T getMaxWp(); 165 extern void getVned(real32_T* y1); 166 extern void getPidIdx(uint8_T u1,real32_T* y1); 167 extern void getPidIdx(uint8_T u1,real32_T* y1); 168 extern void getPidIdx(uint8_T u1,real32_T* y1); 169 extern void getPidIdx(uint8_T u1,real32_T* y1); 170 extern real32_T myCos(real32_T u1); 171 extern real32_T mySin(real32_T u1); 172 extern void getPidIdx(uint8_T u1,real32_T* y1); 173 extern void getAccels(real32_T* y1); 174 extern void getAccBias(real32_T* y1); 175 extern void updatePWM(uint16_T* u1); 176 extern void updateEuler(real32_T* u1); 177 extern void updatePQR(real32_T* u1); 178 extern void prepareTelemetry(uint8_T* y1); 179 extern void send2GS(uint8_T* u1); 180 extern void setDiagnosticFloat(real32_T* u1); 181 extern void updatePWM2(uint16_T u1, uint8_T u2); 182 extern void updatePWM2(uint16_T u1, uint8_T u2); 183 extern void updatePWM2(uint16_T u1, uint8_T u2); 184 extern void updatePWM2(uint16_T u1, uint8_T u2); 185 extern void updatePWM2(uint16_T u1, uint8_T u2); 186 extern uint8_T getFilterOnOff(); 187 extern void controlMCUInit(); 188 void controlMCUSlugsM_negprotect(real32_T rtu_val, 189 rtB_negprotect_controlMCUSlugsM *localB); 190 void controlMCUSlugsMK_myMuxFun1(real32_T rtu_u1, real32_T rtu_u2, real32_T 191 rtu_u3, rtB_myMuxFun1_controlMCUSlugsMK *localB); 192 void cont_EmbeddedMATLABFunction(const real32_T rtu_x[3], const real32_T rtu_y[3], 193 rtB_EmbeddedMATLABFunction_cont *localB); 194 void controlMCUSlug_negprotect_e(real32_T rtu_val, 195 rtB_negprotect_controlMCUSlug_p *localB); 196 void co_EmbeddedMATLABFunction_a(const real32_T rtu_x[3], 197 rtB_EmbeddedMATLABFunction_co_e *localB); 198 void co_EmbeddedMATLABFunction_h(const real32_T rtu_x[3], 199 rtB_EmbeddedMATLABFunction_co_l *localB); 200 void controlMCUSlugs_myMuxFun1_a(uint16_T rtu_u1, uint16_T rtu_u2, uint16_T 201 rtu_u3, uint16_T rtu_u4, uint16_T rty_0[4]); 202 void controlMCUSlugs_myMuxFun1_n(real32_T rtu_u1, real32_T rtu_u2, real32_T 203 rtu_u3, real32_T rtu_u4, real32_T rtu_u5, real32_T rtu_u6, real32_T rtu_u7, 204 real32_T rtu_u8, real32_T rtu_u9, rtB_myMuxFun1_controlMCUSlugs_p *localB); 205 void controlMCUSlugs_myMuxFun1_o(real32_T rtu_u1, real32_T rtu_u2, real32_T 206 rtu_u3, rtB_myMuxFun1_controlMCUSlugs_b *localB); 207 208 #endif /* _RTW_HEADER_controlMCUSlugsMKII_private_h_ */ 209 210 /* File trailer for Real-Time Workshop generated code. 211 * 212 * [EOF] 213 */ |