Dmitry Kovalev
/
LGstaandart
forkd
Fork of LG2 by
Diff: commandset.h
- Revision:
- 21:bc8c1cec3da6
- Parent:
- 0:8ad47e2b6f00
- Child:
- 112:4a96133a1311
diff -r 18e3fd7b92d0 -r bc8c1cec3da6 commandset.h --- a/commandset.h Tue Feb 02 17:14:25 2016 +0000 +++ b/commandset.h Wed Feb 03 07:19:30 2016 +0000 @@ -1,54 +1,54 @@ -//e. procedures, which are used in el_gld.asm //r. ïðîöåäóðû, èñïîëüçóåìûå â el_gld.asm +//e. procedures, which are used in el_gld.asm //r. пÑоÑедÑÑÑ, иÑполÑзÑемÑе в el_gld.asm #ifndef COMMANDSET #define COMMANDSET #include "stdint.h" - - //e. ===== command codes, received from a line ========== //r. ===== êîäû êîìàíä, ïðèíèìàåìûõ ñ ëèíèè ========== -#define COMMAND_PREFIX 0xCC //e. attribute of command //r. ïðèçíàê êîìàíäû -#define BROADCAST_ADDRESS 0x1f //e. the broadcasting address ( shared for 3 GLD ) //r. øèðîêîâåùàòåëüíûé àäðåñ (îáùèé äëÿ 3-õ ÃËÄ) + +//e. ===== command codes, received from a line ========== //r. ===== ÐºÐ¾Ð´Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´, пÑинимаемÑÑ Ñ Ð»Ð¸Ð½Ð¸Ð¸ ========== +#define COMMAND_PREFIX 0xCC //e. attribute of command //r. пÑизнак ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ +#define BROADCAST_ADDRESS 0x1f //e. the broadcasting address ( shared for 3 GLD ) //r. ÑиÑоковеÑаÑелÑнÑй адÑÐµÑ (обÑий Ð´Ð»Ñ 3-Ñ ÐÐÐ) -#define CMD_DELTA_PS 0xa000 //e. the code of the B_DeltaPS command //r. êîä êîìàíäû B_DeltaPS -#define CMD_DELTA_BINS 0xb000 //e. the code of the B_DeltaBINS command //r. êîä êîìàíäû B_DeltaBINS -#define CMD_DELTA_SF 0xb200 //e. the code of the B_DeltaSF command //r. êîä êîìàíäû B_DeltaSF -#define CMD_DEV_MODE 0xA500 //e. the code of the Device_Mode command //r. êîä êîìàíäû Device_Mode -#define CMD_BIT_MODE 0xA700 //e. the code of the B.I.T. command //r. êîä êîìàíäû B.I.T.(âñòîðîåííîãî òåñòèðîâàíèÿ) -#define CMD_RATE 0x0000 //e. the code of the Rate command //r. êîä êîìàíäû Rate -#define CMD_DELTA 0x0f00 //e. the code of the Delta command //r. êîä êîìàíäû Delta -#define CMD_D_PERIOD_W 0xf000 //e. the code of the D_Period_W command //r. êîä êîìàíäû D_Period_W - -#define CMD_MAINT 0x9999 //e. the code of the Maintenance mode command //r. êîä êîìàíäû Maintenance mode +#define CMD_DELTA_PS 0xa000 //e. the code of the B_DeltaPS command //r. код ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ B_DeltaPS +#define CMD_DELTA_BINS 0xb000 //e. the code of the B_DeltaBINS command //r. код ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ B_DeltaBINS +#define CMD_DELTA_SF 0xb200 //e. the code of the B_DeltaSF command //r. код ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ B_DeltaSF +#define CMD_DEV_MODE 0xA500 //e. the code of the Device_Mode command //r. код ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ Device_Mode +#define CMD_BIT_MODE 0xA700 //e. the code of the B.I.T. command //r. код ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ B.I.T.(вÑÑоÑоенного ÑеÑÑиÑованиÑ) +#define CMD_RATE 0x0000 //e. the code of the Rate command //r. код ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ Rate +#define CMD_DELTA 0x0f00 //e. the code of the Delta command //r. код ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ Delta +#define CMD_D_PERIOD_W 0xf000 //e. the code of the D_Period_W command //r. код ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ D_Period_W + +#define CMD_MAINT 0x9999 //e. the code of the Maintenance mode command //r. код ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ Maintenance mode -#define SUBCMD_M_STIMUL 0x0a00 //e. the code of the Stimul command //r. êîä êîìàíäû Stimul -#define SUBCMD_M_RESET 0x8000 //e. software device reset(restart) //r. ïðîãðàììíûé ñáðîñ (ðåñòàðò) ïðèáîðà -#define SUBCMD_M_CLEAR 0xda00 //e. reset of the register of errors of line 485 //r. î÷èñòêà ðåãèñòðà îøèáîê ëèíèè 485 -#define SUBCMD_M_MIRR 0xda01 //e. return previous contents of the receiver buffer //r. âîçâðàò ïðåäûäóùåãî ñîäåðæèìîãî áóôåðà ïðèåìíèêà -#define SUBCMD_M_LDPAR_F 0xda02 //e. load GLD parameters from Flash-memory //r. çàãðóçèòü ïàðàìåòðû ÃËÄ èç ôëýø-ïàìÿòè -#define SUBCMD_M_LDPAR_D 0xda03 //e. set GLD parameters by procedure of initialization //r. óñòàíîâèòü ïàðàìåòðû ÃËÄ ïðîöåäóðîé èíèöèàëèçàöèè -#define SUBCMD_M_START 0xda04 //e. switch on the GLD //r. âêëþ÷èòü ÃËÄ -#define SUBCMD_M_STOP 0xda40 //e. switch off the GLD //r. âûêëþ÷èòü ÃËÄ -#define SUBCMD_M_PULSE 0xda0a //e. generation of the light-up pulse //r. ãåíåðàöèÿ èìïóëüñà ïîäæèãà - -#define SUBCMD_M_CTL_R 0xd900 //e. reading the control register of the device //r. ÷òåíèå ðåãèñòðà óïðàâëåíèÿ óñòðîéñòâà -#define SUBCMD_M_CTL_M 0xd800 //e. modification of bit of the control register //r. ìîäèôèêàöèÿ áèòà ðåãèñòðà óïðàâëåíèÿ -#define SUBCMD_M_RATE 0xdd00 //e. delivery of a stack of parameters M_Rate (Rate2, Rate3) //r. âûäà÷à íàáîðà ïàðàìåòðîâ M_Rate (Rate2, Rate3) +#define SUBCMD_M_STIMUL 0x0a00 //e. the code of the Stimul command //r. код ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ Stimul +#define SUBCMD_M_RESET 0x8000 //e. software device reset(restart) //r. пÑогÑаммнÑй ÑбÑÐ¾Ñ (ÑеÑÑаÑÑ) пÑибоÑа +#define SUBCMD_M_CLEAR 0xda00 //e. reset of the register of errors of line 485 //r. оÑиÑÑка ÑегиÑÑÑа оÑибок линии 485 +#define SUBCMD_M_MIRR 0xda01 //e. return previous contents of the receiver buffer //r. возвÑÐ°Ñ Ð¿ÑедÑдÑÑего ÑодеÑжимого бÑÑеÑа пÑиемника +#define SUBCMD_M_LDPAR_F 0xda02 //e. load GLD parameters from Flash-memory //r. загÑÑзиÑÑ Ð¿Ð°ÑамеÑÑÑ ÐÐРиз ÑлÑÑ-памÑÑи +#define SUBCMD_M_LDPAR_D 0xda03 //e. set GLD parameters by procedure of initialization //r. ÑÑÑановиÑÑ Ð¿Ð°ÑамеÑÑÑ ÐÐРпÑоÑедÑÑой иниÑиализаÑии +#define SUBCMD_M_START 0xda04 //e. switch on the GLD //r. вклÑÑиÑÑ ÐÐÐ +#define SUBCMD_M_STOP 0xda40 //e. switch off the GLD //r. вÑклÑÑиÑÑ ÐÐÐ +#define SUBCMD_M_PULSE 0xda0a //e. generation of the light-up pulse //r. генеÑаÑÐ¸Ñ Ð¸Ð¼Ð¿ÑлÑÑа поджига + +#define SUBCMD_M_CTL_R 0xd900 //e. reading the control register of the device //r. ÑÑение ÑегиÑÑÑа ÑпÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ ÑÑÑÑойÑÑва +#define SUBCMD_M_CTL_M 0xd800 //e. modification of bit of the control register //r. модиÑикаÑÐ¸Ñ Ð±Ð¸Ñа ÑегиÑÑÑа ÑпÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ +#define SUBCMD_M_RATE 0xdd00 //e. delivery of a stack of parameters M_Rate (Rate2, Rate3) //r. вÑдаÑа набоÑа паÑамеÑÑов M_Rate (Rate2, Rate3) -#define SUBCMD_M_TMP_W 0xe000 //e. writing to the AD7714 circuit (temperature sensors) //r. çàïèñü â ñõåìû AD7714 (èçìåðèòåëè òåìïåðàòóðû) -#define SUBCMD_M_TMP_R 0xe100 //e. reading from the AD7714 circuit (temperature sensors) //r. ÷òåíèå èç ñõåì AD7714 (èçìåðèòåëè òåìïåðàòóðû) -#define SUBCMD_M_E5R_W 0xe200 //e. writing to the register of a mode of the Elio5 card //r. çàïèñü â ðåãèñòð ðåæèìà ïëàòû Elio5 -#define SUBCMD_M_ADC_R 0xe300 //e. reading data from the ADC of the Elio5 card //r. ÷òåíèå äàííûõ èç ÀÖÏ ïëàòû Elio5 -#define SUBCMD_M_VIB_W 0xe400 //e. loading of the oscillation period of the dither drive //r. çàãðóçêà ïåðèîäà êîëåáàíèé âèáðîïðèâîäà -#define SUBCMD_M_CNT_R 0xe500 //e. reading data from the counters of the Elio5 card //r. ÷òåíèå äàííûõ èç ñ÷åò÷èêîâ ïëàòû Elio5 -#define SUBCMD_M_GPH_W 0xe600 //e. loading gain factors of photodetector channels //r. çàãðóçêà êîýôôèöèåíòîâ óñèëåíèÿ êàíàëîâ ôîòîïðèåìíèêà -#define SUBCMD_M_FLG_R 0xe700 //e. reading data from the register of input flags //r. ÷òåíèå äàííûõ èç ðåãèñòðà âõîäíûõ ôëàãîâ -#define SUBCMD_M_PARAM_W 0xe800 //e. writing working parameter to the data memory //r. çàïèñü ðàáî÷åãî ïàðàìåòðà â ïàìÿòü äàííûõ -#define SUBCMD_M_PARAM_R 0xe900 //e. reading working parameter of the GLD from the data memory //r. ÷òåíèå ðàáî÷åãî ïàðàìåòðà GLD èç ïàìÿòè äàííûõ -#define SUBCMD_M_E5RA_W 0xea00 //e. writing in 1st additional (A) register of a mode of the Elio5 card //r. çàïèñü â 1-ûé äîïîëíèòåëüíûé (À) ðåãèñòð ðåæèìà ïëàòû Elio5 +#define SUBCMD_M_TMP_W 0xe000 //e. writing to the AD7714 circuit (temperature sensors) //r. запиÑÑ Ð² ÑÑ ÐµÐ¼Ñ AD7714 (измеÑиÑели ÑемпеÑаÑÑÑÑ) +#define SUBCMD_M_TMP_R 0xe100 //e. reading from the AD7714 circuit (temperature sensors) //r. ÑÑение из ÑÑ ÐµÐ¼ AD7714 (измеÑиÑели ÑемпеÑаÑÑÑÑ) +#define SUBCMD_M_E5R_W 0xe200 //e. writing to the register of a mode of the Elio5 card //r. запиÑÑ Ð² ÑегиÑÑÑ Ñежима плаÑÑ Elio5 +#define SUBCMD_M_ADC_R 0xe300 //e. reading data from the ADC of the Elio5 card //r. ÑÑение даннÑÑ Ð¸Ð· ÐЦРплаÑÑ Elio5 +#define SUBCMD_M_VIB_W 0xe400 //e. loading of the oscillation period of the dither drive //r. загÑÑзка пеÑиода колебаний вибÑопÑивода +#define SUBCMD_M_CNT_R 0xe500 //e. reading data from the counters of the Elio5 card //r. ÑÑение даннÑÑ Ð¸Ð· ÑÑеÑÑиков плаÑÑ Elio5 +#define SUBCMD_M_GPH_W 0xe600 //e. loading gain factors of photodetector channels //r. загÑÑзка коÑÑÑиÑиенÑов ÑÑÐ¸Ð»ÐµÐ½Ð¸Ñ ÐºÐ°Ð½Ð°Ð»Ð¾Ð² ÑоÑопÑиемника +#define SUBCMD_M_FLG_R 0xe700 //e. reading data from the register of input flags //r. ÑÑение даннÑÑ Ð¸Ð· ÑегиÑÑÑа Ð²Ñ Ð¾Ð´Ð½ÑÑ Ñлагов +#define SUBCMD_M_PARAM_W 0xe800 //e. writing working parameter to the data memory //r. запиÑÑ ÑабоÑего паÑамеÑÑа в памÑÑÑ Ð´Ð°Ð½Ð½ÑÑ +#define SUBCMD_M_PARAM_R 0xe900 //e. reading working parameter of the GLD from the data memory //r. ÑÑение ÑабоÑего паÑамеÑÑа GLD из памÑÑи даннÑÑ +#define SUBCMD_M_E5RA_W 0xea00 //e. writing in 1st additional (A) register of a mode of the Elio5 card //r. запиÑÑ Ð² 1-Ñй дополниÑелÑнÑй (Ð) ÑегиÑÑÑ Ñежима плаÑÑ Elio5 - //e. system global variables //r. ñèñòåìíûå ãëîáàëüíûå ïåðåìåííûå - -extern uint32_t blt_in_test; //e. self-test register //r. ðåãèñòð ñàìîòåñòèðîâàíèÿ +//e. system global variables //r. ÑиÑÑемнÑе глобалÑнÑе пеÑеменнÑе + +extern uint32_t blt_in_test; //e. self-test register //r. ÑегиÑÑÑ ÑамоÑеÑÑиÑÐ¾Ð²Ð°Ð½Ð¸Ñ extern uint32_t BIT_number; extern uint32_t Is_BIT;