Dmitry Kovalev / Mbed 2 deprecated LG2

Dependencies:   mbed

Fork of LG by igor Apu

Revision:
61:1b76fe74a0d9
Parent:
60:98eb64c0fda3
Child:
62:2d2dcf999fb5
--- a/DeviceProtocol.h	Sun Feb 14 18:56:29 2016 +0000
+++ b/DeviceProtocol.h	Tue Feb 16 03:00:30 2016 +0000
@@ -30,42 +30,46 @@
     DeviceMessageCheckPoint *CheckPointList;
 } DeviceMessageCheck;
 */
-typedef enum {
-  cmd_Delta_PS,
-  cmd_Delta_BINS,
-  cmd_Delta_SF,
-  cmd_DeviceMode,
-  cmd_BIT_Mode,
-  cmd_Rate,
-  cmd_Delta,
-  cmd_D_Period_W,
-  cmd_Maint
-} DeviceCommands;
-typedef enum {
-  cmd_M_Stimul,  //e. the code of the Stimul command //r. код команды Stimul    
-  cmd_M_Reset,   //e. software device reset(restart) //r. программный сброс (рестарт) прибора
-  cmd_M_Clear,   //e. reset of the register of errors of line 485 //r. очистка регистра ошибок линии 485  
-  cmd_M_Mirror,  //e. return previous contents of the receiver buffer //r. возврат предыдущего содержимого буфера приемника  
-  cmd_M_LdPar_F, //e. load GLD parameters from Flash-memory //r. загрузить параметры ГЛД из флэш-памяти
-  cmd_M_LdPar_D, //e. set GLD parameters by procedure of initialization //r. установить параметры ГЛД процедурой инициализации 
-  cmd_M_Start,   //e. switch on the GLD //r. включить ГЛД          
-  cmd_M_Stop,    //e. switch off the GLD //r. выключить ГЛД
-  cmd_M_Pulse,   //e. generation of the light-up pulse //r. генерация импульса поджига
-  cmd_M_Ctl_R,   //e. reading the control register of the device //r. чтение регистра управления устройства  
-  cmd_M_Ctl_M,   //e. modification of bit of the control register //r. модификация бита регистра управления 
-  cmd_M_Rate,    //e. delivery of a stack of parameters M_Rate (Rate2, Rate3) //r. выдача набора параметров M_Rate  (Rate2, Rate3)
-  cmd_M_Tmp_W,   //e. writing to the AD7714 circuit (temperature sensors) //r. запись в схемы AD7714 (измерители температуры) 
-  cmd_M_Tmp_R,   //e. reading from the AD7714 circuit (temperature sensors) //r. чтение из схем AD7714 (измерители температуры) 
-  cmd_M_E5R_W,   //e. writing to the register of a mode of the Elio5 card //r. запись в регистр режима платы Elio5  
-  cmd_M_ADC_R,   //e. reading data from the ADC of the Elio5 card //r. чтение данных из АЦП платы Elio5
-  cmd_M_Vib_W,   //e. loading of the oscillation period of the dither drive //r. загрузка периода колебаний вибропривода  
-  cmd_M_Cnt_R,   //e. reading data from the counters of the Elio5 card //r. чтение данных из счетчиков платы Elio5
-  cmd_M_Gph_W,   //e. loading gain factors of photodetector channels //r. загрузка коэффициентов усиления каналов фотоприемника  
-  cmd_M_Flg_R,   //e. reading data from the register of input flags  //r. чтение данных из регистра входных флагов
-  cmd_M_Param_W, //e. writing working parameter to the data memory //r. запись рабочего параметра в память данных          
-  cmd_M_Param_R, //e. reading working parameter of the GLD from the data memory //r. чтение рабочего параметра GLD из памяти данных 
-  cmd_M_E5RA_W,  //e. writing in 1st additional (A) register of a mode of the Elio5 card //r. запись в 1-ый дополнительный (А) регистр режима платы Elio5  
-} DeviceSubCommands;
+
+#define  DELTA_PS        0xa0      //e. the code of the B_DeltaPS command //r. код команды B_DeltaPS
+#define  DELTA_BINS      0xb0      //e. the code of the B_DeltaBINS command //r. код команды B_DeltaBINS
+#define  DELTA_SF        0xb2      //e. the code of the B_DeltaSF command //r. код команды B_DeltaSF
+#define  DEV_MODE        0xa5      //e. the code of the Device_Mode command //r. код команды Device_Mode
+#define  BIT_MODE        0xa7      //e. the code of the B.I.T. command //r. код команды B.I.T.(встороенного тестирования)
+#define  RATE            0x00      //e. the code of the Rate command //r. код команды Rate  
+#define  DELTA           0x0f      //e. the code of the Delta command //r. код команды Delta
+#define  D_PERIOD_W      0xf0      //e. the code of the D_Period_W command //r. код команды D_Period_W
+
+#define  MAINTENANCE     0x99      //e. the code of the Maintenance mode command //r. код команды Maintenance mode
+#define  M0_MAINTENANCE  0x99      //Maintenance command set version: initial version
+//Basic maintenance commands group
+#define  M0_BASIC        0xda      //Basic maintenance commands group code
+#define  M0_CLEAR        0x00      //group command select: e. reset of the register of errors of line 485 //r. очистка регистра ошибок линии 485
+#define  M0_MIRROR       0x01      //group command select: e. return previous contents of the receiver buffer //r. возврат предыдущего содержимого буфера приемника  
+#define  M0_LDPAR_F      0x02      //group command select: e. load GLD parameters from Flash-memory //r. загрузить параметры ГЛД из флэш-памяти
+#define  M0_LDPAR_D      0x03      //group command select: e. set GLD parameters by procedure of initialization //r. установить параметры ГЛД процедурой инициализации 
+#define  M0_START        0x04      //group command select: e. switch on the GLD //r. включить ГЛД          
+#define  M0_STOP         0x40      //group command select: e. switch off the GLD //r. выключить ГЛД
+#define  M0_PULSE        0x0a      //group command select: e. generation of the light-up pulse //r. генерация импульса поджига
+//Other maintenance commands
+#define  M0_STIMUL       0x0a      //e. the code of the Stimul command //r. код команды Stimul    
+#define  M0_RESET        0x80      //e. software device reset(restart) //r. программный сброс (рестарт) прибора
+
+#define  M0_CTL_R        0xd9      //e. reading the control register of the device //r. чтение регистра управления устройства  
+#define  M0_CTL_M        0xd8      //e. modification of bit of the control register //r. модификация бита регистра управления 
+#define  M0_RATE         0xdd      //e. delivery of a stack of parameters M_Rate (Rate2, Rate3) //r. выдача набора параметров M_Rate  (Rate2, Rate3)
+
+#define  M0_TMP_W        0xe0      //e. writing to the AD7714 circuit (temperature sensors) //r. запись в схемы AD7714 (измерители температуры) 
+#define  M0_TMP_R        0xe1      //e. reading from the AD7714 circuit (temperature sensors) //r. чтение из схем AD7714 (измерители температуры) 
+#define  M0_E5R_W        0xe2      //e. writing to the register of a mode of the Elio5 card //r. запись в регистр режима платы Elio5  
+#define  M0_ADC_R        0xe3      //e. reading data from the ADC of the Elio5 card //r. чтение данных из АЦП платы Elio5
+#define  M0_VIB_W        0xe4      //e. loading of the oscillation period of the dither drive //r. загрузка периода колебаний вибропривода  
+#define  M0_CNT_R        0xe5      //e. reading data from the counters of the Elio5 card //r. чтение данных из счетчиков платы Elio5
+#define  M0_GPH_W        0xe6      //e. loading gain factors of photodetector channels //r. загрузка коэффициентов усиления каналов фотоприемника  
+#define  M0_FLG_R        0xe7      //e. reading data from the register of input flags  //r. чтение данных из регистра входных флагов
+#define  M0_PARAM_W      0xe8      //e. writing working parameter to the data memory //r. запись рабочего параметра в память данных          
+#define  M0_PARAM_R      0xe9      //e. reading working parameter of the GLD from the data memory //r. чтение рабочего параметра GLD из памяти данных 
+#define  M0_E5RA_W       0xea      //e. writing in 1st additional (A) register of a mode of the Elio5 card //r. запись в 1-ый дополнительный (А) регистр режима платы Elio5
 
 //Command: DeviceMode
 //DeviceMessageCheckPoint DeviceModeRequestCheck[] = {{0x00,0xff,0xcc},{0x02,0xff,0xcc},{0x03,0xf0,0x00}};