![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fork
Fork of LG by
Global.c@87:7e575d26d6d0, 2016-03-24 (annotated)
- Committer:
- Kovalev_D
- Date:
- Thu Mar 24 09:16:55 2016 +0000
- Revision:
- 87:7e575d26d6d0
- Parent:
- 86:398da56ef751
- Child:
- 88:b5c1d9d338d1
GLD_Init
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 0:8ad47e2b6f00 | 1 | #include "Global.h" |
igor_v | 0:8ad47e2b6f00 | 2 | |
igor_v | 0:8ad47e2b6f00 | 3 | |
igor_v | 0:8ad47e2b6f00 | 4 | |
igor_v | 21:bc8c1cec3da6 | 5 | unsigned int VibroReg = 0; //регистр состаяния вибропривода. |
Kovalev_D | 86:398da56ef751 | 6 | unsigned long Global_Time, Time_UART,Time_Sec,Time_vibro,Time_1kHz; |
igor_v | 0:8ad47e2b6f00 | 7 | unsigned long MaxAmp=0; |
igor_v | 0:8ad47e2b6f00 | 8 | unsigned char BuffTemp[100]; |
igor_v | 51:81f47b817071 | 9 | unsigned char Time[500]; |
Kovalev_D | 86:398da56ef751 | 10 | unsigned int Event1Hz; |
Kovalev_D | 86:398da56ef751 | 11 | unsigned int Event1K ; |
Kovalev_D | 86:398da56ef751 | 12 | unsigned int Event100K; |
Kovalev_D | 86:398da56ef751 | 13 | unsigned int EventVibro; |
Kovalev_D | 86:398da56ef751 | 14 | unsigned int Time1K; |
Kovalev_D | 86:398da56ef751 | 15 | unsigned int Time100K; |
Kovalev_D | 86:398da56ef751 | 16 | unsigned int Time1Hz; |
Kovalev_D | 86:398da56ef751 | 17 | unsigned int Clock1Hz; |
Kovalev_D | 86:398da56ef751 | 18 | unsigned int ShiftD; |
Kovalev_D | 86:398da56ef751 | 19 | unsigned int ShiftL; |
Kovalev_D | 86:398da56ef751 | 20 | |
Kovalev_D | 86:398da56ef751 | 21 | void GLD_Init(void) |
Kovalev_D | 86:398da56ef751 | 22 | { |
Kovalev_D | 86:398da56ef751 | 23 | ///////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 24 | ///////////обнуление счетчиков/////////////// |
Kovalev_D | 86:398da56ef751 | 25 | ///////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 26 | Global_Time = 0; |
Kovalev_D | 86:398da56ef751 | 27 | Time_UART = 0; |
Kovalev_D | 86:398da56ef751 | 28 | Time_Sec = 0; |
Kovalev_D | 86:398da56ef751 | 29 | Time_vibro = 0; |
Kovalev_D | 86:398da56ef751 | 30 | Time_1kHz = 0; |
Kovalev_D | 86:398da56ef751 | 31 | Event1Hz = 0; |
Kovalev_D | 86:398da56ef751 | 32 | Event1K = 0; |
Kovalev_D | 86:398da56ef751 | 33 | Event100K = 0; |
Kovalev_D | 86:398da56ef751 | 34 | EventVibro = 0; |
Kovalev_D | 86:398da56ef751 | 35 | Time1K = 0; |
Kovalev_D | 86:398da56ef751 | 36 | Time100K = 0; |
Kovalev_D | 86:398da56ef751 | 37 | Time1Hz = 0; |
Kovalev_D | 86:398da56ef751 | 38 | Clock1Hz = 0; |
Kovalev_D | 86:398da56ef751 | 39 | ShiftD = 0; |
Kovalev_D | 86:398da56ef751 | 40 | ShiftL = 0; |
Kovalev_D | 86:398da56ef751 | 41 | ///////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 42 | ///////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 43 | |
Kovalev_D | 86:398da56ef751 | 44 | /* |
Kovalev_D | 86:398da56ef751 | 45 | Gyro.SOC_Out=0xDD; |
Kovalev_D | 86:398da56ef751 | 46 | Gyro.Firmware_Version =0x15; //версия программы |
Kovalev_D | 86:398da56ef751 | 47 | Gyro.GLD_Serial = 0x20; //серийный номер |
Kovalev_D | 86:398da56ef751 | 48 | Gyro.My_Addres = 0; //адрес глд |
Kovalev_D | 86:398da56ef751 | 49 | Gyro.Discharg = StartDischarg; |
Kovalev_D | 86:398da56ef751 | 50 | Gyro.BackLight = StartBackLight; |
Kovalev_D | 86:398da56ef751 | 51 | */ |
Kovalev_D | 87:7e575d26d6d0 | 52 | |
Kovalev_D | 87:7e575d26d6d0 | 53 | |
Kovalev_D | 86:398da56ef751 | 54 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 55 | ////////инициализация цап (р0.26 цап выход)////////// |
Kovalev_D | 86:398da56ef751 | 56 | //////////////////середина шкалы///////////////////// |
Kovalev_D | 86:398da56ef751 | 57 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 58 | LPC_PINCON->PINSEL1 = 0x00200000; |
Kovalev_D | 86:398da56ef751 | 59 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 60 | ////////////начальное значение для цап/////////////// |
Kovalev_D | 86:398da56ef751 | 61 | //////////////////середина шкалы///////////////////// |
Kovalev_D | 86:398da56ef751 | 62 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 63 | Spi.DAC_A = 0x7fff; |
Kovalev_D | 86:398da56ef751 | 64 | Spi.DAC_B = 0x7fff; |
Kovalev_D | 86:398da56ef751 | 65 | //////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 66 | /////////////поправочный коэффициент///////////////// |
Kovalev_D | 86:398da56ef751 | 67 | /////////для цапов (граници +-12.5 вольт)//////////// |
Kovalev_D | 86:398da56ef751 | 68 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 69 | K_DAC=65535.0/(65535.0+(deltaDAC+deltaDAC/2)); |
Kovalev_D | 86:398da56ef751 | 70 | K_DAC=0.8; |
Kovalev_D | 86:398da56ef751 | 71 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 72 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 73 | |
igor_v | 16:18e3fd7b92d0 | 74 | |
igor_v | 16:18e3fd7b92d0 | 75 | |
Kovalev_D | 86:398da56ef751 | 76 | secPuls =0;// переменная для конопки поджига аск глд(временная) |
Kovalev_D | 86:398da56ef751 | 77 | |
Kovalev_D | 86:398da56ef751 | 78 | |
Kovalev_D | 86:398da56ef751 | 79 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 80 | /////////////обнуление переменых для///////////////// |
Kovalev_D | 86:398da56ef751 | 81 | ///////////////переменных энкодера/////////////////// |
Kovalev_D | 86:398da56ef751 | 82 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 83 | Cur_QEI=0; |
Kovalev_D | 86:398da56ef751 | 84 | Last_QEI=0; |
Kovalev_D | 86:398da56ef751 | 85 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 86 | /////////////инициализация энкодера////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 87 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 88 | LPC_SC->PCONP |= (1<<18);//0x00040000; включение квадратурного энкодера. |
Kovalev_D | 87:7e575d26d6d0 | 89 | LPC_SC->PCLKSEL1 |= 0x00000001; // выбор частоты для кв.э. CLK=100MHz |
Kovalev_D | 87:7e575d26d6d0 | 90 | LPC_PINCON->PINSEL3 &= ~0x4100; |
Kovalev_D | 87:7e575d26d6d0 | 91 | LPC_PINCON->PINSEL3 |= 0x4100; //P1.20, p1.23 установить как входы кв.э |
Kovalev_D | 87:7e575d26d6d0 | 92 | LPC_PINCON->PINMODE3 |= 0x3C300; //P1.20, p1.23, p1.24 ??are pulled-down??(притянуть к питанию)???? |
Kovalev_D | 86:398da56ef751 | 93 | |
Kovalev_D | 87:7e575d26d6d0 | 94 | LPC_QEI->MAXPOS = MAX_QEI_CNT; //LPC_QEI->"регистор максимального положения" = 2147483646 |
Kovalev_D | 87:7e575d26d6d0 | 95 | LPC_QEI->FILTER = 2; // фильтр( ?? ) |
Kovalev_D | 87:7e575d26d6d0 | 96 | LPC_QEI->CON = 0xF; //сбросить в ноль все счетчики кв.э. (скорость, направление, позицию и тд) |
Kovalev_D | 87:7e575d26d6d0 | 97 | LPC_QEI->CONF = (0<<2) |(0<<1); //Quadrature inputs, no inverting,only A pulses are counted |
Kovalev_D | 87:7e575d26d6d0 | 98 | |
Kovalev_D | 87:7e575d26d6d0 | 99 | LPC_QEI->CLR = 0x1fff; //r. сбросить все прерывания |
Kovalev_D | 87:7e575d26d6d0 | 100 | LPC_QEI->IEC = 0x1fff; //r. запретить прерывание при изменении направления |
Kovalev_D | 87:7e575d26d6d0 | 101 | |
Kovalev_D | 87:7e575d26d6d0 | 102 | NVIC_SetPriority(QEI_IRQn, 0); |
Kovalev_D | 87:7e575d26d6d0 | 103 | NVIC_EnableIRQ(QEI_IRQn); |
Kovalev_D | 87:7e575d26d6d0 | 104 | ////////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 105 | ////////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 106 | |
Kovalev_D | 87:7e575d26d6d0 | 107 | |
Kovalev_D | 87:7e575d26d6d0 | 108 | |
Kovalev_D | 86:398da56ef751 | 109 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 110 | /////////////обнуление переменых для///////////////// |
Kovalev_D | 86:398da56ef751 | 111 | ///////////расчета значений буферов ВП/////////////// |
Kovalev_D | 86:398da56ef751 | 112 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 113 | |
Kovalev_D | 87:7e575d26d6d0 | 114 | |
Kovalev_D | 87:7e575d26d6d0 | 115 | /////////////инициализация переменных в структ вибро///////////////// |
Kovalev_D | 87:7e575d26d6d0 | 116 | Gyro.FrqHZ=449; |
Kovalev_D | 87:7e575d26d6d0 | 117 | Gyro.Frq = Gyro.FrqHZ<<16; |
Kovalev_D | 87:7e575d26d6d0 | 118 | Gyro.AmpPer=20; |
Kovalev_D | 87:7e575d26d6d0 | 119 | Gyro.AmpPerDel=10; |
Kovalev_D | 87:7e575d26d6d0 | 120 | Gyro.Amp = 10*65535; |
Kovalev_D | 87:7e575d26d6d0 | 121 | Gyro.AmpMin =10;// минимальное значение AmpT; |
Kovalev_D | 87:7e575d26d6d0 | 122 | Gyro.AmpTD =30;// максимальное значение AmpT; (AmpT частота ошумления) |
Kovalev_D | 87:7e575d26d6d0 | 123 | ////////////////////////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 124 | |
Kovalev_D | 86:398da56ef751 | 125 | CuruAngle = 0; |
Kovalev_D | 86:398da56ef751 | 126 | Pulse_8Point = 0; |
Kovalev_D | 86:398da56ef751 | 127 | Pulse_16Point = 0; |
Kovalev_D | 86:398da56ef751 | 128 | Pulse_16PointD = 0; |
Kovalev_D | 86:398da56ef751 | 129 | Pulse_32Point = 0; |
Kovalev_D | 86:398da56ef751 | 130 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 131 | /////////////предварительное заполнение////////////// |
Kovalev_D | 86:398da56ef751 | 132 | ////////////////буферов вибропривода///////////////// |
Kovalev_D | 86:398da56ef751 | 133 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 134 | for (int i = 0; i < 32; i++ ) { |
Kovalev_D | 86:398da56ef751 | 135 | |
Kovalev_D | 86:398da56ef751 | 136 | Buff_16Point[i] = 0x00; |
Kovalev_D | 86:398da56ef751 | 137 | Buff_8Point[i] = 0x00; |
Kovalev_D | 86:398da56ef751 | 138 | Buff_32Point[i] = 0x00; |
Kovalev_D | 86:398da56ef751 | 139 | Buff_16PointD[i] = 0x00; |
Kovalev_D | 86:398da56ef751 | 140 | } |
Kovalev_D | 86:398da56ef751 | 141 | //////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 142 | //////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 143 | |
Kovalev_D | 86:398da56ef751 | 144 | |
Kovalev_D | 86:398da56ef751 | 145 | |
Kovalev_D | 86:398da56ef751 | 146 | |
Kovalev_D | 86:398da56ef751 | 147 | |
Kovalev_D | 86:398da56ef751 | 148 | |
Kovalev_D | 86:398da56ef751 | 149 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 150 | /////////////обнуление переменых для///////////////// |
Kovalev_D | 86:398da56ef751 | 151 | //////////////////переменных ацп///////////////////// |
Kovalev_D | 86:398da56ef751 | 152 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 153 | Temp_AMP=0; |
Kovalev_D | 86:398da56ef751 | 154 | Temp_ADC_2=0; |
Kovalev_D | 86:398da56ef751 | 155 | Temp_ADC_3=0; |
Kovalev_D | 86:398da56ef751 | 156 | Temp_ADC_4=0; |
Kovalev_D | 86:398da56ef751 | 157 | Temp_ADC_5=0; |
Kovalev_D | 86:398da56ef751 | 158 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 159 | /////////////предварительное заполнение////////////// |
Kovalev_D | 86:398da56ef751 | 160 | /////////////////////буферов АЦП///////////////////// |
Kovalev_D | 86:398da56ef751 | 161 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 162 | for (int i = 0; i < 16; i++ ) { |
Kovalev_D | 86:398da56ef751 | 163 | Buff_ADC_1[i] = 0; // ампл ацп. |
Kovalev_D | 86:398da56ef751 | 164 | Buff_ADC_2[i] = 0; |
Kovalev_D | 86:398da56ef751 | 165 | Buff_ADC_3[i] = 0; |
Kovalev_D | 86:398da56ef751 | 166 | Buff_ADC_4[i] = 0; |
Kovalev_D | 86:398da56ef751 | 167 | Buff_ADC_5[i] = 0; |
Kovalev_D | 86:398da56ef751 | 168 | } |
Kovalev_D | 86:398da56ef751 | 169 | //////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 170 | //////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 171 | |
Kovalev_D | 86:398da56ef751 | 172 | |
Kovalev_D | 87:7e575d26d6d0 | 173 | |
Kovalev_D | 87:7e575d26d6d0 | 174 | |
Kovalev_D | 87:7e575d26d6d0 | 175 | |
Kovalev_D | 86:398da56ef751 | 176 | |
Kovalev_D | 87:7e575d26d6d0 | 177 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 178 | /////////////////инициализация ног/////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 179 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 180 | Gyro.PinRegOld = 0xffffffff; |
Kovalev_D | 87:7e575d26d6d0 | 181 | Gyro.PinReg = 0; // всЁ выключенно |
Kovalev_D | 87:7e575d26d6d0 | 182 | PinCheng(); |
Kovalev_D | 87:7e575d26d6d0 | 183 | |
Kovalev_D | 87:7e575d26d6d0 | 184 | |
Kovalev_D | 87:7e575d26d6d0 | 185 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 186 | //////////////отладочный светодиод/////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 187 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 188 | LPC_PINCON->PINSEL0 = (0x00<<28); // а нужно, ведь по умолчаниб у них 0 функция. попробоввать без них потом убрать |
Kovalev_D | 87:7e575d26d6d0 | 189 | LPC_PINCON->PINMODE0 = (0x3<<28); |
Kovalev_D | 87:7e575d26d6d0 | 190 | LPC_GPIO1->FIODIR |= (1<<30); |
Kovalev_D | 87:7e575d26d6d0 | 191 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 192 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 193 | |
Kovalev_D | 87:7e575d26d6d0 | 194 | |
Kovalev_D | 87:7e575d26d6d0 | 195 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 196 | ////////////////управление уартом//////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 197 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 198 | LPC_GPIO2->FIODIR |= (1<<7); |
Kovalev_D | 87:7e575d26d6d0 | 199 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 200 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 201 | |
Kovalev_D | 87:7e575d26d6d0 | 202 | |
Kovalev_D | 87:7e575d26d6d0 | 203 | |
Kovalev_D | 87:7e575d26d6d0 | 204 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 205 | ////////////////?????????????????//////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 206 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 207 | LPC_PINCON->PINSEL0 &= ~(3<<8); //e. P0.4 is GPIO pin (запись ( 00 ) в 9:8 бит PISEL0 выбор P0.4 как GPIO) |
Kovalev_D | 87:7e575d26d6d0 | 208 | LPC_PINCON->PINMODE0 |= (3<<8); //e. P0.4 is GPIO pin (запись ( 11 ) в 9:8 бит PINMODE0 "для включения подтягивающего резистора") |
Kovalev_D | 87:7e575d26d6d0 | 209 | LPC_GPIO0->FIODIR |= (1<<4); //e. P0.4 is output (запись ( 1 ) в 5 бит FIODIR выбор P0.4 как выход) |
Kovalev_D | 87:7e575d26d6d0 | 210 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 211 | ///////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 212 | |
Kovalev_D | 87:7e575d26d6d0 | 213 | |
Kovalev_D | 87:7e575d26d6d0 | 214 | |
Kovalev_D | 87:7e575d26d6d0 | 215 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 216 | /////////////////////вибро 1///////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 217 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 218 | LPC_PINCON->PINSEL3 = (0x00<<18); //e. P1.25 is GPIO pin |
Kovalev_D | 87:7e575d26d6d0 | 219 | LPC_PINCON->PINMODE3 |= (3<<18); //e. P1.25 (включениe подтягивающего резистора") |
Kovalev_D | 87:7e575d26d6d0 | 220 | LPC_GPIO1->FIODIR |= (1<<25); //e. P0.5 is output (запись ( 1 ) в 5 бит FIODIR выбор P0.5 как выход) |
Kovalev_D | 87:7e575d26d6d0 | 221 | LPC_GPIO1->FIOCLR |= (1<<25); |
Kovalev_D | 87:7e575d26d6d0 | 222 | ////////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 223 | /////////////////////вибро 2///////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 224 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 225 | LPC_PINCON->PINSEL3 = (0x00<<24); //e. P1.28 is GPIO pin |
Kovalev_D | 87:7e575d26d6d0 | 226 | LPC_PINCON->PINMODE3 |= (3<<24); //e. P1.28 is GPIO pin (запись ( 11 ) в бит PINMODE0 "для включения подтягивающего резистора") |
Kovalev_D | 87:7e575d26d6d0 | 227 | LPC_GPIO1->FIODIR |= (1<<28); //e. P1.28 is output (запись ( 1 ) в 5 бит FIODIR выбор P0.5 как выход) |
Kovalev_D | 87:7e575d26d6d0 | 228 | LPC_GPIO1->FIOCLR |= (1<<28); |
Kovalev_D | 87:7e575d26d6d0 | 229 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 230 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 231 | |
Kovalev_D | 87:7e575d26d6d0 | 232 | |
Kovalev_D | 87:7e575d26d6d0 | 233 | |
Kovalev_D | 87:7e575d26d6d0 | 234 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 235 | /////////////инициализация подсветки///////////////// |
Kovalev_D | 87:7e575d26d6d0 | 236 | ///////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 237 | LPC_PINCON->PINSEL2 = (0x00<<24); //e. P2.12 is GPIO pin |
Kovalev_D | 87:7e575d26d6d0 | 238 | LPC_PINCON->PINMODE3 |= (3<<24); //e. P1.28 is GPIO pin (запись ( 11 ) в бит PINMODE0 "для включения подтягивающего резистора") |
Kovalev_D | 87:7e575d26d6d0 | 239 | LPC_GPIO2->FIODIR |= (1<<12); //e. P1.28 is output (запись ( 1 ) в 5 бит FIODIR выбор P0.5 как выход) |
Kovalev_D | 87:7e575d26d6d0 | 240 | LPC_GPIO2->FIOCLR |= (1<<12); |
Kovalev_D | 87:7e575d26d6d0 | 241 | /////////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 242 | /////////////////////////////////////////////////////// |
Kovalev_D | 87:7e575d26d6d0 | 243 | |
Kovalev_D | 87:7e575d26d6d0 | 244 | |
Kovalev_D | 87:7e575d26d6d0 | 245 | |
Kovalev_D | 87:7e575d26d6d0 | 246 | |
Kovalev_D | 87:7e575d26d6d0 | 247 | |
Kovalev_D | 87:7e575d26d6d0 | 248 | /////////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 249 | /////////////////////////////////////////////////////// |
Kovalev_D | 86:398da56ef751 | 250 | init_timer(TIME_INTERVAL ); //Timer 1: CCLK / 7812 = 12800.819Hz; Vibro: Timer1/32 = 400.025Hz; 10ms??? |
Kovalev_D | 86:398da56ef751 | 251 | enable_timer1(); |
Kovalev_D | 86:398da56ef751 | 252 | Init_TIM2(); //Timer 2: CCLK / 4 / 250 = 100kHz |
Kovalev_D | 86:398da56ef751 | 253 | enable_timer2(); |
Kovalev_D | 87:7e575d26d6d0 | 254 | |
Kovalev_D | 87:7e575d26d6d0 | 255 | LPC_GPIO0->FIOCLR = (1<<5);/////////////?????????????????????????? |
Kovalev_D | 86:398da56ef751 | 256 | } |
igor_v | 13:e2a1d18677b8 | 257 | |
igor_v | 30:17c84ed091b3 | 258 | void ButtonLightUP(void) // включение аоджига и подсветки |
igor_v | 0:8ad47e2b6f00 | 259 | { |
igor_v | 52:30f2e52a493f | 260 | |
igor_v | 0:8ad47e2b6f00 | 261 | if ((secPuls>100)&&(pulse_Rq==1)) |
igor_v | 0:8ad47e2b6f00 | 262 | { |
igor_v | 0:8ad47e2b6f00 | 263 | pulse_Rq=0; |
igor_v | 30:17c84ed091b3 | 264 | // LightUpCount=3000; |
igor_v | 30:17c84ed091b3 | 265 | // BackLightCount=5000; |
igor_v | 30:17c84ed091b3 | 266 | |
igor_v | 0:8ad47e2b6f00 | 267 | } |
igor_v | 0:8ad47e2b6f00 | 268 | } |
igor_v | 0:8ad47e2b6f00 | 269 | |
igor_v | 0:8ad47e2b6f00 | 270 | |
igor_v | 0:8ad47e2b6f00 | 271 | |
igor_v | 0:8ad47e2b6f00 | 272 | |
igor_v | 0:8ad47e2b6f00 | 273 |