![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
vibro.h@47:d902ef6f7564, 2016-02-10 (annotated)
- Committer:
- Kovalev_D
- Date:
- Wed Feb 10 14:06:57 2016 +0000
- Revision:
- 47:d902ef6f7564
- Parent:
- 40:8a6494f61326
- Child:
- 48:8697dfe679b9
??????? ???? ?????????? ????
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); |
igor_v | 21:bc8c1cec3da6 | 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 | 26:52ce5953a5c2 | 23 | unsigned int RgConA; |
Kovalev_D | 26:52ce5953a5c2 | 24 | unsigned int RgConB; |
Kovalev_D | 26:52ce5953a5c2 | 25 | |
Kovalev_D | 26:52ce5953a5c2 | 26 | |
igor_v | 37:bdd52117b56e | 27 | unsigned int Frq; // Непосредственное значение частоты для таймера. |
igor_v | 37:bdd52117b56e | 28 | unsigned int FrqHZ; // Частота в Гц. |
igor_v | 37:bdd52117b56e | 29 | unsigned int FrqRate; // Разброс частот при ошумлении. |
Kovalev_D | 26:52ce5953a5c2 | 30 | unsigned int FrqMin; // Минимальное значение ошумленной частоты. |
Kovalev_D | 26:52ce5953a5c2 | 31 | unsigned int FrqOld; // Значение частоты за прошлый такт. |
Kovalev_D | 26:52ce5953a5c2 | 32 | |
Kovalev_D | 26:52ce5953a5c2 | 33 | unsigned int Amp; |
Kovalev_D | 26:52ce5953a5c2 | 34 | unsigned int AmpL; |
Kovalev_D | 26:52ce5953a5c2 | 35 | unsigned int AmpT; |
Kovalev_D | 26:52ce5953a5c2 | 36 | unsigned int AmpPer; |
Kovalev_D | 26:52ce5953a5c2 | 37 | unsigned int AmpPerDel;//0-100% |
Kovalev_D | 26:52ce5953a5c2 | 38 | unsigned int AmpN1; |
Kovalev_D | 26:52ce5953a5c2 | 39 | unsigned int AmpN2; |
Kovalev_D | 26:52ce5953a5c2 | 40 | unsigned int AmpMin; |
Kovalev_D | 26:52ce5953a5c2 | 41 | unsigned int AmpTD; |
Kovalev_D | 26:52ce5953a5c2 | 42 | |
Kovalev_D | 26:52ce5953a5c2 | 43 | unsigned int CMD_In; |
Kovalev_D | 26:52ce5953a5c2 | 44 | unsigned int SOC_Out; |
Kovalev_D | 26:52ce5953a5c2 | 45 | unsigned int My_Addres; |
Kovalev_D | 26:52ce5953a5c2 | 46 | unsigned int GLD_Serial; |
Kovalev_D | 26:52ce5953a5c2 | 47 | unsigned int CRC; |
Kovalev_D | 26:52ce5953a5c2 | 48 | unsigned int Firmware_Version; |
Kovalev_D | 26:52ce5953a5c2 | 49 | unsigned int RsErrLine; |
Kovalev_D | 26:52ce5953a5c2 | 50 | |
Kovalev_D | 26:52ce5953a5c2 | 51 | unsigned int Cnt_Pls; |
Kovalev_D | 26:52ce5953a5c2 | 52 | unsigned int Cnt_Mns; |
Kovalev_D | 26:52ce5953a5c2 | 53 | unsigned int Cnt_Dif; |
Kovalev_D | 26:52ce5953a5c2 | 54 | unsigned int T_Vib; |
Kovalev_D | 26:52ce5953a5c2 | 55 | unsigned int F_ras; |
Kovalev_D | 28:1c9acd3b224d | 56 | unsigned int PinReg; // bit5 bit4 bit 3 bit1 bit0 |
Kovalev_D | 28:1c9acd3b224d | 57 | unsigned int PinRegOld; // || светодиод || состояние поджига || состояние подсветки || состояние вибро 2 || состояние вибро 1 || |
Kovalev_D | 40:8a6494f61326 | 58 | |
Kovalev_D | 40:8a6494f61326 | 59 | |
Kovalev_D | 40:8a6494f61326 | 60 | #define LedOFF Gyro.PinReg &= ~PinRegBitLED; //установить бит светодиода в "0" |
Kovalev_D | 40:8a6494f61326 | 61 | #define LedON Gyro.PinReg |= PinRegBit_2V; //установить бит светодиода в "1" |
Kovalev_D | 40:8a6494f61326 | 62 | |
Kovalev_D | 47:d902ef6f7564 | 63 | #define PinRegBitTXE 1<<5 |
Kovalev_D | 47:d902ef6f7564 | 64 | #define PinRegBitLED 1<<4 |
Kovalev_D | 47:d902ef6f7564 | 65 | #define PinRegBitD 1<<3 |
Kovalev_D | 47:d902ef6f7564 | 66 | #define PinRegBitL 1<<2 |
Kovalev_D | 47:d902ef6f7564 | 67 | #define PinRegBit_2V 1<<1 |
Kovalev_D | 47:d902ef6f7564 | 68 | #define PinRegBit_1V 1<<0 |
Kovalev_D | 40:8a6494f61326 | 69 | unsigned int Discharg; // последовательность бит харрактеризующая форму сигнала поджига. |
Kovalev_D | 47:d902ef6f7564 | 70 | #define StartDischarg 0x00000055 |
Kovalev_D | 40:8a6494f61326 | 71 | unsigned int BackLight; // последовательность бит харрактеризующая форму сигнала подсветки. |
Kovalev_D | 47:d902ef6f7564 | 72 | #define StartBackLight 0x00000055 |
igor_v | 30:17c84ed091b3 | 73 | |
igor_v | 30:17c84ed091b3 | 74 | |
igor_v | 33:341521841d3a | 75 | |
igor_v | 33:341521841d3a | 76 | } GyroT, *Gyro_p; |
igor_v | 33:341521841d3a | 77 | |
igor_v | 30:17c84ed091b3 | 78 | extern GyroT Gyro; |
Kovalev_D | 28:1c9acd3b224d | 79 | |
Kovalev_D | 28:1c9acd3b224d | 80 | |
Kovalev_D | 26:52ce5953a5c2 | 81 | |
Kovalev_D | 28:1c9acd3b224d | 82 | |
Kovalev_D | 28:1c9acd3b224d | 83 | |
Kovalev_D | 28:1c9acd3b224d | 84 | |
igor_v | 0:8ad47e2b6f00 | 85 | |
Kovalev_D | 28:1c9acd3b224d | 86 | extern void init_Vibro (); |
igor_v | 0:8ad47e2b6f00 | 87 | extern void cheng(void); |
igor_v | 0:8ad47e2b6f00 | 88 | extern void Noise(void); |
igor_v | 0:8ad47e2b6f00 | 89 | extern void VibroOut(void); |
igor_v | 0:8ad47e2b6f00 | 90 | |
igor_v | 0:8ad47e2b6f00 | 91 | extern int Pulse_midl ; |
igor_v | 0:8ad47e2b6f00 | 92 | extern struct VIBRO Vib; |
igor_v | 0:8ad47e2b6f00 | 93 | extern int PulseHalf; |
igor_v | 30:17c84ed091b3 | 94 | extern int CuruAngle; |
igor_v | 0:8ad47e2b6f00 | 95 | extern unsigned int FrecTemp; |
igor_v | 0:8ad47e2b6f00 | 96 | #endif |
igor_v | 0:8ad47e2b6f00 | 97 |