Dmitry Kovalev
/
LG
n
Fork of LG by
CntrlGLD.h@1:f2adcae3d304, 2016-01-30 (annotated)
- Committer:
- igor_v
- Date:
- Sat Jan 30 13:53:19 2016 +0000
- Revision:
- 1:f2adcae3d304
- Parent:
- 0:8ad47e2b6f00
- Child:
- 21:bc8c1cec3da6
123
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 1:f2adcae3d304 | 1 | #ifndef CntrlGLD_H |
igor_v | 1:f2adcae3d304 | 2 | #define CntrlGLD_H |
igor_v | 0:8ad47e2b6f00 | 3 | |
igor_v | 0:8ad47e2b6f00 | 4 | |
igor_v | 1:f2adcae3d304 | 5 | //e. constants for the piecewise-linear thermocompensation //r. ��������� ��� �������-�������� ���������������� |
igor_v | 1:f2adcae3d304 | 6 | #define TERMO_FUNC_SIZE 14 //e. amount of the points of the table function of thermocompensation //r. ���������� ����� ��������� ������� ���������������� |
igor_v | 1:f2adcae3d304 | 7 | #define MAX_ORDER 9 //e. maximal value of order for the thermocompensation coefficients //r. ������������ �������� ������� ��� ������������� ���������������� |
igor_v | 1:f2adcae3d304 | 8 | #define TSENS_NUMB 4 //e. number of the temperature sensor used for the thermocompensation //r. ����� ������������, ������������� ��� ����������� |
igor_v | 0:8ad47e2b6f00 | 9 | |
igor_v | 1:f2adcae3d304 | 10 | typedef enum _TERMO_MODE //e. thermocompensation modes //r. ������ ������ ���������������� |
igor_v | 0:8ad47e2b6f00 | 11 | { |
igor_v | 1:f2adcae3d304 | 12 | TERMO_OFF, //e. thermocompensation is switched off //r. ���������������� ��������� |
igor_v | 1:f2adcae3d304 | 13 | TERMO_ON, //e. thermocompensation is switched on //r. ���������������� �������� |
igor_v | 1:f2adcae3d304 | 14 | TERMO_ON_NUMB_OFF, //e. thermocompensation is switched on, number resets (debug mode) //r. ���������������� ��������, ����� ���������� (���������� �����) |
igor_v | 1:f2adcae3d304 | 15 | TERMO_ON_STATIC_ONLY, //e. only static thermocompensation is switched on //r. �������� ������ ����������� ���������������� |
igor_v | 1:f2adcae3d304 | 16 | TERMO_ON_DYNAMIC_ONLY, //e. only dynamic thermocompensation is switched on //r. �������� ������ ������������ ���������������� |
igor_v | 1:f2adcae3d304 | 17 | TERMO_ON_STATIC_ONLY_NUMB_OFF, //e. static thermocompensation is switched on, number resets (debug mode) //r. ����������� ������������������������, ����� ���������� (���������� �����) |
igor_v | 1:f2adcae3d304 | 18 | TERMO_ON_DYNAMIC_ONLY_NUMB_OFF //e. dynamic thermocompensation is switched on, number resets (debug mode) //r. ������������ ������������������������, ����� ���������� (���������� �����) |
igor_v | 0:8ad47e2b6f00 | 19 | } TERMO_MODE; |
igor_v | 0:8ad47e2b6f00 | 20 | |
igor_v | 1:f2adcae3d304 | 21 | typedef enum _WATCH_MODE //e. variants of control points for scope //r. �������� ����������� ����� ��� ������������ |
igor_v | 0:8ad47e2b6f00 | 22 | { |
igor_v | 1:f2adcae3d304 | 23 | VB_DELAY_MEANDER, //e. the delayed on the VB_phs meander //r. ����������� ������ �� �������� VB_phs |
igor_v | 1:f2adcae3d304 | 24 | VB_PHASE_DETECTOR, //e. output of the PD of the dither drive //r. ����� �������� ��������� ������������ |
igor_v | 1:f2adcae3d304 | 25 | VB_PHASE_DETECTOR_1_SEC, //e. output of integral of the PD of the dither drive for 1 Sec //r. ����� ��������� �� ������������ �� 1 ��� |
igor_v | 1:f2adcae3d304 | 26 | VB_INTEGRATOR_40T, //e. output of integral of the PD of the dither drive for 40 periods //r. ����� ��������� �� ������������ �� 40 �������� |
igor_v | 1:f2adcae3d304 | 27 | WP_PHASE_DETECTOR //e. output of the PD of the CPLC regulator //r. ����� �������� ��������� ������� ��� |
igor_v | 0:8ad47e2b6f00 | 28 | } WATCH_MODE; |
igor_v | 0:8ad47e2b6f00 | 29 | |
igor_v | 1:f2adcae3d304 | 30 | //e. ===== device operation modes ================================================================ //r. ===== ������ ������ ������� ================================================================ |
igor_v | 1:f2adcae3d304 | 31 | #define DM_INT_10KHZ_LATCH 1 //e. mode of internal latch 10 kHz //r. ����� ���������� ������� 10 ��� |
igor_v | 0:8ad47e2b6f00 | 32 | #define DM_INT_LATCH_DELTA_PS 2 |
igor_v | 0:8ad47e2b6f00 | 33 | #define DM_INT_LATCH_DELTA_BINS 3 |
igor_v | 1:f2adcae3d304 | 34 | #define DM_EXT_LATCH_DELTA_PS_PULSE 4 //e. mode of external latch with output of the Delta_PS command by pulse //r. ����� ������� ������� � ������� ������� Delta_PS �� �������� |
igor_v | 1:f2adcae3d304 | 35 | #define DM_EXT_LATCH_DELTA_BINS_PULSE 6 //e. mode of external latch with output of the Delta_BINS command by pulse//r. ����� ������� ������� � ������� ������� Delta_BINS �� �������� |
igor_v | 1:f2adcae3d304 | 36 | #define DM_EXT_LATCH_DELTA_SF_PULSE 7 //e. mode of Delta Scale factor //r. ����� Delta_SF command |
igor_v | 0:8ad47e2b6f00 | 37 | |
igor_v | 1:f2adcae3d304 | 38 | //e. *** the BLOCK of VARIABLES, LOADED from FLASH-memory ********************** //r. *** ���� ����������, ����������� �� FLASH-������ ********************** |
igor_v | 1:f2adcae3d304 | 39 | //e. Address (parameter number in the block = 0..255 ) //r. ����� (����� ��������� � ����� = 0..255) |
igor_v | 0:8ad47e2b6f00 | 40 | typedef union |
igor_v | 0:8ad47e2b6f00 | 41 | { |
igor_v | 0:8ad47e2b6f00 | 42 | int Array[171]; |
igor_v | 0:8ad47e2b6f00 | 43 | struct |
igor_v | 0:8ad47e2b6f00 | 44 | { // Device_blk |
igor_v | 1:f2adcae3d304 | 45 | int My_Addres; //e. 0 - device own address //r.0 - ����������� ����� ���������� |
igor_v | 0:8ad47e2b6f00 | 46 | |
igor_v | 1:f2adcae3d304 | 47 | //e. =============== parameters of HFO regulator =============== //r. =============== ��������� ������� �� ���������� ������� =============== |
igor_v | 1:f2adcae3d304 | 48 | int HF_ref; //e. 1 - value of the reference //r. 1 - �������� ����� |
igor_v | 1:f2adcae3d304 | 49 | int HF_scl; //e. 2 - the gain factor (1.15) //r. 2 - ����������� �������� (1.15) |
igor_v | 1:f2adcae3d304 | 50 | int HF_min; //r. 3 - ������� ��������� �������� �� ���� ���������� (������������� ������. ���������� �� ���) |
igor_v | 1:f2adcae3d304 | 51 | int HF_max; //e. 4 - maximum of the output value on the regulator DAC (appropriate to minimal voltage on the HFO) //r. 4 - �������� ��������� �������� �� ���� ���������� (������������� �����. ���������� �� ���) |
igor_v | 0:8ad47e2b6f00 | 52 | |
igor_v | 1:f2adcae3d304 | 53 | //e. =============== parameters of the regulator of the DS power regulator ========== //r. =============== ��������� ������� ������������� �������� ��� ========== |
igor_v | 1:f2adcae3d304 | 54 | int RI_ref; //e. 5 - value of the reference //r. 5 - �������� ����� |
igor_v | 1:f2adcae3d304 | 55 | int RI_scl; //e. 6 - the gain factor (1.15) //r. 6 - ����������� �������� (1.15) |
igor_v | 0:8ad47e2b6f00 | 56 | |
igor_v | 1:f2adcae3d304 | 57 | //e. =============== parameters of the CPLC regulator ===== //r. =============== ��������� ������� ������������ �������� ��������� (���) ===== |
igor_v | 1:f2adcae3d304 | 58 | int WP_ref; //e. 7 - value of the reference //r. 7 - �������� ����� |
igor_v | 1:f2adcae3d304 | 59 | int WP_scl; //e. 8 - the gain factor (1.15) //r. 8 - ����������� �������� (1.15) |
igor_v | 1:f2adcae3d304 | 60 | int WP_mdy; //e. 9 - value of the reset delay //r. 9 - �������� �������� ������ |
igor_v | 1:f2adcae3d304 | 61 | int WP_rup; //e. 10 - upper value of DAC adjustment (appropriate to minimal voltage on the heater) //r. 10 - ������� �������� ����������� ��� (������������� �����. ���������� �� �����������) |
igor_v | 1:f2adcae3d304 | 62 | int WP_rdw; //e. 11 - lower value of the DAC adjustment (appropriate to maximal voltage on the heater) //r. 11 - ������� �������� ����������� ��� (������������� ������. ���������� �� �����������) |
igor_v | 0:8ad47e2b6f00 | 63 | |
igor_v | 1:f2adcae3d304 | 64 | //e. =============== parameters of the dither drive regulator of the GLD ==================== //r. =============== ��������� ������� ������������ ��� ==================== |
igor_v | 1:f2adcae3d304 | 65 | int VB_phs; //e. 12 - the phase delay parameter of the dither drive PLL //r. 12 - �������� Phase_���. ��� ������������ |
igor_v | 1:f2adcae3d304 | 66 | int VB_scl; //e. 13 - the gain factor (1.15) of the dither drive PLL //r. 13 - ����������� �������� (1.15) ��� ������������ |
igor_v | 1:f2adcae3d304 | 67 | unsigned int VB_N; //e. 14 - divider for dither drive period (defines dither period) //r. 14 - �����.������� N ������������ (������ ���������) �� |
igor_v | 1:f2adcae3d304 | 68 | unsigned int VB_Nmin; //e. 15 - minimum of the output value of the oscillation period regulator //r. 15 - ������� ��������� �������� ���������� ������� |
igor_v | 1:f2adcae3d304 | 69 | unsigned int VB_Nmax; //e. 16 - maximum of the output value of the oscillation period regulator //r. 16 - �������� ��������� �������� ���������� ������� |
igor_v | 0:8ad47e2b6f00 | 70 | |
igor_v | 1:f2adcae3d304 | 71 | int VB_Fdf_Hi; //e. 17 - adjusted output frequency (H) //r. 17 - �������� ������� ����������� (H) |
igor_v | 1:f2adcae3d304 | 72 | unsigned int VB_Fdf_Lo; //e. 18 - (L) (double precision) //r. 18 - (L) (������� ��������) |
igor_v | 0:8ad47e2b6f00 | 73 | |
igor_v | 1:f2adcae3d304 | 74 | int VB_Fsc; //e. 19 - the gain factor of the frequency regulator //r. 19 - ����������� �������� ���������� ������� ����������� |
igor_v | 1:f2adcae3d304 | 75 | unsigned int VB_Tmin; //e. 20 - the gain factor of the frequency regulator //r. 19 - ����������� �������� ���������� ������� ����������� |
igor_v | 1:f2adcae3d304 | 76 | unsigned int VB_Tmax; //e. 21 - maximum of the output value of the regulator //r. 21 - �������� ��������� �������� ���������� Tau |
igor_v | 1:f2adcae3d304 | 77 | unsigned int VB_tau; //e. 22 - pulse width of the dither drive (without noise)//r. 22 - ������������ �������� ������������ (�� ���������) |
igor_v | 1:f2adcae3d304 | 78 | int VBN_Tzd; //e. 23 - adjusted noise period //r. 23 - �������� ������ ��������� |
igor_v | 1:f2adcae3d304 | 79 | int VBN_Ran; //e. 24 - range of the random component of noise //r. 24 - �������� ��������� ������������ ��������� VBN_Tsl |
igor_v | 1:f2adcae3d304 | 80 | int VBN_k; //e. 25 - adjusted noise constant //r. 25 - �������� ��������� ��������� |
igor_v | 0:8ad47e2b6f00 | 81 | |
igor_v | 1:f2adcae3d304 | 82 | //e. =============== parameters of processing of accurate data ============= //r. =============== ��������� ��������� ���������� ���������� ============= |
igor_v | 1:f2adcae3d304 | 83 | int PI_Fsc; //_ //e. 26 - the S_ds scale parameter //r. 26 - ���������� ����������� S��� |
igor_v | 1:f2adcae3d304 | 84 | int PI_Fb0; //_ //e. 27 - the B_ds zero shift of the DS //r. 27 - �������� ���� ���� B��� |
igor_v | 1:f2adcae3d304 | 85 | int PI_scl; //_ //e. 28 - the Scale scale coefficient of the gyro //r. 28 - ���������� �����. ��������� Scale |
igor_v | 1:f2adcae3d304 | 86 | int PI_bia; //_ //e. 29 - the Bias zero shift of the gyro //r. 29 - �������� ���� ��������� Bias |
igor_v | 0:8ad47e2b6f00 | 87 | |
igor_v | 1:f2adcae3d304 | 88 | //e. =============== coefficients of the temperature correction ================= //r. =============== ������������ ������������� ��������� ================= |
igor_v | 0:8ad47e2b6f00 | 89 | int PI_a0; //_ // 30 |
igor_v | 0:8ad47e2b6f00 | 90 | int PI_a1; //_ // 31 |
igor_v | 0:8ad47e2b6f00 | 91 | int PI_a2; //_ // 32 |
igor_v | 0:8ad47e2b6f00 | 92 | int PI_a3; //_ // 33 |
igor_v | 0:8ad47e2b6f00 | 93 | int PI_a4; //_ // 34 |
igor_v | 0:8ad47e2b6f00 | 94 | int PI_a5; //_ // 35 |
igor_v | 0:8ad47e2b6f00 | 95 | int PI_a6; //_ // 36 |
igor_v | 0:8ad47e2b6f00 | 96 | int PI_b1; //_ // 37 |
igor_v | 0:8ad47e2b6f00 | 97 | int PI_b2; //_ // 38 |
igor_v | 0:8ad47e2b6f00 | 98 | int PI_b3; //_ // 39 |
igor_v | 0:8ad47e2b6f00 | 99 | int PI_b4; //_ // 40 |
igor_v | 0:8ad47e2b6f00 | 100 | int PI_b5; //_ // 41 |
igor_v | 0:8ad47e2b6f00 | 101 | int PI_b6; //_ // 42 |
igor_v | 0:8ad47e2b6f00 | 102 | |
igor_v | 1:f2adcae3d304 | 103 | //e. =============== parameters of normalization of the temperature sensors ============= //r. =============== ��������� ���������� �������� ����������� ============= |
igor_v | 0:8ad47e2b6f00 | 104 | |
igor_v | 1:f2adcae3d304 | 105 | int Tmp_bias[6]; //_ //e. 43 - an array of shifts of the 0..5 temperature sensors //r. 43 - ������ ������� ������������� �������� 0..5 |
igor_v | 1:f2adcae3d304 | 106 | int Tmp_scal[6]; //_ //e. 49 - an array of the scale coefficients of temperature sensors//r. 49 - ������ ���������� �-��� ������������� �������� |
igor_v | 1:f2adcae3d304 | 107 | int WP_reset; //e. 55 - initial position of the CPLC regulator (after reset) //r. 55 - �������� ��������� ���������� ��� (����� ������) |
igor_v | 0:8ad47e2b6f00 | 108 | |
igor_v | 1:f2adcae3d304 | 109 | //e. ================ gain factor of photodetector channels =========== //r. ================ �-� �������� ������� ������������� =========== |
igor_v | 1:f2adcae3d304 | 110 | unsigned int Gain_Ph_A; //e. 56 - initial gain factor of the A channel of photodetector //r. 56 - ��������� �-� �������� ������ � ������������� |
igor_v | 1:f2adcae3d304 | 111 | unsigned int Gain_Ph_B; //e. 57 - initial gain factor of the B channel of photodetector //r. 57 - ��������� �-� �������� ������ B ������������� |
igor_v | 0:8ad47e2b6f00 | 112 | |
igor_v | 1:f2adcae3d304 | 113 | //e. =============== switch of the source of loading GLD variables block === //r. =============== ������������� ��������� �������� ����� ���������� ��� (������� � ������������ ���������) |
igor_v | 1:f2adcae3d304 | 114 | int Header_Word; //e. 58 - flash sector validity header //r. 58 - ���������-���� � ���������� ��������� �������� |
igor_v | 1:f2adcae3d304 | 115 | int LoadFlash_enable; //e. 59 - source loading flag: 1 - load from the flash //r. 59 - ������� ��������� ��������: 1 - ��������� �� flesh |
igor_v | 1:f2adcae3d304 | 116 | //e. 0 - load default parameters (factory) //r. 0 - ������� ��������� �� ��������� (���������) |
igor_v | 1:f2adcae3d304 | 117 | unsigned int Device_SerialNumber; //e. 60 - serial number of the device //r. 60 - �������� ����� ������� |
igor_v | 0:8ad47e2b6f00 | 118 | int Reserved0; //e. 61 - not used |
igor_v | 1:f2adcae3d304 | 119 | TERMO_MODE TermoMode; //e 62 - device operation mode (with thermocompenstion, without it, debug )//r. 62 - ����� ������ ������� (� �����������������, ��� ��� ��� �������) |
igor_v | 1:f2adcae3d304 | 120 | //e. addition for the piecewise-linear termocorrection //r. ���������� ��� �������-�������� �������������� |
igor_v | 0:8ad47e2b6f00 | 121 | int TemperInt[TERMO_FUNC_SIZE]; //e. 63 |
igor_v | 0:8ad47e2b6f00 | 122 | float TermoFunc[TERMO_FUNC_SIZE]; //e. 77 |
igor_v | 1:f2adcae3d304 | 123 | int WP_reset2; //e. 91 - voltages of CPLC regulator reset at cooling //r. xx - ���������� ��������� ������� ��� ��� ���������� |
igor_v | 1:f2adcae3d304 | 124 | //e. parameters setting termocompensation parameters in dynamics (at heating and cooling) //r. ���������, �������� ��������� ���������������� � �������� (��� ������� � ����������) |
igor_v | 0:8ad47e2b6f00 | 125 | float Reserved1; //e. 92 - not used |
igor_v | 0:8ad47e2b6f00 | 126 | float Reserved2; //e. 93 - not used |
igor_v | 1:f2adcae3d304 | 127 | int K_vb_tu; //e. 94 - slope of dependence of the VB_N division factor from temperature (as though Hz/degree, but in relative units ) //r. �������� ����������� ������������ ������� VB_N �� ����������� (��� �� ��/������, �� � �.�.) |
igor_v | 1:f2adcae3d304 | 128 | int TemperNormal; //e. 95 -temperature for which the VB_N division factor of the dither drive is set //r. �����������, ��� ������� ����� ����������� ������� ������������ VB_N |
igor_v | 1:f2adcae3d304 | 129 | int K_WP_rst_heating; //r. 96 - �������� ����������� ���������� ��������� ��� ���������� �� ����������� (��� �� �����/������, �� � �.�. ��� � ������������� ) |
igor_v | 1:f2adcae3d304 | 130 | int K_WP_rst_cooling; //e. 97 - slope of dependence of a reset voltage at cooling from temperature (as though Volt/degree, but in relative units of DAC and temperature sensors) //r. �������� ����������� ���������� ��������� ��� ���������� �� ����������� (��� �� �����/������, �� � �.�. ��� � ������������� ) |
igor_v | 1:f2adcae3d304 | 131 | int WP_transition_step; //e. 98 - step of change of a heater voltage at resetting //r. ��� ��������� ���������� ����������� ��� ���������� ��������� |
igor_v | 0:8ad47e2b6f00 | 132 | int Reserved3; // e. 99 -not used |
igor_v | 1:f2adcae3d304 | 133 | int HF_scl_2; //r. 100 - ����������� �������� (1.15) ������� ��� ��� ��������� |
igor_v | 0:8ad47e2b6f00 | 134 | int TemperIntDyn[TERMO_FUNC_SIZE]; //e. 114 - |
igor_v | 0:8ad47e2b6f00 | 135 | float ThermoHeatDelta[TERMO_FUNC_SIZE]; //e. 128 - |
igor_v | 1:f2adcae3d304 | 136 | int DeltaTempRecalc; //r. 129 - ������������� �������� ��������� �������. ����������� (� �.�.) //e. temperature delta for dynamic thermocompensation recalculation(in relative units) |
igor_v | 0:8ad47e2b6f00 | 137 | int TemperCoolIntDyn[TERMO_FUNC_SIZE]; // e. 143 - |
igor_v | 0:8ad47e2b6f00 | 138 | float ThermoCoolDelta[TERMO_FUNC_SIZE]; //e. 157 - |
igor_v | 0:8ad47e2b6f00 | 139 | } Str; |
igor_v | 0:8ad47e2b6f00 | 140 | } TDEVICE_BLK; |
igor_v | 0:8ad47e2b6f00 | 141 | |
igor_v | 0:8ad47e2b6f00 | 142 | |
igor_v | 0:8ad47e2b6f00 | 143 | |
igor_v | 0:8ad47e2b6f00 | 144 | |
igor_v | 0:8ad47e2b6f00 | 145 | |
igor_v | 0:8ad47e2b6f00 | 146 | |
igor_v | 0:8ad47e2b6f00 | 147 | |
igor_v | 0:8ad47e2b6f00 | 148 | |
igor_v | 0:8ad47e2b6f00 | 149 | |
igor_v | 0:8ad47e2b6f00 | 150 | |
igor_v | 0:8ad47e2b6f00 | 151 | |
igor_v | 1:f2adcae3d304 | 152 | //e. ************ end of the BLOCK of VARIABLES, LOADED from FLASH-memory ************ //r. ************ ����� ����� ����������� �� ����-������ ���������� ��� ************ |
igor_v | 1:f2adcae3d304 | 153 | extern TDEVICE_BLK Device_blk; //e. the BLOCK of VARIABLES, LOADED from FLASH-memory //r. ���� ����������, ����������� �� FLASH-������ |
igor_v | 0:8ad47e2b6f00 | 154 | |
igor_v | 0:8ad47e2b6f00 | 155 | extern int Device_Mode; |
igor_v | 0:8ad47e2b6f00 | 156 | extern unsigned Valid_Data; |
igor_v | 0:8ad47e2b6f00 | 157 | |
igor_v | 0:8ad47e2b6f00 | 158 | extern unsigned ser_num; |
igor_v | 0:8ad47e2b6f00 | 159 | |
igor_v | 1:f2adcae3d304 | 160 | extern int VB_Nmin0; //r. ������� ��������� �������� ���������� ������� ��� ����������� Device_blk.TemperNormal |
igor_v | 1:f2adcae3d304 | 161 | extern int VB_Nmax0; //r. �������� ��������� �������� ���������� ������� ��� ����������� Device_blk.TemperNormal |
igor_v | 0:8ad47e2b6f00 | 162 | |
igor_v | 0:8ad47e2b6f00 | 163 | extern unsigned BIT_number; |
igor_v | 0:8ad47e2b6f00 | 164 | extern unsigned Is_BIT; |
igor_v | 0:8ad47e2b6f00 | 165 | |
igor_v | 1:f2adcae3d304 | 166 | extern unsigned start_Rq; //r. ������ �� ������ ������� |
igor_v | 1:f2adcae3d304 | 167 | extern unsigned stop_Rq; //r. ������ �� ������� ������� |
igor_v | 1:f2adcae3d304 | 168 | extern unsigned pulse_Rq; //r. ������ �� ������ ������ |
igor_v | 0:8ad47e2b6f00 | 169 | |
igor_v | 1:f2adcae3d304 | 170 | //r. *** ��������� ��������� �� ��������� *** |
igor_v | 1:f2adcae3d304 | 171 | #define DEVICE_SN 1 //r. �������� ����� ������� = 01 |
igor_v | 1:f2adcae3d304 | 172 | #define My_Addres_const 0 //r. - ����������� ����� ���������� |
igor_v | 0:8ad47e2b6f00 | 173 | |
igor_v | 1:f2adcae3d304 | 174 | //r. ====== ��������� ������� �� ���������� ������� =============== |
igor_v | 0:8ad47e2b6f00 | 175 | |
igor_v | 1:f2adcae3d304 | 176 | #define HF_REF_CONST 15080 //r. 1 - �������� ����� |
igor_v | 1:f2adcae3d304 | 177 | #define HF_SCL_CONST 1 //r. 2 - ����������� �������� (1.15) |
igor_v | 1:f2adcae3d304 | 178 | #define HF_MIN_CONST -32668 //r. 3 - ������� ��������� �������� �� ���� ���������� (������������� ������. ���������� �� ���) |
igor_v | 1:f2adcae3d304 | 179 | #define HF_MAX_CONST -17379 //r. 4 - �������� ��������� �������� �� ���� ���������� (������������� �����. ���������� �� ���) |
igor_v | 1:f2adcae3d304 | 180 | #define HFO_SHIFT 16 //r. ����� �������� ������� ����� � 32-�������� ���������� hf_reg32 |
igor_v | 0:8ad47e2b6f00 | 181 | |
igor_v | 1:f2adcae3d304 | 182 | //r. ====== ��������� ������� ������������ �������� ��������� (���) ===== |
igor_v | 0:8ad47e2b6f00 | 183 | |
igor_v | 1:f2adcae3d304 | 184 | #define WP_REF_CONST 5 //r. 7 - �������� ����� |
igor_v | 1:f2adcae3d304 | 185 | #define WP_SCL_CONST 5 //r. 8 - ����������� �������� (1.15) |
igor_v | 1:f2adcae3d304 | 186 | #define WP_MDY_CONST 30 //r. 9 - �������� �������� ������ |
igor_v | 1:f2adcae3d304 | 187 | #define WP_RUP_CONST 31936 //r. 10 - ������ �������� ����������� ��� (������������� �����. ���������� �� �����������) |
igor_v | 1:f2adcae3d304 | 188 | #define WP_RDW_CONST 11801 //r. 11 - ������� �������� ����������� ��� (������������� ������. ���������� �� �����������) |
igor_v | 0:8ad47e2b6f00 | 189 | |
igor_v | 0:8ad47e2b6f00 | 190 | |
igor_v | 1:f2adcae3d304 | 191 | //r. =============== ��������� ������� ������������ ��� ==================== |
igor_v | 0:8ad47e2b6f00 | 192 | |
igor_v | 1:f2adcae3d304 | 193 | #define VB_PHS_CONST 4 //r. 12 - �������� Phase_���. ��� ������������ |
igor_v | 1:f2adcae3d304 | 194 | #define VB_SCL_CONST 1024 //r. 13 - ����������� �������� (1.15) ��� ������������ |
igor_v | 1:f2adcae3d304 | 195 | #define T_VIB_START 16600 //r. 14 - �����.������� N ������������ (������ ���������) �� |
igor_v | 1:f2adcae3d304 | 196 | //r. _VB_N ��������� ������ ��������� ������������ (406Hz-18916, 17067 - 450Hz) |
igor_v | 1:f2adcae3d304 | 197 | #define T_VIB_DELTA 1000 //r. �������� ��������� ������� ��������� ������������ (~ +/- 10 Hz) |
igor_v | 0:8ad47e2b6f00 | 198 | |
igor_v | 1:f2adcae3d304 | 199 | #define VB_NMIN_CONST 12080 //r. 15 - ������� ��������� �������� ���������� ������� |
igor_v | 1:f2adcae3d304 | 200 | #define VB_NMAX_CONST 64000 //r. 16 - �������� ��������� �������� ���������� ������� |
igor_v | 1:f2adcae3d304 | 201 | #define VB_FDF_HI_CONST 3 //r. 17 - �������� ������� ����������� (H) |
igor_v | 1:f2adcae3d304 | 202 | #define VB_FDF_LO_CONST 0 //r. 18 - (L) (������� ��������) |
igor_v | 1:f2adcae3d304 | 203 | #define VB_FSC_CONST -2000 //r. 19 - ����������� �������� ���������� ������� ����������� |
igor_v | 1:f2adcae3d304 | 204 | #define VB_TMIN_CONST 100 //r. 20 - ������� ��������� �������� ���������� Tau |
igor_v | 1:f2adcae3d304 | 205 | #define VB_TMAX_CONST 10022 //r. 21 - �������� ��������� �������� ���������� Tau |
igor_v | 1:f2adcae3d304 | 206 | #define L_VIB_START 5120 //r. 22 - ������������ �������� ������������ (�� ���������) |
igor_v | 1:f2adcae3d304 | 207 | //r. _VB_tau ��������� ������������ �������� ������������ |
igor_v | 0:8ad47e2b6f00 | 208 | |
igor_v | 1:f2adcae3d304 | 209 | #define VBN_TZD_CONST 500 //r. 23 - �������� ������ ��������� (��������� ������������) |
igor_v | 1:f2adcae3d304 | 210 | #define VBN_RAN_CONST 400 //r. 24 - �������� ��������� ������������ ��������� VBN_Tsl |
igor_v | 1:f2adcae3d304 | 211 | #define VBN_K_CONST 7000 //r. 25 - �������� ��������� ��������� (��������� ������������) |
igor_v | 0:8ad47e2b6f00 | 212 | |
igor_v | 1:f2adcae3d304 | 213 | //r. =============== ��������� ������� ������������� �������� ��� ========== |
igor_v | 1:f2adcae3d304 | 214 | #define RI_REF_CONST 25600 //r. 5 - �������� ����� |
igor_v | 1:f2adcae3d304 | 215 | #define RI_SCL_CONST 0 //r. 6 - ����������� �������� (1.15) |
igor_v | 0:8ad47e2b6f00 | 216 | |
igor_v | 0:8ad47e2b6f00 | 217 | |
igor_v | 1:f2adcae3d304 | 218 | //r. =============== ��������� ��������� ���������� ���������� ============= |
igor_v | 1:f2adcae3d304 | 219 | #define PI_FSC_CONST 128 //r. 26 - ���������� ����������� S��� |
igor_v | 1:f2adcae3d304 | 220 | #define PI_FB0_CONST 0 //r. 27 - �������� ���� ���� B��� |
igor_v | 1:f2adcae3d304 | 221 | #define PI_SCL_CONST 256 //r. 28 - ���������� �����. ��������� Scale |
igor_v | 1:f2adcae3d304 | 222 | #define PI_BIA_CONST 0 //r. 29 - �������� ���� ��������� Bias |
igor_v | 0:8ad47e2b6f00 | 223 | |
igor_v | 1:f2adcae3d304 | 224 | //r. =============== ������������ ������������� ��������� ================= |
igor_v | 0:8ad47e2b6f00 | 225 | #define PI_A0_CONST 0 // 30 |
igor_v | 0:8ad47e2b6f00 | 226 | #define PI_A1_CONST 0 // 31 |
igor_v | 0:8ad47e2b6f00 | 227 | #define PI_A2_CONST 0 // 32 |
igor_v | 0:8ad47e2b6f00 | 228 | #define PI_A3_CONST 0 // 33 |
igor_v | 0:8ad47e2b6f00 | 229 | #define PI_A4_CONST 0 // 34 |
igor_v | 0:8ad47e2b6f00 | 230 | #define PI_A5_CONST 0 // 35 |
igor_v | 0:8ad47e2b6f00 | 231 | #define PI_A6_CONST 0 // 36 |
igor_v | 0:8ad47e2b6f00 | 232 | #define PI_B1_CONST 0 // 37 |
igor_v | 0:8ad47e2b6f00 | 233 | #define PI_B2_CONST 0 // 38 |
igor_v | 0:8ad47e2b6f00 | 234 | #define PI_B3_CONST 0 // 39 |
igor_v | 0:8ad47e2b6f00 | 235 | #define PI_B4_CONST 0 // 40 |
igor_v | 0:8ad47e2b6f00 | 236 | #define PI_B5_CONST 0 // 41 |
igor_v | 0:8ad47e2b6f00 | 237 | #define PI_B6_CONST 0 // 42 |
igor_v | 0:8ad47e2b6f00 | 238 | |
igor_v | 0:8ad47e2b6f00 | 239 | #define TMP_SCALE 0x4000 // 43 - 54 Tmp_bias[6]; Tmp_scal[6] |
igor_v | 0:8ad47e2b6f00 | 240 | #define TMP_BIAS 0 |
igor_v | 0:8ad47e2b6f00 | 241 | #define WP_RESET_CONST 7360 // 55 |
igor_v | 0:8ad47e2b6f00 | 242 | #define WP_RESET2_CONST 29216 |
igor_v | 0:8ad47e2b6f00 | 243 | #define WP_TRANS_STEP 32767 |
igor_v | 1:f2adcae3d304 | 244 | //r. ================ ��������� �-� �������� ������� ������������� =========== |
igor_v | 0:8ad47e2b6f00 | 245 | #define G_PHOTO_STRA 60 // 56 |
igor_v | 0:8ad47e2b6f00 | 246 | #define G_PHOTO_STRB 60 // 57 |
igor_v | 0:8ad47e2b6f00 | 247 | |
igor_v | 1:f2adcae3d304 | 248 | //r. =============== ������������� ��������� �������� ����� ���������� ��� === |
igor_v | 1:f2adcae3d304 | 249 | #define HEADER_WORD_CONST 0x55aa //r. 58 - ���������-���� � ���������� ��������� �������� |
igor_v | 0:8ad47e2b6f00 | 250 | |
igor_v | 1:f2adcae3d304 | 251 | #define DITHER_REG_PERIOD 40 //r. ������ ������������� ����������� (� �������� ������������) |
igor_v | 0:8ad47e2b6f00 | 252 | |
igor_v | 1:f2adcae3d304 | 253 | #define PLC_RESET_THRESHOLD (-3276) //r. ������������� ���������� +1.2 ������ |
igor_v | 0:8ad47e2b6f00 | 254 | |
igor_v | 1:f2adcae3d304 | 255 | //r. ���.���������� ������� �����������, ��� ���. ������ ��������� ������������ |
igor_v | 1:f2adcae3d304 | 256 | #define F_RAS_MIN 10000 //r. ����������� ������� ����������� ��� ������ |
igor_v | 1:f2adcae3d304 | 257 | #define F_OUT_MIN (5000>>4) // 5000 �� / 16 |
igor_v | 1:f2adcae3d304 | 258 | #define F_OUT_NORM (70000>>4) // 90000 �� / 16 |
igor_v | 1:f2adcae3d304 | 259 | #define F_OUT_MAX (300000>>4) // 300000 �� / 16 |
igor_v | 0:8ad47e2b6f00 | 260 | |
igor_v | 0:8ad47e2b6f00 | 261 | #define Set_LightUp LPC_GPIO0->FIOSET = (1<<4) //set light up signal |
igor_v | 0:8ad47e2b6f00 | 262 | #define Reset_LightUp LPC_GPIO0->FIOCLR = (1<<4) //reset light up signal |
igor_v | 0:8ad47e2b6f00 | 263 | |
igor_v | 1:f2adcae3d304 | 264 | //r. ��������� ��� �������-�������� ���������������� |
igor_v | 1:f2adcae3d304 | 265 | #define TERMO_FUNC_SIZE 14 //r. ���������� ����� ��������� ������� ���������������� |
igor_v | 1:f2adcae3d304 | 266 | #define MAX_ORDER 9 //r. ������������ �������� ������� ��� ������������� ���������������� |
igor_v | 1:f2adcae3d304 | 267 | #define TSENS_NUMB 4 //r. ����� ������������, ������������� ��� ����������� |
igor_v | 0:8ad47e2b6f00 | 268 | |
igor_v | 1:f2adcae3d304 | 269 | #define VALID_START_4SEC 3 //r. ����� ����� ������, ����� ����������� ����� ����������� |
igor_v | 0:8ad47e2b6f00 | 270 | |
igor_v | 1:f2adcae3d304 | 271 | #define N_START_MAX 1 // 4 //r. ����� ������� ������� ������� |
igor_v | 0:8ad47e2b6f00 | 272 | #define LIGHT_UP_PULSE_WDTH 5000 //1000 //e. width of light-up pulse = 100 msec |
igor_v | 0:8ad47e2b6f00 | 273 | #define LIGHT_UP_PAUSE 1000 //e. pause after light-up = 100 msec |
igor_v | 0:8ad47e2b6f00 | 274 | #define LIGHT_UP_POLLING 10000 //e. time of waiting laser generation = 1 sec |
igor_v | 0:8ad47e2b6f00 | 275 | |
igor_v | 0:8ad47e2b6f00 | 276 | // Status word errors bits |
igor_v | 0:8ad47e2b6f00 | 277 | #define OUT_FREQ_ERROR 0x8000 |
igor_v | 0:8ad47e2b6f00 | 278 | #define DITH_FREQ_ERROR 0x4000 |
igor_v | 0:8ad47e2b6f00 | 279 | #define HFO_VOLT_ERROR 0x2000 |
igor_v | 0:8ad47e2b6f00 | 280 | #define THERMO_RANGE_ERROR 0x1000 |
igor_v | 0:8ad47e2b6f00 | 281 | #define THERMO_DIFF_ERROR 0x0800 |
igor_v | 0:8ad47e2b6f00 | 282 | |
igor_v | 0:8ad47e2b6f00 | 283 | #define TS_MIN -2500 // minimal temperature for our thermal sensors |
igor_v | 0:8ad47e2b6f00 | 284 | #define TS_MAX +13000 // maximal temperature for our thermal sensors |
igor_v | 0:8ad47e2b6f00 | 285 | #define TS_DIFF_MAX 1300 // maximal difference between 2 thermal sensors |
igor_v | 0:8ad47e2b6f00 | 286 | |
igor_v | 0:8ad47e2b6f00 | 287 | #define HFO_NEG_MIN 8738 // -4.5 V |
igor_v | 0:8ad47e2b6f00 | 288 | #define HFO_NEG_MAX 25122 // -10.5 V |
igor_v | 0:8ad47e2b6f00 | 289 | #define HFO_POZ_MIN -32221 // +10.5 V |
igor_v | 0:8ad47e2b6f00 | 290 | #define HFO_POZ_MAX -15837 // +4.5 V |
igor_v | 0:8ad47e2b6f00 | 291 | |
igor_v | 0:8ad47e2b6f00 | 292 | //e. ================ bits of the main register (_RgConA) of GLD control ============== |
igor_v | 1:f2adcae3d304 | 293 | //r. ================ ���� ��������� �������� ���������� GLD (_RgConA) =============== |
igor_v | 0:8ad47e2b6f00 | 294 | //e. ================ (bits of the status register) ============================ |
igor_v | 1:f2adcae3d304 | 295 | //r. ================ (��� �� - ���� �������� ���������) ============================ |
igor_v | 1:f2adcae3d304 | 296 | #define LASER_ON 0x0001 //r. ���./����. ��������� ������ |
igor_v | 1:f2adcae3d304 | 297 | #define HF_REG_ON 0x0002 //r. ���./����. ������ ��� |
igor_v | 1:f2adcae3d304 | 298 | #define RI_REG_ON 0x0004 //r. ���./����. ������ �������� ��� |
igor_v | 1:f2adcae3d304 | 299 | #define WP_REG_ON 0x0008 //r. ����� ���./����. ������� ��� |
igor_v | 1:f2adcae3d304 | 300 | #define WP_SIN_ON 0x0010 //r. ���./����. ��������� ������ ��� |
igor_v | 1:f2adcae3d304 | 301 | #define VB_TAU_ON 0x0020 //r. ���./����. ������ ��������� ����������� |
igor_v | 1:f2adcae3d304 | 302 | #define VB_FREQ_ON 0x0040 //r. ���./����. ������ ������� ������������ |
igor_v | 1:f2adcae3d304 | 303 | #define GLD_ON 0x0080 //r. ���./����. ���� ��� |
igor_v | 0:8ad47e2b6f00 | 304 | |
igor_v | 0:8ad47e2b6f00 | 305 | // Status word errors bits |
igor_v | 0:8ad47e2b6f00 | 306 | #define OUT_FREQ_ERROR 0x8000 |
igor_v | 0:8ad47e2b6f00 | 307 | #define DITH_FREQ_ERROR 0x4000 |
igor_v | 0:8ad47e2b6f00 | 308 | #define HFO_VOLT_ERROR 0x2000 |
igor_v | 0:8ad47e2b6f00 | 309 | #define THERMO_RANGE_ERROR 0x1000 |
igor_v | 0:8ad47e2b6f00 | 310 | #define THERMO_DIFF_ERROR 0x0800 |
igor_v | 0:8ad47e2b6f00 | 311 | |
igor_v | 0:8ad47e2b6f00 | 312 | #define loop_is_closed(loop_bit) ((RgConA & (loop_bit)) == loop_bit) |
igor_v | 0:8ad47e2b6f00 | 313 | #define close_loop(loop_bit) RgConA |= loop_bit |
igor_v | 0:8ad47e2b6f00 | 314 | #define open_loop(loop_bit) RgConA &= ~(loop_bit) |
igor_v | 1:f2adcae3d304 | 315 | //r. ��������� ��� ������� ������������� |
igor_v | 0:8ad47e2b6f00 | 316 | #define open_all_loops() RgConA = 0 |
igor_v | 0:8ad47e2b6f00 | 317 | #define close_all_loops() RgConA = 0xFFFF |
igor_v | 0:8ad47e2b6f00 | 318 | |
igor_v | 1:f2adcae3d304 | 319 | extern unsigned SRgR; //r.���������� �������� ������ ����� ADSP |
igor_v | 0:8ad47e2b6f00 | 320 | |
igor_v | 1:f2adcae3d304 | 321 | extern unsigned RgConA; //r. �������� ������� ���������� ���������� |
igor_v | 1:f2adcae3d304 | 322 | extern unsigned RgConB; //r. �������������� ������� ���������� |
igor_v | 1:f2adcae3d304 | 323 | //extern unsigned Copy_e5_RgR; //r. ����� �������� ������ ����� E5 |
igor_v | 1:f2adcae3d304 | 324 | //extern unsigned Copy_e5_RgRA; //r. ����� ��������������� �������� ������ E5 |
igor_v | 0:8ad47e2b6f00 | 325 | |
igor_v | 0:8ad47e2b6f00 | 326 | void contrl_GLD(void); |
igor_v | 1:f2adcae3d304 | 327 | |
igor_v | 0:8ad47e2b6f00 | 328 | #endif |
igor_v | 0:8ad47e2b6f00 | 329 | |
igor_v | 0:8ad47e2b6f00 | 330 |