![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LG2 by
vibro.h@106:250ddd8629c6, 2016-04-01 (annotated)
- Committer:
- Kovalev_D
- Date:
- Fri Apr 01 10:05:35 2016 +0000
- Revision:
- 106:250ddd8629c6
- Parent:
- 104:ab1cb4ff56b2
- Child:
- 107:4d178bcc9d8a
54
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 0:8ad47e2b6f00 | 1 | #ifndef VIBRO_H |
igor_v | 0:8ad47e2b6f00 | 2 | #define VIBRO_H |
igor_v | 0:8ad47e2b6f00 | 3 | |
igor_v | 21:bc8c1cec3da6 | 4 | #define ClrV1 LPC_GPIO1->FIOSET=(1<<25); |
Kovalev_D | 87:7e575d26d6d0 | 5 | #define SetV1 LPC_GPIO1->FIOCLR = (1<<25); |
igor_v | 1:f2adcae3d304 | 6 | |
Kovalev_D | 47:d902ef6f7564 | 7 | #define TXOn LPC_GPIO2->FIOSET=(1<<7); |
Kovalev_D | 47:d902ef6f7564 | 8 | #define TXOff LPC_GPIO2->FIOCLR = (1<<7); |
Kovalev_D | 47:d902ef6f7564 | 9 | |
igor_v | 21:bc8c1cec3da6 | 10 | #define ClrV2 LPC_GPIO1->FIOSET = (1<<28); |
igor_v | 21:bc8c1cec3da6 | 11 | #define SetV2 LPC_GPIO1->FIOCLR = (1<<28); |
igor_v | 0:8ad47e2b6f00 | 12 | |
Kovalev_D | 26:52ce5953a5c2 | 13 | #define LoopOn LPC_GPIO1->FIOSET = (1<<30); |
Kovalev_D | 26:52ce5953a5c2 | 14 | #define LoopOff LPC_GPIO1->FIOCLR = (1<<30); |
Kovalev_D | 26:52ce5953a5c2 | 15 | #define StartV1 0 |
Kovalev_D | 26:52ce5953a5c2 | 16 | #define StartV2 15 |
igor_v | 0:8ad47e2b6f00 | 17 | #define TIME_INTERVAL (7812) |
igor_v | 0:8ad47e2b6f00 | 18 | |
igor_v | 0:8ad47e2b6f00 | 19 | |
igor_v | 33:341521841d3a | 20 | typedef struct _Gyro { |
igor_v | 33:341521841d3a | 21 | |
Kovalev_D | 26:52ce5953a5c2 | 22 | |
Kovalev_D | 85:0466ee8cdfc8 | 23 | unsigned int RgConA; |
Kovalev_D | 85:0466ee8cdfc8 | 24 | unsigned int RgConB; |
Kovalev_D | 26:52ce5953a5c2 | 25 | |
Kovalev_D | 103:e96f08947def | 26 | |
Kovalev_D | 103:e96f08947def | 27 | unsigned int Gain_A; |
Kovalev_D | 103:e96f08947def | 28 | unsigned int Gain_B; |
Kovalev_D | 26:52ce5953a5c2 | 29 | |
igor_v | 37:bdd52117b56e | 30 | unsigned int Frq; // Непосредственное значение частоты для таймера. |
igor_v | 37:bdd52117b56e | 31 | unsigned int FrqHZ; // Частота в Гц. |
Kovalev_D | 85:0466ee8cdfc8 | 32 | |
Kovalev_D | 85:0466ee8cdfc8 | 33 | |
Kovalev_D | 26:52ce5953a5c2 | 34 | unsigned int Amp; |
Kovalev_D | 85:0466ee8cdfc8 | 35 | //unsigned int AmpL; |
Kovalev_D | 85:0466ee8cdfc8 | 36 | unsigned int AmpT; // значение тиков после которых происходит смена амплитуды ошумления ( rand() % Gyro.AmpTD+Gyro.AmpMin) |
Kovalev_D | 85:0466ee8cdfc8 | 37 | unsigned int AmpMin; // минимальное значение AmpT(частота ошумления); |
Kovalev_D | 85:0466ee8cdfc8 | 38 | unsigned int AmpTD; // максимальное значение AmpT(частота ошумления); |
Kovalev_D | 85:0466ee8cdfc8 | 39 | unsigned int AmpPer; // Амплитуда в процентах; |
Kovalev_D | 85:0466ee8cdfc8 | 40 | unsigned int AmpPerDel;// значение для расчета амплитуды(дельта амплитуды), мин знач : AmpPer-AmpPerDel, мах знач : AmpPer+AmpPerDel; |
Kovalev_D | 26:52ce5953a5c2 | 41 | unsigned int AmpN1; |
Kovalev_D | 26:52ce5953a5c2 | 42 | unsigned int AmpN2; |
Kovalev_D | 85:0466ee8cdfc8 | 43 | |
Kovalev_D | 26:52ce5953a5c2 | 44 | unsigned int CMD_In; |
Kovalev_D | 26:52ce5953a5c2 | 45 | unsigned int SOC_Out; |
Kovalev_D | 26:52ce5953a5c2 | 46 | unsigned int My_Addres; |
Kovalev_D | 26:52ce5953a5c2 | 47 | unsigned int GLD_Serial; |
Kovalev_D | 26:52ce5953a5c2 | 48 | unsigned int CRC; |
Kovalev_D | 26:52ce5953a5c2 | 49 | unsigned int Firmware_Version; |
Kovalev_D | 26:52ce5953a5c2 | 50 | unsigned int RsErrLine; |
Kovalev_D | 26:52ce5953a5c2 | 51 | |
Kovalev_D | 106:250ddd8629c6 | 52 | |
Kovalev_D | 106:250ddd8629c6 | 53 | int CuruAngle ; |
Kovalev_D | 106:250ddd8629c6 | 54 | int OldCuruAngle ; |
Kovalev_D | 106:250ddd8629c6 | 55 | int Num; |
Kovalev_D | 106:250ddd8629c6 | 56 | int Cnt_Pls; |
Kovalev_D | 106:250ddd8629c6 | 57 | int Cnt_Mns; |
Kovalev_D | 106:250ddd8629c6 | 58 | int Cnt_Dif; |
Kovalev_D | 26:52ce5953a5c2 | 59 | unsigned int T_Vib; |
Kovalev_D | 26:52ce5953a5c2 | 60 | unsigned int F_ras; |
Kovalev_D | 106:250ddd8629c6 | 61 | unsigned int tau; |
Kovalev_D | 104:ab1cb4ff56b2 | 62 | |
Kovalev_D | 104:ab1cb4ff56b2 | 63 | |
Kovalev_D | 104:ab1cb4ff56b2 | 64 | #define FrqOff Gyro.RgConA &= ~AFRQ; //установить бит светодиода в "0" |
Kovalev_D | 104:ab1cb4ff56b2 | 65 | #define FrqON Gyro.RgConA |= AFRQ; //установить бит светодиода в "1" |
Kovalev_D | 104:ab1cb4ff56b2 | 66 | |
Kovalev_D | 104:ab1cb4ff56b2 | 67 | #define HFOOFF Gyro.RgConA &= ~AHFO; //установить бит светодиода в "0" |
Kovalev_D | 104:ab1cb4ff56b2 | 68 | #define HFOON Gyro.RgConA |= AHFO; //установить бит светодиода в "1" |
Kovalev_D | 104:ab1cb4ff56b2 | 69 | |
Kovalev_D | 104:ab1cb4ff56b2 | 70 | #define PlcOFF Gyro.RgConA &= ~APLC; //установить бит светодиода в "0" |
Kovalev_D | 104:ab1cb4ff56b2 | 71 | #define PlcON Gyro.RgConA |= APLC; //установить бит светодиода в "1" |
Kovalev_D | 104:ab1cb4ff56b2 | 72 | |
Kovalev_D | 104:ab1cb4ff56b2 | 73 | #define AFRQ (1<<0) |
Kovalev_D | 104:ab1cb4ff56b2 | 74 | #define AHFO (1<<1) |
Kovalev_D | 104:ab1cb4ff56b2 | 75 | #define APLC (1<<2) |
Kovalev_D | 85:0466ee8cdfc8 | 76 | |
Kovalev_D | 28:1c9acd3b224d | 77 | unsigned int PinReg; // bit5 bit4 bit 3 bit1 bit0 |
Kovalev_D | 28:1c9acd3b224d | 78 | unsigned int PinRegOld; // || светодиод || состояние поджига || состояние подсветки || состояние вибро 2 || состояние вибро 1 || |
Kovalev_D | 40:8a6494f61326 | 79 | #define LedOFF Gyro.PinReg &= ~PinRegBitLED; //установить бит светодиода в "0" |
igor_v | 48:8697dfe679b9 | 80 | #define LedON Gyro.PinReg |= PinRegBitLED; //установить бит светодиода в "1" |
Kovalev_D | 40:8a6494f61326 | 81 | |
Kovalev_D | 104:ab1cb4ff56b2 | 82 | |
Kovalev_D | 104:ab1cb4ff56b2 | 83 | |
igor_v | 48:8697dfe679b9 | 84 | #define PinRegBitTXE (1<<5) |
igor_v | 48:8697dfe679b9 | 85 | #define PinRegBitLED (1<<4) |
igor_v | 48:8697dfe679b9 | 86 | #define PinRegBitD (1<<3) |
igor_v | 48:8697dfe679b9 | 87 | #define PinRegBitL (1<<2) |
igor_v | 48:8697dfe679b9 | 88 | #define PinRegBit_2V (1<<1) |
igor_v | 48:8697dfe679b9 | 89 | #define PinRegBit_1V (1<<0) |
Kovalev_D | 40:8a6494f61326 | 90 | unsigned int Discharg; // последовательность бит харрактеризующая форму сигнала поджига. |
igor_v | 48:8697dfe679b9 | 91 | #define StartDischarg 0x00000055 |
Kovalev_D | 40:8a6494f61326 | 92 | unsigned int BackLight; // последовательность бит харрактеризующая форму сигнала подсветки. |
igor_v | 48:8697dfe679b9 | 93 | #define StartBackLight 0x00000055 |
igor_v | 33:341521841d3a | 94 | } GyroT, *Gyro_p; |
igor_v | 33:341521841d3a | 95 | |
igor_v | 30:17c84ed091b3 | 96 | extern GyroT Gyro; |
Kovalev_D | 28:1c9acd3b224d | 97 | |
Kovalev_D | 28:1c9acd3b224d | 98 | |
Kovalev_D | 26:52ce5953a5c2 | 99 | |
Kovalev_D | 28:1c9acd3b224d | 100 | |
Kovalev_D | 28:1c9acd3b224d | 101 | |
Kovalev_D | 28:1c9acd3b224d | 102 | |
Kovalev_D | 99:3d8f206ceac2 | 103 | extern unsigned int ffff; |
Kovalev_D | 87:7e575d26d6d0 | 104 | |
igor_v | 0:8ad47e2b6f00 | 105 | extern void cheng(void); |
igor_v | 0:8ad47e2b6f00 | 106 | extern void Noise(void); |
igor_v | 0:8ad47e2b6f00 | 107 | extern void VibroOut(void); |
Kovalev_D | 89:a0d344db227e | 108 | extern void Discharg (void); |
Kovalev_D | 89:a0d344db227e | 109 | extern void BackLight (void); |
Kovalev_D | 98:95b8e79f13e1 | 110 | extern unsigned int FrecTp; |
Kovalev_D | 98:95b8e79f13e1 | 111 | extern int Pulse_midl; |
igor_v | 0:8ad47e2b6f00 | 112 | extern struct VIBRO Vib; |
igor_v | 0:8ad47e2b6f00 | 113 | extern int PulseHalf; |
igor_v | 30:17c84ed091b3 | 114 | extern int CuruAngle; |
igor_v | 0:8ad47e2b6f00 | 115 | extern unsigned int FrecTemp; |
igor_v | 0:8ad47e2b6f00 | 116 | #endif |
igor_v | 0:8ad47e2b6f00 | 117 |