comparison src/cs/layer1/gtt_include/l1gtt_const.h @ 0:b6a5e36de839

src/cs: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:39:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b6a5e36de839
1 /************* Revision Controle System Header *************
2 * GSM Layer 1 software
3 * L1GTT_CONST.C
4 *
5 * Filename l1gtt_const.h
6 * Copyright 2003 (C) Texas Instruments
7 *
8 ************* Revision Controle System Header *************/
9
10
11 //----------------------------------------
12 // MCU<->DSP communication bit field.
13 //----------------------------------------
14 // NDB area
15 // bit in d_audio for tty features
16 #define B_GTT_START (TRUE_L << 4)
17 #define B_GTT_STOP (TRUE_L << 5)
18
19 //-------------------------------
20 // GTT background task status
21 //-------------------------------
22
23 #define GTT_ACTIVATED 1
24 #define GTT_IDLE 0
25
26 //----------------------------
27 // GTT DSP customizable values
28 //----------------------------
29
30 #define C_TTY_MOD_NORM 0x3FFF // Sets the amplitude of the TTY modulator output
31 #define C_TTY_DETECT_THRES 0x1800 // Threshold for detection by the TTY estimator
32 #define C_TTY_FA_THRES 0x0CCC // Threshold for TTY false alarm detection
33 #define C_CTM_DETECT_SHIFT 0x0000 // Shift of the threshold used for detection by the CTM estimator
34
35 //-------------------------
36 // FIFO constants
37 //-------------------------
38
39 // FIFO size
40 // Note: Practical size is equal to acutual size + 1.
41 #define FIFO_1_size 0x1C //28
42 #define FIFO_2_size 0x3C //60
43 #define FIFO_3_size 0x3C //60
44 #define FIFO_4_size 0x1C //28
45
46 // Header size
47 #define HEADER_size (sizeof(T_TTY_FIFO_struct)/2)
48
49 /***********************************************************************/
50 /* ___ * ___ */
51 /* @dsp 10BE | R | * @mcu FFD0117C | R | */
52 /* | W | * | W | */
53 /* | S | * | S | */
54 /* | L | * | L | */
55 /* | x | * | x | */
56 /* FIFO 1 | x | * | x | */
57 /* | x | * | x | */
58 /* | x | * | x | */
59 /* | x | * | x | */
60 /* | x | * | x | */
61 /* | x | * | x | */
62 /* | x | * | x | */
63 /* |___| * |___| */
64 /* ___ * ___ */
65 /* @dsp 10DF | R | * @mcu FFD011BE | R | */
66 /* | . | * | . | */
67 /* FIFO 2 | . | * FIFO 2 | . | */
68 /* |___| * |___| */
69 /* ___ * ___ */
70 /* @dsp 1120 | R | * @mcu FFD01240 | R | */
71 /* | . | * | . | */
72 /* FIFO 3 | . | * FIFO 3 | . | */
73 /* |___| * |___| */
74 /* ___ * ___ */
75 /* @dsp 1161 | R | * @mcu FFD012C2 | R | */
76 /* | . | * | . | */
77 /* FIFO 4 | . | * FIFO 4 | . | */
78 /* |___| * |___| */
79 /* * */
80 /***********************************************************************/
81
82 //FIFO @dress dsp
83 #define FIFO_1_dsp 0x10BE // corresponds to the speech recognition buffer
84 #define FIFO_2_dsp (FIFO_1_dsp + HEADER_size + FIFO_1_size + 1)
85 #define FIFO_3_dsp (FIFO_2_dsp + HEADER_size + FIFO_2_size + 1)
86 #define FIFO_4_dsp (FIFO_3_dsp + HEADER_size + FIFO_3_size + 1)
87
88 //FIFO @dress mcu
89 #define FIFO_1_mcu 0xFFD0117C // corresponds to the speech recognition buffer
90 #define FIFO_2_mcu (FIFO_1_mcu + ((HEADER_size + FIFO_1_size + 1) * 2))
91 #define FIFO_3_mcu (FIFO_2_mcu + ((HEADER_size + FIFO_2_size + 1) * 2))
92 #define FIFO_4_mcu (FIFO_3_mcu + ((HEADER_size + FIFO_3_size + 1) * 2))
93
94 // Return status
95 #define TTY_FIFO_OK 0
96 #define TTY_FIFO_OVERFLOW 1
97 #define TTY_FIFO_UNDERFLOW 2
98 #define TTY_FIFO_WRONG_COMMAND 3
99
100 /* GTT Event group defines */
101 #define DATA_AVAIL_EVENT 0x00000001 // BIT_0
102 #define INIT_EVENT 0x00000002 // BIT_1
103 #define EXIT_EVENT 0x00000004 // BIT_2
104
105 #define DSP_API_START 0x800
106
107 /* constant definitions */
108 /* Time interval to check for incoming data, in ms */
109 #define TIME_INTERVAL_OF_INPUTS 120
110 /* Max number of CTM sample inputs */
111 #define MAX_CTM_SAMPLES_IN (TIME_INTERVAL_OF_INPUTS * 2)/5
112 /* Max number of Baudot sample inputs */
113 #define MAX_BAUDOT_SAMPLES_IN (TIME_INTERVAL_OF_INPUTS * 1)/5
114 /* Max number of TTY code from inputs */
115 #define MAX_TTY_CODE_IN (TIME_INTERVAL_OF_INPUTS / 176 + 2)
116 /* Max number of CTM sample outputs */
117 #define MAX_CTM_SAMPLES_OUT MAX_CTM_SAMPLES_IN
118 /* Max number of Baudot bits outputs */
119 #define MAX_BAUDOT_BITS_OUT 2*(MAX_TTY_CODE_IN)* 8
120
121 /* Number of processing cycles before the next Enquiry burst */
122 #define ENQUIRY_BURST_TIMEOUT (1320/5)
123
124 #define UWORD16_MAX 65535
125 #define WORD16_MAX 32767
126
127 #define WORD32_MAX 2147483647L
128
129 /* GTT loops for test: TST_CLOSE_GTT_LOOP_REQ message */
130 #define TTY_LOOP 0x0001 // Close TTY loop (TTY modulator -> TTY estimator)
131 #define CTM_LOOP 0x0002 // Close CTM loop (CTM samples : speech encoder -> speech decoder)
132
133 #if (L2_L3_SIMUL)
134 #define CTM_TX_INPUT 1 // input on CTM transmitter
135 #define TTY_ENC_INPUT 2 // input on Baudot encoder
136 #define CTM_RX_INPUT 3 // input on CTM receiver (simulation only)
137 #define TTY_DEC_INPUT 4 // input on Baudot decoder (simulation only)
138 #endif