FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/L1/include/l1_ctl.h @ 530:25a7fe25864c
gsm-fw/L1/include: switch to LoCosto versions of all header files
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Fri, 01 Aug 2014 16:38:35 +0000 |
parents | d0de2d0a426d |
children | de635895e0be |
comparison
equal
deleted
inserted
replaced
529:f72c9db5e2f5 | 530:25a7fe25864c |
---|---|
1 /************* Revision Controle System Header ************* | 1 /************* Revision Controle System Header ************* |
2 * GSM Layer 1 software | 2 * GSM Layer 1 software |
3 * L1_CTL.H | 3 * L1_CTL.H |
4 * | 4 * |
5 * Filename l1_ctl.h | 5 * Filename l1_ctl.h |
6 * Copyright 2003 (C) Texas Instruments | 6 * Copyright 2003 (C) Texas Instruments |
7 * | 7 * |
8 ************* Revision Controle System Header *************/ | 8 ************* Revision Controle System Header *************/ |
9 | 9 |
10 /************************************/ | 10 /************************************/ |
11 /* Automatic timing control (TOA) */ | 11 /* Automatic timing control (TOA) */ |
12 /************************************/ | 12 /************************************/ |
13 #define C_RED 1 // Factor used to reduce the maximum accumulated values. | 13 #define C_RED 1 // Factor used to reduce the maximum accumulated values. |
14 // Default : 1/2 | 14 // Default : 1/2 |
15 #define C_GEW 1 // Weighting factor. Default : 1/2 | 15 #define C_GEW 1 // Weighting factor. Default : 1/2 |
16 | 16 |
17 #define C_SNRGR 2560 // 2.5 F6.10 | 17 #define C_SNRGR 2560 // 2.5 F6.10 |
18 #define C_SNR_THR 8192 // 8 F6.10 | 18 #define C_SNR_THR 8192 // 8 F6.10 |
19 #define TOA_HISTO_LEN 11 // Histogram length | 19 #define TOA_HISTO_LEN 11 // Histogram length |
20 | 20 |
21 #define IL_FOR_RXLEV_SNR 220 // RX POWER LEVEL //increased from 210 to 220 | |
22 | |
23 #if (TOA_ALGO == 2) | |
24 #define L1_TOA_SCALING_CONSTANT (32768) // L1_TOA_SCALING_CONSTANT | |
25 #define L1_TOA_LAMBDA (0x7800) // 0.9375 represented in Q15 i.e. 0.9375*32768 | |
26 #define L1_TOA_ONE_MINUS_LAMBDA (0x0800) // 0.0625 represented in Q15 i.e. 0.0625*32768 | |
27 #define L1_TOA_THRESHOLD_15 (0x1333) // 0.15 in Q15 | |
28 #define L1_TOA_THRESHOLD_20 (0x1999) // 0.20 in Q15 | |
29 #define L1_TOA_THRESHOLD_25 (0x2000) // 0.25 in Q15 | |
30 #define L1_TOA_THRESHOLD_30 (0x2666) // 0.30 in Q15 | |
31 #if (CODE_VERSION == SIMULATION) | |
32 #define L1_TOA_SNR_THRESHOLD (0) // For simulator the threshold is made zero to facilitate | |
33 // TOA testing in simulator | |
34 #else | |
35 #if (NEW_SNR_THRESHOLD == 0) | |
36 #define L1_TOA_SNR_THRESHOLD (480) // 0x1E0 in F6.10 is equal to 0.46875 | |
37 #else | |
38 #define L1_TOA_SNR_THRESHOLD (2048) // 0x1E0 in F6.10 is equal to 0.46875 | |
39 #endif /* NEW_SNR_THRESHOLD*/ | |
40 | |
41 #endif | |
42 #if (CODE_VERSION == SIMULATION) | |
43 #define L1_TOA_EXPECTED_TOA (14) // Expected TOA on the MCU side | |
44 #else | |
45 #define L1_TOA_EXPECTED_TOA (14) // Expected TOA on the MCU side | |
46 #endif | |
47 #endif | |
48 | |
49 #if (NEW_SNR_THRESHOLD == 1) | |
50 #define SAIC_OFF (0) | |
51 #define SAIC_ON (1) | |
52 #endif /* NEW_SNR_THRESHOLD */ | |
21 /************************************/ | 53 /************************************/ |
22 /* Automatic Gain Control (AGC) */ | 54 /* Automatic Gain Control (AGC) */ |
23 /************************************/ | 55 /************************************/ |
24 | 56 |
25 #define INDEX_MIN 0 | 57 #define INDEX_MIN 0 |
26 #define INDEX_MAX 240 // 120 | 58 #define INDEX_MAX 240 // 120 |
27 | 59 |
28 /************************************/ | 60 /************************************/ |
29 /* Automatic frequency compensation */ | 61 /* Automatic frequency compensation */ |
30 /************************************/ | 62 /************************************/ |
31 #define C_thr_snr 2560 // 1/0.4 * 2**10 | 63 #if (L1_SAIC == 1) |
32 #define C_thr_P 524288L // 0.5 * 2**20 | 64 #define C_thr_snr 2048// 1/0.4 * 2**10 - CQ no- 76320 |
33 #define C_cov_start 838861L // 0.8 * 2**20 | 65 #else |
34 #define C_a0_kalman 10486L // 0.01 * 2**20 | 66 #define C_thr_snr 2560 // 1/0.4 * 2**10 |
35 #define C_g_kalman 53687091L// 0.05 * 2**30 | 67 #endif |
68 #define C_thr_P 524288L // 0.5 * 2**20 | |
69 #define C_cov_start 838861L // 0.8 * 2**20 | |
70 #define C_a0_kalman 10486L // 0.01 * 2**20 | |
71 #define C_g_kalman 53687091L// 0.05 * 2**30 | |
36 #define C_N_del 2 // delay of frequency control loop | 72 #define C_N_del 2 // delay of frequency control loop |
37 // due to C W R pipeline | 73 // due to C W R pipeline |
38 #define C_Q 3L // 0.000003 * 2**20 | 74 #define C_Q 3L // 0.000003 * 2**20 |
39 #define C_thr_K 209715L // 0.2 * 2**20 | 75 #define C_thr_K 209715L // 0.2 * 2**20 |
40 #define C_thr_phi 328 // 0.01 * 2**15 | 76 #define C_thr_phi 328 // 0.01 * 2**15 |
41 | 77 |
42 #if (VCXO_ALGO == 1) | 78 #if (VCXO_ALGO == 1) |
43 #define C_WIN_AVG_SIZE_M 64 // average size M | 79 #define C_WIN_AVG_SIZE_M 64 // average size M |
44 #define C_PSI_AVG_SIZE_D 32 // distance size D | 80 #define C_PSI_AVG_SIZE_D 32 // distance size D |
45 #define C_MSIZE (C_WIN_AVG_SIZE_M * C_PSI_AVG_SIZE_D) // Data history for predictor | 81 #define C_MSIZE (C_WIN_AVG_SIZE_M * C_PSI_AVG_SIZE_D) // Data history for predictor |
46 #define C_RGAP_BAD_SNR_COUNT_B 32 // bad SNR count B | 82 #define C_RGAP_BAD_SNR_COUNT_B 32 // bad SNR count B |
47 #define ALGO_AFC_RXGAP 1 // reception gap algo | 83 #define ALGO_AFC_RXGAP 1 // reception gap algo |
48 #define ALGO_AFC_KALMAN 1 // Kalman filter | 84 #define ALGO_AFC_KALMAN 1 // Kalman filter |
49 #define ALGO_AFC_LQG_PREDICTOR 2 // LQG filter + rgap predictor | 85 #define ALGO_AFC_LQG_PREDICTOR 2 // LQG filter + rgap predictor |
50 #define ALGO_AFC_KALMAN_PREDICTOR 3 // Kalman filter + rgap predictor | 86 #define ALGO_AFC_KALMAN_PREDICTOR 3 // Kalman filter + rgap predictor |
51 #endif | 87 #endif |
52 | 88 |
53 #if ((ANALOG == 1) || (ANALOG == 2) || (ANALOG == 3)) | 89 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3) || (ANLG_FAM == 11)) |
54 // clipping related to AFC DAC linearity range | 90 // clipping related to AFC DAC linearity range |
55 #define C_max_step 32000 // 4000 * 2**3 | 91 #define C_max_step 32000 // 4000 * 2**3 |
56 #define C_min_step -32000 // -4000 * 2**3 | 92 #define C_min_step -32000 // -4000 * 2**3 |
57 #endif | 93 #endif |
94 | |
95 /***************************************************/ | |
96 /* SAIC (Single Antenna Interference Cancellation) */ | |
97 /***************************************************/ | |
98 | |
99 #if (L1_SAIC != 0) | |
100 #define L1_SAIC_GENIE_GSM_GPRS_IDLE_THRESHOLD 192 // Input Level Threshold for GSM/GPRS Idle. | |
101 #define L1_SAIC_GENIE_GSM_DEDIC_THRESHOLD 192 // Input Level Threshold for GSM Dedicated. | |
102 #define L1_SAIC_GENIE_GPRS_PCKT_TRAN_THRESHOLD 192 // Input Level Threshold for GPRS Packet Transfer | |
103 #endif | |
104 | |
105 | |
106 #define L1_SAIC_HARDWARE_FILTER (1) | |
107 #define L1_SAIC_PROGRAMMABLE_FILTER (0) | |
108 | |
109 //Locosto. For Locosto psi_quant = F14.2 else F13.3 | |
110 #if(RF_FAM == 61) | |
111 #define CONVERT_PSI_QUANT(value) (value >> 2) | |
112 #else | |
113 #define CONVERT_PSI_QUANT(value) (value >> 3) | |
114 #endif | |
115 |