![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fork
Fork of LG by
Command.c@136:19b9e6abb86f, 2016-04-15 (annotated)
- Committer:
- Kovalev_D
- Date:
- Fri Apr 15 14:20:15 2016 +0000
- Revision:
- 136:19b9e6abb86f
- Parent:
- 131:ef5973569c02
- Child:
- 137:8b99cf0842f9
- Child:
- 145:f023b2f18b82
flash
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 0:8ad47e2b6f00 | 1 | #include "stdlib.h" |
igor_v | 0:8ad47e2b6f00 | 2 | #include "LPC17xx.h" |
igor_v | 0:8ad47e2b6f00 | 3 | #include "Global.h" |
Kovalev_D | 106:250ddd8629c6 | 4 | int tempNH,tempNL; |
igor_v | 0:8ad47e2b6f00 | 5 | unsigned int Rate_Flag; |
igor_v | 0:8ad47e2b6f00 | 6 | unsigned int CountBuFFIn; |
igor_v | 21:bc8c1cec3da6 | 7 | unsigned int N=0,CRC_N; |
igor_v | 21:bc8c1cec3da6 | 8 | unsigned int Param1=0; |
igor_v | 21:bc8c1cec3da6 | 9 | unsigned int Param2=0; |
igor_v | 21:bc8c1cec3da6 | 10 | unsigned int Param3=0; |
igor_v | 21:bc8c1cec3da6 | 11 | unsigned int Param4=0; |
Kovalev_D | 102:4270092be987 | 12 | unsigned int Consol=123; |
Kovalev_D | 121:bbae560cdd43 | 13 | unsigned int TempParam=1; |
Kovalev_D | 124:9ae09249f842 | 14 | unsigned int CountParam=0; |
Kovalev_D | 129:406995a91322 | 15 | |
Kovalev_D | 131:ef5973569c02 | 16 | |
Kovalev_D | 136:19b9e6abb86f | 17 | |
Kovalev_D | 136:19b9e6abb86f | 18 | |
Kovalev_D | 136:19b9e6abb86f | 19 | unsigned int pDestT ; |
Kovalev_D | 136:19b9e6abb86f | 20 | GyroParam *Flash; |
Kovalev_D | 136:19b9e6abb86f | 21 | |
Kovalev_D | 136:19b9e6abb86f | 22 | |
Kovalev_D | 136:19b9e6abb86f | 23 | void ReadFlash ( void) |
Kovalev_D | 136:19b9e6abb86f | 24 | { |
Kovalev_D | 136:19b9e6abb86f | 25 | WriteCon("\r\n Pirivet Flash"); |
Kovalev_D | 136:19b9e6abb86f | 26 | pDestT= (unsigned int) (0x10000); |
Kovalev_D | 136:19b9e6abb86f | 27 | Flash = (GyroParam*) pDestT; |
Kovalev_D | 136:19b9e6abb86f | 28 | GyroP = *(Flash); |
Kovalev_D | 136:19b9e6abb86f | 29 | sprintf((Time)," dffddfd <%07d> ", GyroP.Str.K_WP_rst_heating); |
Kovalev_D | 136:19b9e6abb86f | 30 | WriteCon(Time); |
Kovalev_D | 136:19b9e6abb86f | 31 | |
Kovalev_D | 136:19b9e6abb86f | 32 | } |
Kovalev_D | 136:19b9e6abb86f | 33 | |
Kovalev_D | 136:19b9e6abb86f | 34 | |
Kovalev_D | 136:19b9e6abb86f | 35 | |
Kovalev_D | 136:19b9e6abb86f | 36 | unsigned int memdump( char *base, int n ) |
Kovalev_D | 136:19b9e6abb86f | 37 | { |
Kovalev_D | 136:19b9e6abb86f | 38 | |
Kovalev_D | 136:19b9e6abb86f | 39 | unsigned int *p; |
Kovalev_D | 136:19b9e6abb86f | 40 | |
Kovalev_D | 136:19b9e6abb86f | 41 | printf( " memdump from 0x%08X for %d bytes", (unsigned long)base, n ); |
Kovalev_D | 136:19b9e6abb86f | 42 | |
Kovalev_D | 136:19b9e6abb86f | 43 | p = (unsigned int *)((unsigned int)base & ~(unsigned int)0x3); |
Kovalev_D | 136:19b9e6abb86f | 44 | |
Kovalev_D | 136:19b9e6abb86f | 45 | for ( int i = 0; i < (n >> 2); i++, p++ ) { |
Kovalev_D | 136:19b9e6abb86f | 46 | if ( !(i % 4) ) |
Kovalev_D | 136:19b9e6abb86f | 47 | printf( "\r\n 0x%08X :", (unsigned int)p ); |
Kovalev_D | 136:19b9e6abb86f | 48 | printf( " 0x%08X", *p ); |
Kovalev_D | 136:19b9e6abb86f | 49 | } |
Kovalev_D | 136:19b9e6abb86f | 50 | |
Kovalev_D | 136:19b9e6abb86f | 51 | printf( "\r\n" ); |
Kovalev_D | 136:19b9e6abb86f | 52 | |
Kovalev_D | 136:19b9e6abb86f | 53 | |
Kovalev_D | 136:19b9e6abb86f | 54 | } |
Kovalev_D | 136:19b9e6abb86f | 55 | |
Kovalev_D | 136:19b9e6abb86f | 56 | |
Kovalev_D | 129:406995a91322 | 57 | void CMD_M_Param_R(void) |
igor_v | 0:8ad47e2b6f00 | 58 | { |
Kovalev_D | 129:406995a91322 | 59 | unsigned int NP; |
Kovalev_D | 129:406995a91322 | 60 | unsigned int Param; |
Kovalev_D | 129:406995a91322 | 61 | BuffTemp[0] = Gyro.SOC_Out; |
Kovalev_D | 129:406995a91322 | 62 | BuffTemp[1] = Gyro.My_Addres; |
Kovalev_D | 129:406995a91322 | 63 | |
Kovalev_D | 129:406995a91322 | 64 | NP = BuffTemp[3]; |
Kovalev_D | 129:406995a91322 | 65 | |
Kovalev_D | 129:406995a91322 | 66 | Param = GyroP.Array[NP]; |
Kovalev_D | 129:406995a91322 | 67 | |
Kovalev_D | 129:406995a91322 | 68 | BuffTemp[2] =(Param >> 8) & 0xff;//старший байт требуемого параметра |
Kovalev_D | 129:406995a91322 | 69 | BuffTemp[3] =(Param >> 0) & 0xff;//младший байт требуемого параметра |
Kovalev_D | 129:406995a91322 | 70 | |
Kovalev_D | 129:406995a91322 | 71 | Check(BuffTemp, 6); |
Kovalev_D | 129:406995a91322 | 72 | WriteConN (BuffTemp,6); |
Kovalev_D | 129:406995a91322 | 73 | } |
Kovalev_D | 129:406995a91322 | 74 | void CMD_M_Param_W(void) |
Kovalev_D | 129:406995a91322 | 75 | { |
Kovalev_D | 129:406995a91322 | 76 | unsigned int NP; |
Kovalev_D | 129:406995a91322 | 77 | unsigned int Param; |
Kovalev_D | 129:406995a91322 | 78 | |
Kovalev_D | 129:406995a91322 | 79 | NP = BuffTemp[3]; |
Kovalev_D | 129:406995a91322 | 80 | Param = (BuffTemp[4]<<8); |
Kovalev_D | 129:406995a91322 | 81 | Param |= BuffTemp[5]; |
Kovalev_D | 129:406995a91322 | 82 | |
Kovalev_D | 129:406995a91322 | 83 | GyroP.Array[NP] = Param; |
Kovalev_D | 129:406995a91322 | 84 | |
Kovalev_D | 129:406995a91322 | 85 | |
Kovalev_D | 129:406995a91322 | 86 | BuffTemp[0] = Gyro.SOC_Out; |
Kovalev_D | 129:406995a91322 | 87 | BuffTemp[1] = Gyro.My_Addres; |
Kovalev_D | 129:406995a91322 | 88 | BuffTemp[2] = Gyro.CMD_In; |
Kovalev_D | 129:406995a91322 | 89 | BuffTemp[3] = 0x00;//старший байт требуемого параметра |
Kovalev_D | 129:406995a91322 | 90 | |
Kovalev_D | 129:406995a91322 | 91 | Check(BuffTemp, 6); |
Kovalev_D | 129:406995a91322 | 92 | WriteConN (BuffTemp,6); |
Kovalev_D | 129:406995a91322 | 93 | } |
igor_v | 0:8ad47e2b6f00 | 94 | void CMD_Maintenance(void) |
igor_v | 0:8ad47e2b6f00 | 95 | { |
Kovalev_D | 122:fbacb932a30b | 96 | |
Kovalev_D | 122:fbacb932a30b | 97 | BuffTemp[0] = Gyro.SOC_Out; |
Kovalev_D | 124:9ae09249f842 | 98 | BuffTemp[1] = Gyro.My_Addres; |
Kovalev_D | 124:9ae09249f842 | 99 | BuffTemp[2] = Gyro.Firmware_Version; |
Kovalev_D | 124:9ae09249f842 | 100 | BuffTemp[3] = Gyro.GLD_Serial; |
igor_v | 21:bc8c1cec3da6 | 101 | BuffTemp[4]=0x00; |
igor_v | 21:bc8c1cec3da6 | 102 | BuffTemp[5]=0x00; |
igor_v | 21:bc8c1cec3da6 | 103 | Check(BuffTemp, 8); |
igor_v | 21:bc8c1cec3da6 | 104 | WriteConN (BuffTemp,8); |
Kovalev_D | 121:bbae560cdd43 | 105 | |
igor_v | 0:8ad47e2b6f00 | 106 | } |
Kovalev_D | 124:9ae09249f842 | 107 | void CMD_Delta_500Hz(void) |
Kovalev_D | 124:9ae09249f842 | 108 | { |
Kovalev_D | 124:9ae09249f842 | 109 | Gyro.Delta500_Event=0; |
Kovalev_D | 122:fbacb932a30b | 110 | unsigned int Temp; |
Kovalev_D | 124:9ae09249f842 | 111 | BuffTemp[ 0] = Gyro.SOC_Out; |
Kovalev_D | 122:fbacb932a30b | 112 | BuffTemp[ 1] = Gyro.My_Addres; |
Kovalev_D | 124:9ae09249f842 | 113 | |
Kovalev_D | 124:9ae09249f842 | 114 | Temp = Gyro.CuruAngle; |
Kovalev_D | 124:9ae09249f842 | 115 | Gyro.CuruAngle = 0; |
Kovalev_D | 124:9ae09249f842 | 116 | |
Kovalev_D | 124:9ae09249f842 | 117 | BuffTemp[ 2] =(Temp >> 8) & 0xff;//старший байт разности счетчиков |
Kovalev_D | 124:9ae09249f842 | 118 | BuffTemp[ 3] =(Temp >> 0) & 0xff;//младший байт разности счетчиков |
Kovalev_D | 124:9ae09249f842 | 119 | |
Kovalev_D | 124:9ae09249f842 | 120 | BuffTemp[ 4] = CountParam; |
Kovalev_D | 124:9ae09249f842 | 121 | switch(CountParam) { |
Kovalev_D | 124:9ae09249f842 | 122 | |
Kovalev_D | 124:9ae09249f842 | 123 | |
Kovalev_D | 124:9ae09249f842 | 124 | |
Kovalev_D | 124:9ae09249f842 | 125 | //F_ras |
Kovalev_D | 124:9ae09249f842 | 126 | case 0: |
Kovalev_D | 124:9ae09249f842 | 127 | Temp = Gyro.F_ras; |
Kovalev_D | 124:9ae09249f842 | 128 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 129 | break; |
Kovalev_D | 124:9ae09249f842 | 130 | |
Kovalev_D | 124:9ae09249f842 | 131 | case 1: |
Kovalev_D | 124:9ae09249f842 | 132 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 133 | break; |
Kovalev_D | 124:9ae09249f842 | 134 | |
Kovalev_D | 124:9ae09249f842 | 135 | |
Kovalev_D | 124:9ae09249f842 | 136 | |
Kovalev_D | 124:9ae09249f842 | 137 | //HFO |
Kovalev_D | 124:9ae09249f842 | 138 | case 2: |
Kovalev_D | 124:9ae09249f842 | 139 | Temp = 0;//HFO |
Kovalev_D | 124:9ae09249f842 | 140 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 141 | break; |
Kovalev_D | 124:9ae09249f842 | 142 | |
Kovalev_D | 124:9ae09249f842 | 143 | case 3: |
Kovalev_D | 124:9ae09249f842 | 144 | Temp = 0;//HFO |
Kovalev_D | 124:9ae09249f842 | 145 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 146 | break; |
Kovalev_D | 124:9ae09249f842 | 147 | |
Kovalev_D | 124:9ae09249f842 | 148 | |
Kovalev_D | 124:9ae09249f842 | 149 | |
Kovalev_D | 124:9ae09249f842 | 150 | //T_Vibro |
Kovalev_D | 124:9ae09249f842 | 151 | case 4: |
Kovalev_D | 124:9ae09249f842 | 152 | Temp = (unsigned int)((7680000*16/(Gyro.Frq>>12))); |
Kovalev_D | 124:9ae09249f842 | 153 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 154 | break; |
Kovalev_D | 124:9ae09249f842 | 155 | |
Kovalev_D | 124:9ae09249f842 | 156 | case 5: |
Kovalev_D | 124:9ae09249f842 | 157 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 158 | break; |
Kovalev_D | 124:9ae09249f842 | 159 | |
Kovalev_D | 124:9ae09249f842 | 160 | |
Kovalev_D | 124:9ae09249f842 | 161 | |
Kovalev_D | 124:9ae09249f842 | 162 | //L_Vibro |
Kovalev_D | 124:9ae09249f842 | 163 | case 6: |
Kovalev_D | 124:9ae09249f842 | 164 | Temp = (unsigned int)(((7680000*16/200) *Gyro.AmpPer /(Gyro.Frq>>12))); |
Kovalev_D | 124:9ae09249f842 | 165 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 166 | |
Kovalev_D | 124:9ae09249f842 | 167 | break; |
Kovalev_D | 124:9ae09249f842 | 168 | |
Kovalev_D | 124:9ae09249f842 | 169 | case 7: |
Kovalev_D | 124:9ae09249f842 | 170 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 171 | break; |
Kovalev_D | 124:9ae09249f842 | 172 | |
Kovalev_D | 124:9ae09249f842 | 173 | |
Kovalev_D | 124:9ae09249f842 | 174 | |
Kovalev_D | 124:9ae09249f842 | 175 | //Напряжение на регуляторе периметра |
Kovalev_D | 124:9ae09249f842 | 176 | case 8: |
Kovalev_D | 124:9ae09249f842 | 177 | Temp = Spi.DAC_B - 0x7fff; |
Kovalev_D | 124:9ae09249f842 | 178 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 179 | |
Kovalev_D | 124:9ae09249f842 | 180 | break; |
Kovalev_D | 124:9ae09249f842 | 181 | |
Kovalev_D | 124:9ae09249f842 | 182 | case 9: |
Kovalev_D | 124:9ae09249f842 | 183 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 184 | break; |
Kovalev_D | 124:9ae09249f842 | 185 | |
Kovalev_D | 124:9ae09249f842 | 186 | |
Kovalev_D | 124:9ae09249f842 | 187 | |
Kovalev_D | 124:9ae09249f842 | 188 | //темпкратурный канал 0 |
Kovalev_D | 124:9ae09249f842 | 189 | case 10: |
Kovalev_D | 124:9ae09249f842 | 190 | Temp = 100; |
Kovalev_D | 124:9ae09249f842 | 191 | BuffTemp[5] = (Temp >> 8) & 0xff; |
igor_v | 0:8ad47e2b6f00 | 192 | |
Kovalev_D | 124:9ae09249f842 | 193 | break; |
Kovalev_D | 124:9ae09249f842 | 194 | |
Kovalev_D | 124:9ae09249f842 | 195 | case 11: |
Kovalev_D | 124:9ae09249f842 | 196 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 197 | break; |
Kovalev_D | 124:9ae09249f842 | 198 | |
Kovalev_D | 124:9ae09249f842 | 199 | |
Kovalev_D | 124:9ae09249f842 | 200 | |
Kovalev_D | 124:9ae09249f842 | 201 | //темпкратурный канал 1 |
Kovalev_D | 124:9ae09249f842 | 202 | case 12: |
Kovalev_D | 124:9ae09249f842 | 203 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 124:9ae09249f842 | 204 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 205 | |
Kovalev_D | 124:9ae09249f842 | 206 | break; |
Kovalev_D | 124:9ae09249f842 | 207 | |
Kovalev_D | 124:9ae09249f842 | 208 | case 13: |
Kovalev_D | 124:9ae09249f842 | 209 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 210 | break; |
Kovalev_D | 124:9ae09249f842 | 211 | |
Kovalev_D | 124:9ae09249f842 | 212 | |
Kovalev_D | 124:9ae09249f842 | 213 | |
Kovalev_D | 124:9ae09249f842 | 214 | //ток 1 |
Kovalev_D | 124:9ae09249f842 | 215 | case 14: |
Kovalev_D | 124:9ae09249f842 | 216 | Temp = Gyro.In1; |
Kovalev_D | 124:9ae09249f842 | 217 | BuffTemp[5] = (Temp >> 8) & 0xff;//in1//2 |
Kovalev_D | 124:9ae09249f842 | 218 | |
Kovalev_D | 124:9ae09249f842 | 219 | break; |
Kovalev_D | 124:9ae09249f842 | 220 | |
Kovalev_D | 124:9ae09249f842 | 221 | case 15: |
Kovalev_D | 124:9ae09249f842 | 222 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 223 | break; |
Kovalev_D | 124:9ae09249f842 | 224 | |
Kovalev_D | 124:9ae09249f842 | 225 | |
Kovalev_D | 124:9ae09249f842 | 226 | |
Kovalev_D | 124:9ae09249f842 | 227 | //ток 2 |
Kovalev_D | 124:9ae09249f842 | 228 | case 16: |
Kovalev_D | 124:9ae09249f842 | 229 | Temp = Gyro.In2; |
Kovalev_D | 124:9ae09249f842 | 230 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 231 | break; |
Kovalev_D | 124:9ae09249f842 | 232 | |
Kovalev_D | 124:9ae09249f842 | 233 | case 17: |
Kovalev_D | 124:9ae09249f842 | 234 | BuffTemp[5] = (Temp >> 0) & 0xff;//in2//3 |
Kovalev_D | 124:9ae09249f842 | 235 | break; |
Kovalev_D | 124:9ae09249f842 | 236 | |
Kovalev_D | 124:9ae09249f842 | 237 | |
Kovalev_D | 124:9ae09249f842 | 238 | |
Kovalev_D | 124:9ae09249f842 | 239 | //разностный температурный канал Delta Temp |
Kovalev_D | 124:9ae09249f842 | 240 | case 18: |
Kovalev_D | 124:9ae09249f842 | 241 | Temp = Gyro.DeltaT; |
Kovalev_D | 124:9ae09249f842 | 242 | BuffTemp[5] = (Temp >> 8) & 0xff;//дельта |
Kovalev_D | 124:9ae09249f842 | 243 | break; |
Kovalev_D | 124:9ae09249f842 | 244 | |
Kovalev_D | 124:9ae09249f842 | 245 | case 19: |
Kovalev_D | 124:9ae09249f842 | 246 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 247 | break; |
Kovalev_D | 124:9ae09249f842 | 248 | |
Kovalev_D | 124:9ae09249f842 | 249 | |
Kovalev_D | 124:9ae09249f842 | 250 | |
Kovalev_D | 124:9ae09249f842 | 251 | //температурный канал 5 |
Kovalev_D | 124:9ae09249f842 | 252 | case 20: |
Kovalev_D | 124:9ae09249f842 | 253 | Temp = Gyro.Termo;//0xa4=164 |
Kovalev_D | 124:9ae09249f842 | 254 | BuffTemp[5] =(Temp >> 8) & 0xff;//температура |
Kovalev_D | 124:9ae09249f842 | 255 | |
Kovalev_D | 124:9ae09249f842 | 256 | break; |
Kovalev_D | 124:9ae09249f842 | 257 | |
Kovalev_D | 124:9ae09249f842 | 258 | case 21: |
Kovalev_D | 124:9ae09249f842 | 259 | BuffTemp[5] =(Temp >> 0) & 0xff;//ADC6 sesnsor 5 |
Kovalev_D | 124:9ae09249f842 | 260 | break; |
Kovalev_D | 124:9ae09249f842 | 261 | } |
Kovalev_D | 124:9ae09249f842 | 262 | Check(BuffTemp, 6); |
Kovalev_D | 124:9ae09249f842 | 263 | WriteConN (BuffTemp,6); |
Kovalev_D | 128:1e4675a36c93 | 264 | |
Kovalev_D | 124:9ae09249f842 | 265 | CountParam++; |
Kovalev_D | 124:9ae09249f842 | 266 | if(CountParam>21)CountParam=0;//зацикливания буфера от 0 до 21 |
Kovalev_D | 124:9ae09249f842 | 267 | |
Kovalev_D | 124:9ae09249f842 | 268 | } |
Kovalev_D | 124:9ae09249f842 | 269 | void CMD_Delta_Ext(void) |
Kovalev_D | 124:9ae09249f842 | 270 | { |
Kovalev_D | 124:9ae09249f842 | 271 | unsigned int Temp; |
Kovalev_D | 128:1e4675a36c93 | 272 | Gyro.EXT_Latch=0; |
Kovalev_D | 124:9ae09249f842 | 273 | BuffTemp[ 0] = Gyro.SOC_Out; |
Kovalev_D | 124:9ae09249f842 | 274 | BuffTemp[ 1] = Gyro.My_Addres; |
Kovalev_D | 124:9ae09249f842 | 275 | Temp = Gyro.CuruAngle; |
Kovalev_D | 124:9ae09249f842 | 276 | Gyro.CuruAngle = 0; |
Kovalev_D | 124:9ae09249f842 | 277 | |
Kovalev_D | 124:9ae09249f842 | 278 | BuffTemp[ 2] =(Temp >> 8) & 0xff;//старший байт разности счетчиков |
Kovalev_D | 124:9ae09249f842 | 279 | BuffTemp[ 3] =(Temp >> 0) & 0xff;//младший байт разности счетчиков |
Kovalev_D | 124:9ae09249f842 | 280 | |
Kovalev_D | 124:9ae09249f842 | 281 | BuffTemp[ 4] = CountParam; |
Kovalev_D | 128:1e4675a36c93 | 282 | switch(CountParam) { |
Kovalev_D | 124:9ae09249f842 | 283 | |
Kovalev_D | 128:1e4675a36c93 | 284 | WriteCon("5"); |
Kovalev_D | 124:9ae09249f842 | 285 | |
Kovalev_D | 124:9ae09249f842 | 286 | //F_ras |
Kovalev_D | 124:9ae09249f842 | 287 | case 0: |
Kovalev_D | 124:9ae09249f842 | 288 | Temp = Gyro.F_ras; |
Kovalev_D | 124:9ae09249f842 | 289 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 290 | |
Kovalev_D | 124:9ae09249f842 | 291 | break; |
Kovalev_D | 124:9ae09249f842 | 292 | |
Kovalev_D | 124:9ae09249f842 | 293 | case 1: |
Kovalev_D | 124:9ae09249f842 | 294 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 295 | |
Kovalev_D | 124:9ae09249f842 | 296 | break; |
Kovalev_D | 124:9ae09249f842 | 297 | |
Kovalev_D | 124:9ae09249f842 | 298 | |
Kovalev_D | 124:9ae09249f842 | 299 | |
Kovalev_D | 124:9ae09249f842 | 300 | //HFO |
Kovalev_D | 124:9ae09249f842 | 301 | case 2: |
Kovalev_D | 124:9ae09249f842 | 302 | Temp = 0;//HFO |
Kovalev_D | 124:9ae09249f842 | 303 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 304 | |
Kovalev_D | 124:9ae09249f842 | 305 | break; |
Kovalev_D | 124:9ae09249f842 | 306 | |
Kovalev_D | 124:9ae09249f842 | 307 | case 3: |
Kovalev_D | 124:9ae09249f842 | 308 | Temp = 0;//HFO |
Kovalev_D | 124:9ae09249f842 | 309 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 310 | |
Kovalev_D | 124:9ae09249f842 | 311 | break; |
Kovalev_D | 124:9ae09249f842 | 312 | |
Kovalev_D | 124:9ae09249f842 | 313 | |
Kovalev_D | 124:9ae09249f842 | 314 | |
Kovalev_D | 124:9ae09249f842 | 315 | //T_Vibro |
Kovalev_D | 124:9ae09249f842 | 316 | case 4: |
Kovalev_D | 124:9ae09249f842 | 317 | Temp = (unsigned int)((7680000*16/(Gyro.Frq>>12))); |
Kovalev_D | 124:9ae09249f842 | 318 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 319 | |
Kovalev_D | 124:9ae09249f842 | 320 | break; |
Kovalev_D | 124:9ae09249f842 | 321 | |
Kovalev_D | 124:9ae09249f842 | 322 | case 5: |
Kovalev_D | 124:9ae09249f842 | 323 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 324 | |
Kovalev_D | 124:9ae09249f842 | 325 | break; |
Kovalev_D | 124:9ae09249f842 | 326 | |
Kovalev_D | 124:9ae09249f842 | 327 | |
Kovalev_D | 124:9ae09249f842 | 328 | |
Kovalev_D | 124:9ae09249f842 | 329 | //L_Vibro |
Kovalev_D | 124:9ae09249f842 | 330 | case 6: |
Kovalev_D | 124:9ae09249f842 | 331 | Temp = (unsigned int)(((7680000*16/200) *Gyro.AmpPer /(Gyro.Frq>>12))); |
Kovalev_D | 124:9ae09249f842 | 332 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 122:fbacb932a30b | 333 | |
Kovalev_D | 124:9ae09249f842 | 334 | break; |
Kovalev_D | 124:9ae09249f842 | 335 | |
Kovalev_D | 124:9ae09249f842 | 336 | case 7: |
Kovalev_D | 124:9ae09249f842 | 337 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 338 | break; |
Kovalev_D | 124:9ae09249f842 | 339 | |
Kovalev_D | 124:9ae09249f842 | 340 | |
Kovalev_D | 124:9ae09249f842 | 341 | |
Kovalev_D | 124:9ae09249f842 | 342 | //Напряжение на регуляторе периметра |
Kovalev_D | 124:9ae09249f842 | 343 | case 8: |
Kovalev_D | 124:9ae09249f842 | 344 | Temp = Spi.DAC_B - 0x7fff; |
Kovalev_D | 124:9ae09249f842 | 345 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 346 | |
Kovalev_D | 124:9ae09249f842 | 347 | break; |
Kovalev_D | 124:9ae09249f842 | 348 | |
Kovalev_D | 124:9ae09249f842 | 349 | case 9: |
Kovalev_D | 124:9ae09249f842 | 350 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 351 | break; |
Kovalev_D | 124:9ae09249f842 | 352 | |
Kovalev_D | 124:9ae09249f842 | 353 | |
Kovalev_D | 124:9ae09249f842 | 354 | |
Kovalev_D | 124:9ae09249f842 | 355 | //темпкратурный канал 0 |
Kovalev_D | 124:9ae09249f842 | 356 | case 10: |
Kovalev_D | 124:9ae09249f842 | 357 | Temp = 100; |
Kovalev_D | 124:9ae09249f842 | 358 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 359 | |
Kovalev_D | 124:9ae09249f842 | 360 | break; |
Kovalev_D | 124:9ae09249f842 | 361 | |
Kovalev_D | 124:9ae09249f842 | 362 | case 11: |
Kovalev_D | 124:9ae09249f842 | 363 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 364 | break; |
Kovalev_D | 124:9ae09249f842 | 365 | |
Kovalev_D | 124:9ae09249f842 | 366 | |
Kovalev_D | 124:9ae09249f842 | 367 | |
Kovalev_D | 124:9ae09249f842 | 368 | //темпкратурный канал 1 |
Kovalev_D | 124:9ae09249f842 | 369 | case 12: |
Kovalev_D | 124:9ae09249f842 | 370 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 124:9ae09249f842 | 371 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 372 | |
Kovalev_D | 124:9ae09249f842 | 373 | break; |
Kovalev_D | 124:9ae09249f842 | 374 | |
Kovalev_D | 124:9ae09249f842 | 375 | case 13: |
Kovalev_D | 124:9ae09249f842 | 376 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 377 | break; |
Kovalev_D | 124:9ae09249f842 | 378 | |
Kovalev_D | 124:9ae09249f842 | 379 | |
Kovalev_D | 124:9ae09249f842 | 380 | |
Kovalev_D | 124:9ae09249f842 | 381 | //ток 1 |
Kovalev_D | 124:9ae09249f842 | 382 | case 14: |
Kovalev_D | 124:9ae09249f842 | 383 | Temp = Gyro.In1; |
Kovalev_D | 124:9ae09249f842 | 384 | BuffTemp[5] = (Temp >> 8) & 0xff;//in1//2 |
Kovalev_D | 124:9ae09249f842 | 385 | |
Kovalev_D | 124:9ae09249f842 | 386 | break; |
Kovalev_D | 124:9ae09249f842 | 387 | |
Kovalev_D | 124:9ae09249f842 | 388 | case 15: |
Kovalev_D | 124:9ae09249f842 | 389 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 390 | break; |
Kovalev_D | 124:9ae09249f842 | 391 | |
Kovalev_D | 124:9ae09249f842 | 392 | |
Kovalev_D | 124:9ae09249f842 | 393 | |
Kovalev_D | 124:9ae09249f842 | 394 | //ток 2 |
Kovalev_D | 124:9ae09249f842 | 395 | case 16: |
Kovalev_D | 124:9ae09249f842 | 396 | Temp = Gyro.In2; |
Kovalev_D | 124:9ae09249f842 | 397 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 398 | break; |
Kovalev_D | 124:9ae09249f842 | 399 | |
Kovalev_D | 124:9ae09249f842 | 400 | case 17: |
Kovalev_D | 124:9ae09249f842 | 401 | BuffTemp[5] = (Temp >> 0) & 0xff;//in2//3 |
Kovalev_D | 124:9ae09249f842 | 402 | break; |
Kovalev_D | 124:9ae09249f842 | 403 | |
Kovalev_D | 124:9ae09249f842 | 404 | |
Kovalev_D | 124:9ae09249f842 | 405 | |
Kovalev_D | 124:9ae09249f842 | 406 | //разностный температурный канал Delta Temp |
Kovalev_D | 124:9ae09249f842 | 407 | case 18: |
Kovalev_D | 124:9ae09249f842 | 408 | Temp = Gyro.DeltaT; |
Kovalev_D | 124:9ae09249f842 | 409 | BuffTemp[5] = (Temp >> 8) & 0xff;//дельта |
Kovalev_D | 124:9ae09249f842 | 410 | break; |
Kovalev_D | 124:9ae09249f842 | 411 | |
Kovalev_D | 124:9ae09249f842 | 412 | case 19: |
Kovalev_D | 124:9ae09249f842 | 413 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 414 | break; |
Kovalev_D | 124:9ae09249f842 | 415 | |
Kovalev_D | 124:9ae09249f842 | 416 | |
Kovalev_D | 124:9ae09249f842 | 417 | |
Kovalev_D | 124:9ae09249f842 | 418 | //температурный канал 5 |
Kovalev_D | 124:9ae09249f842 | 419 | case 20: |
Kovalev_D | 124:9ae09249f842 | 420 | Temp = Gyro.Termo;//0xa4=164 |
Kovalev_D | 124:9ae09249f842 | 421 | BuffTemp[5] =(Temp >> 8) & 0xff;//температура |
Kovalev_D | 124:9ae09249f842 | 422 | |
Kovalev_D | 124:9ae09249f842 | 423 | break; |
Kovalev_D | 124:9ae09249f842 | 424 | |
Kovalev_D | 124:9ae09249f842 | 425 | case 21: |
Kovalev_D | 124:9ae09249f842 | 426 | BuffTemp[5] =(Temp >> 0) & 0xff;//ADC6 sesnsor 5 |
Kovalev_D | 124:9ae09249f842 | 427 | break; |
Kovalev_D | 124:9ae09249f842 | 428 | } |
Kovalev_D | 128:1e4675a36c93 | 429 | Check(BuffTemp, 8); |
Kovalev_D | 128:1e4675a36c93 | 430 | WriteConN (BuffTemp,8); |
Kovalev_D | 124:9ae09249f842 | 431 | CountParam++; |
Kovalev_D | 124:9ae09249f842 | 432 | if(CountParam>21)CountParam=0;//зацикливания буфера от 0 до 21 |
Kovalev_D | 122:fbacb932a30b | 433 | } |
Kovalev_D | 124:9ae09249f842 | 434 | |
Kovalev_D | 121:bbae560cdd43 | 435 | void CMD_Rate2(void) |
Kovalev_D | 121:bbae560cdd43 | 436 | { |
Kovalev_D | 124:9ae09249f842 | 437 | Gyro.Rate2_Event=0; |
Kovalev_D | 121:bbae560cdd43 | 438 | BuffTemp[ 0] = Gyro.SOC_Out; |
Kovalev_D | 121:bbae560cdd43 | 439 | BuffTemp[ 1] = Gyro.My_Addres; |
Kovalev_D | 121:bbae560cdd43 | 440 | |
Kovalev_D | 121:bbae560cdd43 | 441 | |
Kovalev_D | 121:bbae560cdd43 | 442 | BuffTemp[ 2] =(Gyro.CaunPlus >> 8) & 0xff;//старший байт счетчика +. |
Kovalev_D | 121:bbae560cdd43 | 443 | BuffTemp[ 3] =(Gyro.CaunPlus >> 0) & 0xff;//младший байт счетчика +. |
Kovalev_D | 121:bbae560cdd43 | 444 | |
Kovalev_D | 121:bbae560cdd43 | 445 | BuffTemp[ 4] =(Gyro.CaunMin >> 8) & 0xff;//старший байт счетчика -. |
Kovalev_D | 121:bbae560cdd43 | 446 | BuffTemp[ 5] =(Gyro.CaunMin >> 0) & 0xff;//младший байт счетчика -. |
Kovalev_D | 124:9ae09249f842 | 447 | |
Kovalev_D | 122:fbacb932a30b | 448 | Check(BuffTemp, 8); |
Kovalev_D | 122:fbacb932a30b | 449 | WriteConN (BuffTemp,8); |
Kovalev_D | 121:bbae560cdd43 | 450 | } |
Kovalev_D | 124:9ae09249f842 | 451 | |
igor_v | 0:8ad47e2b6f00 | 452 | void CMD_Rate(void) |
igor_v | 21:bc8c1cec3da6 | 453 | { |
Kovalev_D | 124:9ae09249f842 | 454 | |
Kovalev_D | 124:9ae09249f842 | 455 | Gyro.Rate1_Event=0; |
Kovalev_D | 108:030cdde08314 | 456 | unsigned int Temp; |
Kovalev_D | 107:4d178bcc9d8a | 457 | |
igor_v | 30:17c84ed091b3 | 458 | Gyro.Firmware_Version=0xff; /// промежуточная затычка |
Kovalev_D | 122:fbacb932a30b | 459 | |
igor_v | 0:8ad47e2b6f00 | 460 | |
igor_v | 30:17c84ed091b3 | 461 | BuffTemp[ 0] = Gyro.SOC_Out; |
igor_v | 30:17c84ed091b3 | 462 | BuffTemp[ 1] = Gyro.My_Addres; |
igor_v | 21:bc8c1cec3da6 | 463 | |
Kovalev_D | 108:030cdde08314 | 464 | |
Kovalev_D | 112:4a96133a1311 | 465 | BuffTemp[ 2] =(Gyro.CaunPlus >> 8) & 0xff;//старший байт счетчика +. |
Kovalev_D | 112:4a96133a1311 | 466 | BuffTemp[ 3] =(Gyro.CaunPlus >> 0) & 0xff;//младший байт счетчика +. |
Kovalev_D | 108:030cdde08314 | 467 | |
Kovalev_D | 112:4a96133a1311 | 468 | BuffTemp[ 4] =(Gyro.CaunMin >> 8) & 0xff;//старший байт счетчика -. |
Kovalev_D | 112:4a96133a1311 | 469 | BuffTemp[ 5] =(Gyro.CaunMin >> 0) & 0xff;//младший байт счетчика -. |
Kovalev_D | 108:030cdde08314 | 470 | |
Kovalev_D | 113:8be429494918 | 471 | |
Kovalev_D | 108:030cdde08314 | 472 | Temp = Gyro.CuruAngle; |
Kovalev_D | 108:030cdde08314 | 473 | Gyro.CuruAngle = 0; |
Kovalev_D | 125:9400e64d0636 | 474 | Temp = Gyro.AD_Fast >> 16; |
Kovalev_D | 108:030cdde08314 | 475 | BuffTemp[ 6] =(Temp >> 8) & 0xff;//старший байт разности счетчиков |
Kovalev_D | 108:030cdde08314 | 476 | BuffTemp[ 7] =(Temp >> 0) & 0xff;//младший байт разности счетчиков |
Kovalev_D | 108:030cdde08314 | 477 | |
Kovalev_D | 108:030cdde08314 | 478 | |
Kovalev_D | 122:fbacb932a30b | 479 | Temp = Gyro.F_ras; |
Kovalev_D | 122:fbacb932a30b | 480 | BuffTemp[ 8] = (Temp >> 8) & 0xff;//расщипление частота |
Kovalev_D | 122:fbacb932a30b | 481 | BuffTemp[ 9] = (Temp >> 0) & 0xff;// |
igor_v | 21:bc8c1cec3da6 | 482 | |
Kovalev_D | 108:030cdde08314 | 483 | BuffTemp[10] = (Temp >> 8) & 0xff;//выход регулятора гвч; |
Kovalev_D | 122:fbacb932a30b | 484 | BuffTemp[11] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 485 | |
Kovalev_D | 122:fbacb932a30b | 486 | Temp = (Gyro.AD_Slow >> 16)- 0x7fff; |
Kovalev_D | 108:030cdde08314 | 487 | BuffTemp[12]=(Temp >> 8) & 0xff;//// |
Kovalev_D | 108:030cdde08314 | 488 | BuffTemp[13]=(Temp >> 0) & 0xff;//// |
igor_v | 21:bc8c1cec3da6 | 489 | |
Kovalev_D | 108:030cdde08314 | 490 | |
Kovalev_D | 108:030cdde08314 | 491 | Temp = (unsigned int)((7680000*16/(Gyro.Frq>>12))); |
Kovalev_D | 108:030cdde08314 | 492 | BuffTemp[14] = (Temp >> 8) & 0xff; |
Kovalev_D | 108:030cdde08314 | 493 | BuffTemp[15] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 494 | |
Kovalev_D | 107:4d178bcc9d8a | 495 | BuffTemp[16] = 0xf; |
Kovalev_D | 106:250ddd8629c6 | 496 | BuffTemp[17] = 0x02; |
Kovalev_D | 108:030cdde08314 | 497 | |
igor_v | 21:bc8c1cec3da6 | 498 | |
Kovalev_D | 108:030cdde08314 | 499 | Temp = (unsigned int)(((7680000*16/200) *Gyro.AmpPer /(Gyro.Frq>>12))); |
Kovalev_D | 108:030cdde08314 | 500 | BuffTemp[18] = (Temp >> 8) & 0xff; |
Kovalev_D | 108:030cdde08314 | 501 | BuffTemp[19] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 502 | |
Kovalev_D | 106:250ddd8629c6 | 503 | BuffTemp[20] = 0x00; |
Kovalev_D | 106:250ddd8629c6 | 504 | BuffTemp[21] = 0x00; |
Kovalev_D | 120:9f446f1495e8 | 505 | |
Kovalev_D | 119:4d7fcece9e8e | 506 | |
Kovalev_D | 125:9400e64d0636 | 507 | |
Kovalev_D | 121:bbae560cdd43 | 508 | Temp = Spi.DAC_B - 0x7fff; |
Kovalev_D | 108:030cdde08314 | 509 | BuffTemp[22] = (Temp >> 8) & 0xff; |
Kovalev_D | 108:030cdde08314 | 510 | BuffTemp[23] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 511 | |
Kovalev_D | 121:bbae560cdd43 | 512 | |
Kovalev_D | 121:bbae560cdd43 | 513 | Temp = Gyro.PLC_Delta >> 16; |
Kovalev_D | 121:bbae560cdd43 | 514 | BuffTemp[24] = (Temp >> 8) & 0xff; |
Kovalev_D | 121:bbae560cdd43 | 515 | BuffTemp[25] = (Temp >> 0) & 0xff;// ХЗ |
Kovalev_D | 113:8be429494918 | 516 | |
Kovalev_D | 125:9400e64d0636 | 517 | Temp = 100; |
Kovalev_D | 125:9400e64d0636 | 518 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 113:8be429494918 | 519 | BuffTemp[26] = (Temp >> 8) & 0xff; |
Kovalev_D | 113:8be429494918 | 520 | BuffTemp[27] = (Temp >> 0) & 0xff; |
Kovalev_D | 113:8be429494918 | 521 | |
Kovalev_D | 113:8be429494918 | 522 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 113:8be429494918 | 523 | BuffTemp[28] = (Temp >> 8) & 0xff; |
Kovalev_D | 113:8be429494918 | 524 | BuffTemp[29] = (Temp >> 0) & 0xff; |
Kovalev_D | 113:8be429494918 | 525 | |
Kovalev_D | 113:8be429494918 | 526 | Temp = Gyro.In1; |
Kovalev_D | 113:8be429494918 | 527 | BuffTemp[30] = (Temp >> 8) & 0xff;//in1//2 |
Kovalev_D | 113:8be429494918 | 528 | BuffTemp[31] = (Temp >> 0) & 0xff; |
Kovalev_D | 113:8be429494918 | 529 | |
Kovalev_D | 113:8be429494918 | 530 | Temp = Gyro.In2; |
Kovalev_D | 113:8be429494918 | 531 | BuffTemp[32] = (Temp >> 8) & 0xff; |
Kovalev_D | 113:8be429494918 | 532 | BuffTemp[33] = (Temp >> 0) & 0xff;//in2//3 |
Kovalev_D | 113:8be429494918 | 533 | |
Kovalev_D | 113:8be429494918 | 534 | Temp = Gyro.DeltaT; |
Kovalev_D | 113:8be429494918 | 535 | BuffTemp[34] = (Temp >> 8) & 0xff;//дельта |
Kovalev_D | 113:8be429494918 | 536 | BuffTemp[35] = (Temp >> 0) & 0xff; |
Kovalev_D | 115:e5a230e5af52 | 537 | |
Kovalev_D | 116:66f1f0ff2dab | 538 | Temp = Gyro.Termo;//0xa4=164 |
Kovalev_D | 115:e5a230e5af52 | 539 | |
Kovalev_D | 113:8be429494918 | 540 | BuffTemp[36] =(Temp >> 8) & 0xff;//температура |
Kovalev_D | 115:e5a230e5af52 | 541 | BuffTemp[37] =(Temp >> 0) & 0xff;//ADC6 sesnsor 5 |
igor_v | 21:bc8c1cec3da6 | 542 | |
Kovalev_D | 106:250ddd8629c6 | 543 | BuffTemp[38] =0x00; |
Kovalev_D | 106:250ddd8629c6 | 544 | BuffTemp[39] =0x00; |
Kovalev_D | 106:250ddd8629c6 | 545 | BuffTemp[40] =0x00; |
Kovalev_D | 106:250ddd8629c6 | 546 | BuffTemp[41] =0x00; |
igor_v | 21:bc8c1cec3da6 | 547 | |
igor_v | 21:bc8c1cec3da6 | 548 | |
igor_v | 21:bc8c1cec3da6 | 549 | Check(BuffTemp, 44); |
igor_v | 21:bc8c1cec3da6 | 550 | WriteConN (BuffTemp,44); |
Kovalev_D | 92:c892f0311aa7 | 551 | |
igor_v | 0:8ad47e2b6f00 | 552 | } |
igor_v | 0:8ad47e2b6f00 | 553 | |
igor_v | 21:bc8c1cec3da6 | 554 | void CMD_M_Control_D8()///установка\сброс регистров управления |
igor_v | 21:bc8c1cec3da6 | 555 | { |
Kovalev_D | 104:ab1cb4ff56b2 | 556 | unsigned int bit,NReg,Pa; |
Kovalev_D | 104:ab1cb4ff56b2 | 557 | unsigned int SR,V,A,Bit_num; |
Kovalev_D | 104:ab1cb4ff56b2 | 558 | SR=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 559 | V=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 560 | A=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 561 | Bit_num=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 562 | |
igor_v | 30:17c84ed091b3 | 563 | BuffTemp[0] = Gyro.SOC_Out; //DD |
igor_v | 30:17c84ed091b3 | 564 | BuffTemp[1] = Gyro.My_Addres; //00 |
igor_v | 30:17c84ed091b3 | 565 | BuffTemp[2] = Gyro.CMD_In; //D8 |
Kovalev_D | 104:ab1cb4ff56b2 | 566 | |
Kovalev_D | 104:ab1cb4ff56b2 | 567 | /* |
Kovalev_D | 104:ab1cb4ff56b2 | 568 | |
Kovalev_D | 104:ab1cb4ff56b2 | 569 | FrqON |
Kovalev_D | 104:ab1cb4ff56b2 | 570 | PlcON |
Kovalev_D | 104:ab1cb4ff56b2 | 571 | HFOOFF |
Kovalev_D | 104:ab1cb4ff56b2 | 572 | HFOON |
igor_v | 21:bc8c1cec3da6 | 573 | |
Kovalev_D | 104:ab1cb4ff56b2 | 574 | PlcOFF |
Kovalev_D | 104:ab1cb4ff56b2 | 575 | PlcON |
Kovalev_D | 104:ab1cb4ff56b2 | 576 | */ |
Kovalev_D | 104:ab1cb4ff56b2 | 577 | Pa = BuffTemp[3]; |
Kovalev_D | 104:ab1cb4ff56b2 | 578 | |
Kovalev_D | 104:ab1cb4ff56b2 | 579 | SR = Pa >> 0x7; |
Kovalev_D | 104:ab1cb4ff56b2 | 580 | |
Kovalev_D | 104:ab1cb4ff56b2 | 581 | V = Pa >> 0x5; |
Kovalev_D | 104:ab1cb4ff56b2 | 582 | V = V & 0x3; |
Kovalev_D | 104:ab1cb4ff56b2 | 583 | |
Kovalev_D | 104:ab1cb4ff56b2 | 584 | A = Pa >> 0x4; |
Kovalev_D | 104:ab1cb4ff56b2 | 585 | A = A & 0x1; |
Kovalev_D | 104:ab1cb4ff56b2 | 586 | |
Kovalev_D | 104:ab1cb4ff56b2 | 587 | Bit_num = Pa & 0xf; |
Kovalev_D | 104:ab1cb4ff56b2 | 588 | |
Kovalev_D | 104:ab1cb4ff56b2 | 589 | if(SR) { |
Kovalev_D | 104:ab1cb4ff56b2 | 590 | switch (Bit_num){ |
Kovalev_D | 105:bd01d8d20fb6 | 591 | |
Kovalev_D | 104:ab1cb4ff56b2 | 592 | case 0x06: |
Kovalev_D | 104:ab1cb4ff56b2 | 593 | FrqON |
Kovalev_D | 105:bd01d8d20fb6 | 594 | break; |
Kovalev_D | 105:bd01d8d20fb6 | 595 | |
Kovalev_D | 104:ab1cb4ff56b2 | 596 | case 0x03: |
Kovalev_D | 105:bd01d8d20fb6 | 597 | HFOON |
Kovalev_D | 105:bd01d8d20fb6 | 598 | break; |
Kovalev_D | 105:bd01d8d20fb6 | 599 | |
Kovalev_D | 105:bd01d8d20fb6 | 600 | case 0x01: |
Kovalev_D | 105:bd01d8d20fb6 | 601 | PlcON |
Kovalev_D | 105:bd01d8d20fb6 | 602 | break; |
Kovalev_D | 104:ab1cb4ff56b2 | 603 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 604 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 605 | else{ |
Kovalev_D | 104:ab1cb4ff56b2 | 606 | switch (Bit_num){ |
Kovalev_D | 105:bd01d8d20fb6 | 607 | |
Kovalev_D | 105:bd01d8d20fb6 | 608 | case 0x06: |
Kovalev_D | 104:ab1cb4ff56b2 | 609 | FrqOff |
Kovalev_D | 105:bd01d8d20fb6 | 610 | break; |
Kovalev_D | 105:bd01d8d20fb6 | 611 | |
Kovalev_D | 105:bd01d8d20fb6 | 612 | case 0x03: |
Kovalev_D | 105:bd01d8d20fb6 | 613 | HFOOFF |
Kovalev_D | 105:bd01d8d20fb6 | 614 | break; |
Kovalev_D | 105:bd01d8d20fb6 | 615 | |
Kovalev_D | 105:bd01d8d20fb6 | 616 | case 0x01: |
Kovalev_D | 105:bd01d8d20fb6 | 617 | PlcOFF |
Kovalev_D | 105:bd01d8d20fb6 | 618 | break; |
Kovalev_D | 104:ab1cb4ff56b2 | 619 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 620 | } |
Kovalev_D | 129:406995a91322 | 621 | BuffTemp[0] = Gyro.SOC_Out; //DD |
Kovalev_D | 129:406995a91322 | 622 | BuffTemp[1] = Gyro.My_Addres; //00 |
Kovalev_D | 129:406995a91322 | 623 | BuffTemp[2] = Gyro.CMD_In; //D8 |
Kovalev_D | 129:406995a91322 | 624 | BuffTemp[3] = A<<4; |
Kovalev_D | 129:406995a91322 | 625 | BuffTemp[4] = 0x0; |
Kovalev_D | 129:406995a91322 | 626 | BuffTemp[5] = 0x0; |
Kovalev_D | 129:406995a91322 | 627 | Check(BuffTemp, CRC_N); |
Kovalev_D | 129:406995a91322 | 628 | WriteConN (BuffTemp,CRC_N); |
igor_v | 0:8ad47e2b6f00 | 629 | } |
igor_v | 0:8ad47e2b6f00 | 630 | |
igor_v | 21:bc8c1cec3da6 | 631 | void CMD_M_Control_D9()///чтение регистров управления |
igor_v | 21:bc8c1cec3da6 | 632 | { |
igor_v | 21:bc8c1cec3da6 | 633 | int bit,NReg; |
igor_v | 30:17c84ed091b3 | 634 | BuffTemp[0] = Gyro.SOC_Out; //DD |
igor_v | 30:17c84ed091b3 | 635 | BuffTemp[1] = Gyro.My_Addres; //00 |
igor_v | 30:17c84ed091b3 | 636 | BuffTemp[2] = Gyro.CMD_In; //D9 |
igor_v | 21:bc8c1cec3da6 | 637 | if ((Param1 & 0x10) == 0) { |
igor_v | 21:bc8c1cec3da6 | 638 | BuffTemp[3]=0<<4; |
igor_v | 30:17c84ed091b3 | 639 | BuffTemp[4] = (Gyro.RgConA>>8 )& 0xff; |
igor_v | 30:17c84ed091b3 | 640 | BuffTemp[5] = Gyro.RgConA & 0xff; |
igor_v | 21:bc8c1cec3da6 | 641 | } else { |
igor_v | 21:bc8c1cec3da6 | 642 | BuffTemp[3]=1<<4; |
igor_v | 30:17c84ed091b3 | 643 | BuffTemp[4] = (Gyro.RgConB>>8 ) & 0xff; |
igor_v | 30:17c84ed091b3 | 644 | BuffTemp[5] = Gyro.RgConB & 0xff; |
igor_v | 21:bc8c1cec3da6 | 645 | } |
igor_v | 21:bc8c1cec3da6 | 646 | Check(BuffTemp, CRC_N); |
igor_v | 21:bc8c1cec3da6 | 647 | WriteConN (BuffTemp,CRC_N); |
igor_v | 21:bc8c1cec3da6 | 648 | } |
igor_v | 21:bc8c1cec3da6 | 649 | // (номер (код) ЦАПа 0...3, старший байт требуемого ЦАПа, младший байт треб ЦАПа) |
igor_v | 0:8ad47e2b6f00 | 650 | void CMD_M_Stymul() |
igor_v | 0:8ad47e2b6f00 | 651 | { |
igor_v | 21:bc8c1cec3da6 | 652 | int temp; |
Kovalev_D | 102:4270092be987 | 653 | int HFO; |
Kovalev_D | 102:4270092be987 | 654 | temp=BuffTemp[3]; |
Kovalev_D | 102:4270092be987 | 655 | Consol = temp&0x3; |
Kovalev_D | 103:e96f08947def | 656 | HFO = temp&0x3;// // (номер (код) ЦАПа 0...3, HFO - 3dac, PLC - 0DAC |
igor_v | 21:bc8c1cec3da6 | 657 | temp =((BuffTemp[4]<<8) | BuffTemp[5]); |
igor_v | 21:bc8c1cec3da6 | 658 | // temp=0; |
igor_v | 21:bc8c1cec3da6 | 659 | temp=temp&0xFFFF; |
Kovalev_D | 102:4270092be987 | 660 | |
Kovalev_D | 102:4270092be987 | 661 | if(HFO) |
Kovalev_D | 102:4270092be987 | 662 | { |
Kovalev_D | 102:4270092be987 | 663 | Spi.DAC_A=(unsigned int)temp; |
Kovalev_D | 102:4270092be987 | 664 | } |
Kovalev_D | 102:4270092be987 | 665 | else{ |
igor_v | 21:bc8c1cec3da6 | 666 | DACF =(temp*K_DAC)+deltaDAC; |
igor_v | 21:bc8c1cec3da6 | 667 | Spi.DAC_B =(unsigned int)(DACF) /*(unsigned int)(temp*K_DAC+deltaDAC)*/; // K_DAC); |
igor_v | 21:bc8c1cec3da6 | 668 | } |
igor_v | 0:8ad47e2b6f00 | 669 | } |
Kovalev_D | 103:e96f08947def | 670 | void Gph_W() |
Kovalev_D | 103:e96f08947def | 671 | { |
Kovalev_D | 108:030cdde08314 | 672 | Out_G_photo(BuffTemp[4],BuffTemp[5]); |
Kovalev_D | 103:e96f08947def | 673 | } |
igor_v | 0:8ad47e2b6f00 | 674 | |
Kovalev_D | 98:95b8e79f13e1 | 675 | void CMD_M_vib() |
Kovalev_D | 115:e5a230e5af52 | 676 | { |
Kovalev_D | 102:4270092be987 | 677 | unsigned int temp1,temp2; |
Kovalev_D | 102:4270092be987 | 678 | |
Kovalev_D | 102:4270092be987 | 679 | temp1 =((BuffTemp[4]<<8) | BuffTemp[5]); |
Kovalev_D | 102:4270092be987 | 680 | temp1=temp1&0xFFFF; |
Kovalev_D | 102:4270092be987 | 681 | |
Kovalev_D | 102:4270092be987 | 682 | temp2 =((BuffTemp[6]<<8) | BuffTemp[7]); |
Kovalev_D | 102:4270092be987 | 683 | temp2=temp2&0xFFFF; |
Kovalev_D | 102:4270092be987 | 684 | Gyro.Frq = ((unsigned int) ((7680000*16/temp1)))*16*16*16; |
Kovalev_D | 102:4270092be987 | 685 | Consol=Gyro.Frq ; |
Kovalev_D | 98:95b8e79f13e1 | 686 | } |
igor_v | 0:8ad47e2b6f00 | 687 | unsigned int Check(char *c, unsigned int Count) |
igor_v | 0:8ad47e2b6f00 | 688 | { |
igor_v | 21:bc8c1cec3da6 | 689 | int i=1; |
igor_v | 21:bc8c1cec3da6 | 690 | unsigned int temp,CRC; |
igor_v | 21:bc8c1cec3da6 | 691 | |
igor_v | 21:bc8c1cec3da6 | 692 | |
igor_v | 21:bc8c1cec3da6 | 693 | temp=1; |
igor_v | 21:bc8c1cec3da6 | 694 | CRC=0; |
igor_v | 21:bc8c1cec3da6 | 695 | |
igor_v | 21:bc8c1cec3da6 | 696 | |
igor_v | 21:bc8c1cec3da6 | 697 | for(; i<Count-2; i++) { |
igor_v | 21:bc8c1cec3da6 | 698 | CRC+=c[i]; |
igor_v | 21:bc8c1cec3da6 | 699 | } |
igor_v | 0:8ad47e2b6f00 | 700 | |
igor_v | 21:bc8c1cec3da6 | 701 | if(c[Count-2]!=((CRC>>8)&0xFF)) { |
igor_v | 21:bc8c1cec3da6 | 702 | temp=0; |
igor_v | 30:17c84ed091b3 | 703 | Gyro.RsErrLine = (Gyro.RsErrLine)&=0x2; |
igor_v | 21:bc8c1cec3da6 | 704 | } |
igor_v | 0:8ad47e2b6f00 | 705 | |
igor_v | 21:bc8c1cec3da6 | 706 | if(c[Count-1]!=((CRC>>0)&0xFF)) { |
igor_v | 21:bc8c1cec3da6 | 707 | temp=0; |
igor_v | 30:17c84ed091b3 | 708 | // Gyro.RsErrLine= (Gyro.RsErrLine)=0x2; |
igor_v | 21:bc8c1cec3da6 | 709 | } |
igor_v | 21:bc8c1cec3da6 | 710 | |
igor_v | 21:bc8c1cec3da6 | 711 | c[Count-2]=(CRC>>8)&0xFF; |
igor_v | 21:bc8c1cec3da6 | 712 | c[Count-1]=(CRC>>0)&0xFF; |
igor_v | 21:bc8c1cec3da6 | 713 | |
igor_v | 21:bc8c1cec3da6 | 714 | |
igor_v | 21:bc8c1cec3da6 | 715 | |
igor_v | 21:bc8c1cec3da6 | 716 | return temp; |
igor_v | 0:8ad47e2b6f00 | 717 | } |
igor_v | 0:8ad47e2b6f00 | 718 | |
igor_v | 0:8ad47e2b6f00 | 719 | int Getlengf(void) |
igor_v | 0:8ad47e2b6f00 | 720 | { |
Kovalev_D | 121:bbae560cdd43 | 721 | unsigned int lengf; |
Kovalev_D | 121:bbae560cdd43 | 722 | lengf = 1; |
igor_v | 30:17c84ed091b3 | 723 | switch(Gyro.CMD_In) { |
igor_v | 30:17c84ed091b3 | 724 | case 0x99://Gyrotainance |
Kovalev_D | 92:c892f0311aa7 | 725 | |
igor_v | 21:bc8c1cec3da6 | 726 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 727 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 728 | break; |
igor_v | 0:8ad47e2b6f00 | 729 | |
igor_v | 21:bc8c1cec3da6 | 730 | case 0x0A: //m_stymul |
igor_v | 21:bc8c1cec3da6 | 731 | lengf=8; |
igor_v | 21:bc8c1cec3da6 | 732 | break; |
igor_v | 21:bc8c1cec3da6 | 733 | |
Kovalev_D | 129:406995a91322 | 734 | case 0xE9://DeviceMode |
igor_v | 21:bc8c1cec3da6 | 735 | |
igor_v | 21:bc8c1cec3da6 | 736 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 737 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 738 | break; |
Kovalev_D | 129:406995a91322 | 739 | case 0xE8://DeviceMode |
igor_v | 21:bc8c1cec3da6 | 740 | |
Kovalev_D | 129:406995a91322 | 741 | lengf=6; |
Kovalev_D | 129:406995a91322 | 742 | CRC_N=8; |
Kovalev_D | 129:406995a91322 | 743 | break; |
Kovalev_D | 129:406995a91322 | 744 | |
Kovalev_D | 129:406995a91322 | 745 | case 0xA5://DeviceMode |
Kovalev_D | 129:406995a91322 | 746 | |
Kovalev_D | 129:406995a91322 | 747 | lengf=6; |
Kovalev_D | 129:406995a91322 | 748 | CRC_N=8; |
Kovalev_D | 129:406995a91322 | 749 | break; |
Kovalev_D | 129:406995a91322 | 750 | |
igor_v | 21:bc8c1cec3da6 | 751 | case 0xDD://m_rate |
igor_v | 21:bc8c1cec3da6 | 752 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 753 | CRC_N=44; |
igor_v | 21:bc8c1cec3da6 | 754 | break; |
Kovalev_D | 124:9ae09249f842 | 755 | |
Kovalev_D | 124:9ae09249f842 | 756 | case 0xA0://Delta_PS |
Kovalev_D | 124:9ae09249f842 | 757 | lengf=6; |
Kovalev_D | 124:9ae09249f842 | 758 | CRC_N=8; |
Kovalev_D | 124:9ae09249f842 | 759 | break; |
Kovalev_D | 124:9ae09249f842 | 760 | |
Kovalev_D | 124:9ae09249f842 | 761 | |
igor_v | 21:bc8c1cec3da6 | 762 | case 0xB0://DeviceMode |
igor_v | 21:bc8c1cec3da6 | 763 | |
igor_v | 21:bc8c1cec3da6 | 764 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 765 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 766 | break; |
igor_v | 21:bc8c1cec3da6 | 767 | |
igor_v | 21:bc8c1cec3da6 | 768 | case 0xD8://m_control |
igor_v | 0:8ad47e2b6f00 | 769 | |
igor_v | 21:bc8c1cec3da6 | 770 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 771 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 772 | break; |
igor_v | 21:bc8c1cec3da6 | 773 | |
igor_v | 21:bc8c1cec3da6 | 774 | case 0xD9://m_control |
igor_v | 0:8ad47e2b6f00 | 775 | |
igor_v | 21:bc8c1cec3da6 | 776 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 777 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 778 | break; |
Kovalev_D | 102:4270092be987 | 779 | |
Kovalev_D | 102:4270092be987 | 780 | case 0xE4: |
Kovalev_D | 98:95b8e79f13e1 | 781 | lengf=8; |
Kovalev_D | 98:95b8e79f13e1 | 782 | break; |
Kovalev_D | 103:e96f08947def | 783 | |
Kovalev_D | 103:e96f08947def | 784 | |
Kovalev_D | 103:e96f08947def | 785 | case 0xE6: |
Kovalev_D | 103:e96f08947def | 786 | lengf=8; |
Kovalev_D | 103:e96f08947def | 787 | break; |
Kovalev_D | 103:e96f08947def | 788 | |
igor_v | 21:bc8c1cec3da6 | 789 | } |
Kovalev_D | 98:95b8e79f13e1 | 790 | |
igor_v | 21:bc8c1cec3da6 | 791 | return lengf; |
igor_v | 0:8ad47e2b6f00 | 792 | } |
igor_v | 0:8ad47e2b6f00 | 793 | |
igor_v | 0:8ad47e2b6f00 | 794 | void Read_CMD(void) |
igor_v | 21:bc8c1cec3da6 | 795 | { |
Kovalev_D | 92:c892f0311aa7 | 796 | |
Kovalev_D | 45:cbc955aecebe | 797 | |
Kovalev_D | 45:cbc955aecebe | 798 | Gyro.RsErrLine = (Gyro.RsErrLine)& 0xffff;//для сброса ошибки |
igor_v | 21:bc8c1cec3da6 | 799 | |
Kovalev_D | 93:b3803774f110 | 800 | CountBuFFIn=ReadChekCon1(BuffTemp); // чтение данных из консоли |
igor_v | 42:6fc307c4963e | 801 | |
Kovalev_D | 92:c892f0311aa7 | 802 | if(CountBuFFIn==1) { // если есть первый байт |
igor_v | 21:bc8c1cec3da6 | 803 | if (BuffTemp[0] != SOC_In) { |
Kovalev_D | 93:b3803774f110 | 804 | ReadCon1(BuffTemp); |
igor_v | 30:17c84ed091b3 | 805 | Gyro.RsErrLine += 0x100;//WriteCon("\n\r ...Error.... "); |
Kovalev_D | 93:b3803774f110 | 806 | BuffTemp[99]=Gyro.RsErrLine; |
Kovalev_D | 102:4270092be987 | 807 | |
igor_v | 21:bc8c1cec3da6 | 808 | } |
Kovalev_D | 92:c892f0311aa7 | 809 | } else if(CountBuFFIn==2) { //если второй ,fqn |
igor_v | 30:17c84ed091b3 | 810 | if (BuffTemp[1] != Gyro.My_Addres) { |
Kovalev_D | 93:b3803774f110 | 811 | ReadCon1(BuffTemp); |
igor_v | 30:17c84ed091b3 | 812 | Gyro.RsErrLine += 0x1;//WriteCon("\n\r ...Error_ADDRES.... "); |
igor_v | 21:bc8c1cec3da6 | 813 | } |
igor_v | 42:6fc307c4963e | 814 | } else if(CountBuFFIn==3) { // если ьоетий байт |
igor_v | 30:17c84ed091b3 | 815 | Gyro.CMD_In=BuffTemp[2]; |
Kovalev_D | 92:c892f0311aa7 | 816 | N=Getlengf(); |
Kovalev_D | 92:c892f0311aa7 | 817 | } |
Kovalev_D | 92:c892f0311aa7 | 818 | else if(CountBuFFIn==4 && (N==6)) |
Kovalev_D | 92:c892f0311aa7 | 819 | { // N - длина посылки аскглд(для записи параметров). определяется по коду команды в Getlengf(); |
igor_v | 21:bc8c1cec3da6 | 820 | Param1=BuffTemp[3]; |
Kovalev_D | 92:c892f0311aa7 | 821 | } |
Kovalev_D | 92:c892f0311aa7 | 822 | else if((CountBuFFIn==5)&&(N==7)) |
Kovalev_D | 92:c892f0311aa7 | 823 | { |
Kovalev_D | 92:c892f0311aa7 | 824 | |
igor_v | 21:bc8c1cec3da6 | 825 | Param1=BuffTemp[3]; |
igor_v | 21:bc8c1cec3da6 | 826 | Param2=BuffTemp[4]; |
igor_v | 0:8ad47e2b6f00 | 827 | |
Kovalev_D | 92:c892f0311aa7 | 828 | } |
Kovalev_D | 92:c892f0311aa7 | 829 | else if((CountBuFFIn==6)&&(N==8)) |
Kovalev_D | 92:c892f0311aa7 | 830 | { |
igor_v | 21:bc8c1cec3da6 | 831 | Param1=BuffTemp[3]; |
igor_v | 21:bc8c1cec3da6 | 832 | Param2=BuffTemp[4]; |
igor_v | 21:bc8c1cec3da6 | 833 | Param3=BuffTemp[5]; |
Kovalev_D | 92:c892f0311aa7 | 834 | } |
Kovalev_D | 102:4270092be987 | 835 | else if((CountBuFFIn==8)&&(N==10)) |
Kovalev_D | 102:4270092be987 | 836 | { |
Kovalev_D | 102:4270092be987 | 837 | Param1=BuffTemp[4]; |
Kovalev_D | 102:4270092be987 | 838 | Param2=BuffTemp[5]; |
Kovalev_D | 102:4270092be987 | 839 | Param3=BuffTemp[6]; |
Kovalev_D | 102:4270092be987 | 840 | Param4=BuffTemp[7]; |
Kovalev_D | 102:4270092be987 | 841 | } |
Kovalev_D | 98:95b8e79f13e1 | 842 | |
Kovalev_D | 92:c892f0311aa7 | 843 | else if(CountBuFFIn > (N-1)) |
Kovalev_D | 92:c892f0311aa7 | 844 | { |
Kovalev_D | 93:b3803774f110 | 845 | ReadCon1(BuffTemp); |
igor_v | 30:17c84ed091b3 | 846 | switch(Gyro.CMD_In) { |
Kovalev_D | 122:fbacb932a30b | 847 | Rate_Flag=0; |
Kovalev_D | 129:406995a91322 | 848 | |
Kovalev_D | 92:c892f0311aa7 | 849 | case 0x99: |
Kovalev_D | 124:9ae09249f842 | 850 | Gyro.ModeOut=0; |
igor_v | 21:bc8c1cec3da6 | 851 | CMD_Maintenance(); |
Kovalev_D | 124:9ae09249f842 | 852 | break; |
Kovalev_D | 129:406995a91322 | 853 | |
Kovalev_D | 124:9ae09249f842 | 854 | case 0xA0: |
Kovalev_D | 124:9ae09249f842 | 855 | TempParam=(BuffTemp[3]) & 0x90; |
Kovalev_D | 124:9ae09249f842 | 856 | if (TempParam==Delta_500) CMD_Delta_500Hz(); |
Kovalev_D | 124:9ae09249f842 | 857 | else if (TempParam==Delta_EXT) CMD_Delta_Ext(); |
Kovalev_D | 124:9ae09249f842 | 858 | else if (TempParam==PDelta_500) { Gyro.ModeOut=3; Gyro.Delta500_Event=0; WriteCon("Delta500"); } |
Kovalev_D | 124:9ae09249f842 | 859 | else if (TempParam==PDelta_EXT) { Gyro.ModeOut=4; Gyro.DeltaEXT_Event=0; WriteCon("deltaEXT"); } |
igor_v | 21:bc8c1cec3da6 | 860 | break; |
Kovalev_D | 129:406995a91322 | 861 | |
igor_v | 21:bc8c1cec3da6 | 862 | case 0xD8: |
igor_v | 21:bc8c1cec3da6 | 863 | CMD_M_Control_D8(); |
Kovalev_D | 124:9ae09249f842 | 864 | break; |
Kovalev_D | 129:406995a91322 | 865 | |
Kovalev_D | 129:406995a91322 | 866 | case 0xE9://чтение параметров |
Kovalev_D | 129:406995a91322 | 867 | CMD_M_Param_R(); |
Kovalev_D | 129:406995a91322 | 868 | break; |
Kovalev_D | 129:406995a91322 | 869 | |
Kovalev_D | 129:406995a91322 | 870 | case 0xE8://запись параметра |
Kovalev_D | 129:406995a91322 | 871 | CMD_M_Param_W(); |
Kovalev_D | 129:406995a91322 | 872 | break; |
Kovalev_D | 129:406995a91322 | 873 | |
igor_v | 21:bc8c1cec3da6 | 874 | case 0xD9: |
igor_v | 21:bc8c1cec3da6 | 875 | CMD_M_Control_D9(); |
igor_v | 21:bc8c1cec3da6 | 876 | break; |
Kovalev_D | 129:406995a91322 | 877 | |
igor_v | 21:bc8c1cec3da6 | 878 | case 0x0A: |
Kovalev_D | 45:cbc955aecebe | 879 | CMD_M_Stymul(); |
igor_v | 21:bc8c1cec3da6 | 880 | break; |
Kovalev_D | 129:406995a91322 | 881 | |
igor_v | 21:bc8c1cec3da6 | 882 | case 0xDD: |
Kovalev_D | 124:9ae09249f842 | 883 | TempParam=(BuffTemp[3]) & 0x9f; |
Kovalev_D | 124:9ae09249f842 | 884 | if (TempParam == Rate1) { CMD_Rate(); WriteCon("Rate11");} |
Kovalev_D | 124:9ae09249f842 | 885 | else if (TempParam == Rate2) { CMD_Rate2(); WriteCon("Rate21");} |
Kovalev_D | 124:9ae09249f842 | 886 | else if (TempParam == PRate1) { Gyro.ModeOut=1; Gyro.Rate1_Event=0; WriteCon("Rate12");} |
Kovalev_D | 124:9ae09249f842 | 887 | else if (TempParam == PRate2) { Gyro.ModeOut=2; Gyro.Rate2_Event=0; WriteCon("Rate22");} |
Kovalev_D | 122:fbacb932a30b | 888 | break; |
Kovalev_D | 129:406995a91322 | 889 | |
Kovalev_D | 102:4270092be987 | 890 | case 0xE4: |
Kovalev_D | 102:4270092be987 | 891 | CMD_M_vib(); |
Kovalev_D | 102:4270092be987 | 892 | break; |
Kovalev_D | 129:406995a91322 | 893 | |
Kovalev_D | 103:e96f08947def | 894 | case 0xE6: |
Kovalev_D | 103:e96f08947def | 895 | Gph_W(); |
Kovalev_D | 103:e96f08947def | 896 | break; |
Kovalev_D | 108:030cdde08314 | 897 | |
Kovalev_D | 103:e96f08947def | 898 | |
igor_v | 30:17c84ed091b3 | 899 | Gyro.RsErrLine = 0; |
Kovalev_D | 103:e96f08947def | 900 | |
Kovalev_D | 103:e96f08947def | 901 | |
Kovalev_D | 102:4270092be987 | 902 | } |
Kovalev_D | 121:bbae560cdd43 | 903 | |
igor_v | 21:bc8c1cec3da6 | 904 | } |
Kovalev_D | 121:bbae560cdd43 | 905 | // else if(CountBuFFIn > 40 ) |
Kovalev_D | 121:bbae560cdd43 | 906 | // { |
Kovalev_D | 121:bbae560cdd43 | 907 | // ReadCon1(BuffTemp); |
Kovalev_D | 121:bbae560cdd43 | 908 | // } |
Kovalev_D | 121:bbae560cdd43 | 909 | |
igor_v | 0:8ad47e2b6f00 | 910 | } |
igor_v | 0:8ad47e2b6f00 | 911 | |
igor_v | 0:8ad47e2b6f00 | 912 | |
igor_v | 21:bc8c1cec3da6 | 913 |