comparison g23m-glue/cst/cst.h @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /*
2 +--------------------------------------------------------------------+
3 | PROJECT : XXX SOURCE : CST.H |
4 | AUTHOR : XXX VERSION: 1.0 |
5 | CREATED : 01.02.99 STATE : code |
6 +--------------------------------------------------------------------+
7
8 MODULE : CST
9
10 PURPOSE : Definitions for the protocol stack entity CST.
11 */
12
13 #ifndef CST_H
14 #define CST_H
15
16 #include "../../include/config.h"
17
18 /*==== TEST =====================================================*/
19
20 /*
21 * Dynamic Configuration Numbers
22 */
23 #define ID_CONFIG 1
24 #define ID_MUTE 2
25 #define ID_GSM_PARAMETERS 11
26 #define ID_L1_PARAMETERS 12
27
28 /*
29 * TIMER IDs
30 */
31 #define T_RX 0 /* request of fieldstrength */
32 #define TMAX 0 /* must be the last one */
33
34 /*
35 * Configuration Parameter
36 */
37 #define TCST1 0
38 #define TCST2 1
39
40
41 #if (CHIPSET == 0)
42 #define ARMIO_CLK 0x0001
43 #define RIF_CLKR 0x0002
44 #define RIF_CLKX 0x0004
45 #define RIF_CLK13 0x0010
46 #define UWIRE_CLK 0x0020
47 #define SIM_CLK 0x0040
48 #define TSP_CLK 0x0080
49 #define UART_CLK 0x0400
50 #endif
51
52 #if ((CHIPSET == 2) || (CHIPSET == 3) || (CHIPSET == 4) || \
53 (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || \
54 (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || \
55 (CHIPSET == 11) || (CHIPSET == 12))
56 #define ARMIO_CLK_CUT 0x0001
57 #define UWIRE_CLK_CUT 0x0002
58 #endif
59
60 // ADC timer expiration value defining the ADC period
61 // with new frame all timer values are in ms not in tdma frames one TDMA approx 4.615 ms
62 #define ADC_PERIOD 4615
63
64 #ifdef ALR
65 //#define VM_BUFFER_SIZE 10240 // 10 seconds (1024 words for about 1 second of recording)
66 #endif
67
68
69 typedef struct
70 {
71 UBYTE t_mode;
72 ULONG t_val;
73 } T_TIMER_CONFIG;
74
75 #ifdef OPTION_TIMER
76 #define CST_TSTART(i,h,v) tim_start_timer(i,h,v)
77 #else
78 #define CST_TSTART(i,h,v) vsi_t_start(VSI_CALLER h,v)
79 #endif
80
81 #define TIMERSTART(i,v,h) csf_alloc_timer(i,v,&h)
82 #define TIMERSTOP(h) csf_free_timer(h); h = VSI_ERROR;
83
84 /*==== EXPORT =====================================================*/
85 /*
86 * CST global data declarations
87 */
88
89 #define CST_ADC_TIMER 0
90
91 /*
92 * Prototypes Timer Modul
93 */
94 /*
95 * If all entities are linked into one module this definitions
96 * prefixes all this functions with the enity name
97 */
98 #ifdef OPTION_MULTITHREAD
99 #define tim_init_timer _ENTITY_PREFIXED(tim_init_timer)
100 #define tim_set_timeout_flag _ENTITY_PREFIXED(tim_set_timeout_flag)
101 #define tim_handle_timeout _ENTITY_PREFIXED(tim_handle_timeout)
102 #define tim_config_timer _ENTITY_PREFIXED(tim_config_timer)
103 #define tim_get_config_timer _ENTITY_PREFIXED(tim_get_config_timer)
104 #define tim_start_timer _ENTITY_PREFIXED(tim_start_timer)
105 #define tim_flush_fifo _ENTITY_PREFIXED(tim_flush_fifo)
106 #endif
107
108 #ifdef OPTION_TIMER
109 /*
110 * If all entities are linked into one module this definitions
111 * prefixes the global data with the entity name
112 */
113 #ifdef OPTION_MULTITHREAD
114 #define partab _ENTITY_PREFIXED(partab)
115 #endif
116
117 EXTERN KW_DATA partab[];
118 #endif
119
120 /*
121 * If all entities are linked into one module this definitions
122 * prefixes the global data with the enity name
123 */
124 #ifdef OPTION_MULTITHREAD
125 #define hCommPL _ENTITY_PREFIXED(hCommPL)
126 #define hCommL1 _ENTITY_PREFIXED(hCommL1)
127 #endif
128
129 EXTERN T_HANDLE hCommPL; /* Communication to TI++ */
130 EXTERN T_HANDLE hCommL1; /* Communication to Layer 1 */
131 EXTERN T_HANDLE cst_handle;
132
133 /*
134 * Prototypes Customer Spefific Functions Modul
135 */
136 /*
137 * If all entities are linked into one module this definitions
138 * prefixes all this functions with the enity name
139 */
140 GLOBAL void csf_adc_process (T_CST_ADC_IND *adc_results);
141 EXTERN void adc_start (void);
142 EXTERN void power_down_config (UBYTE sleep_mode, USHORT clocks);
143 GLOBAL void csf_aec_enable (USHORT aec_ctrl_reg);
144
145 #endif // CST_H