FreeCalypso > hg > fc-magnetite
annotate src/cs/layer1/tpu_drivers/source0/tpudrv10.c @ 493:2e73bbc0648e
OSL: os_mem_fl.c compiles
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 24 Jun 2018 18:59:22 +0000 |
parents | 5ca341a26dda |
children | f8e74b692c80 |
rev | line source |
---|---|
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
404
35638332aff5
tpudrv10.c: initial placeholder version
Mychaela Falconia <falcon@freecalypso.org>
parents:
233
diff
changeset
|
2 * The situation with the tpudrv10 RF TPU driver is even worse than with |
35638332aff5
tpudrv10.c: initial placeholder version
Mychaela Falconia <falcon@freecalypso.org>
parents:
233
diff
changeset
|
3 * tpudrv12: not only are we missing the original tpudrv10.c source, |
35638332aff5
tpudrv10.c: initial placeholder version
Mychaela Falconia <falcon@freecalypso.org>
parents:
233
diff
changeset
|
4 * but we don't even have a tpudrv10.obj to reconstruct from. |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * |
404
35638332aff5
tpudrv10.c: initial placeholder version
Mychaela Falconia <falcon@freecalypso.org>
parents:
233
diff
changeset
|
6 * We are going to try reconstructing the necessary tpudrv10 bits |
35638332aff5
tpudrv10.c: initial placeholder version
Mychaela Falconia <falcon@freecalypso.org>
parents:
233
diff
changeset
|
7 * from the 20020917 fw image sans symbols that came with our D-Sample |
35638332aff5
tpudrv10.c: initial placeholder version
Mychaela Falconia <falcon@freecalypso.org>
parents:
233
diff
changeset
|
8 * board, but for now this C file is mostly a placeholder for compilation. |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
404
35638332aff5
tpudrv10.c: initial placeholder version
Mychaela Falconia <falcon@freecalypso.org>
parents:
233
diff
changeset
|
11 #define TPUDRV10_C |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 #include "board.cfg" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #include "chipset.cfg" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "l1sw.cfg" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #include "rf.cfg" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #include "swconfig.cfg" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #include "sys.cfg" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 #include "sys_types.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 #include "l1_confg.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "l1_macro.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "l1_const.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #include "l1_types.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #if TESTMODE |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #include "l1tm_defty.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #endif |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 #if (AUDIO_TASK == 1) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 #include "l1audio_const.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #include "l1audio_cust.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 #include "l1audio_defty.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #endif |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #if (L1_GTT == 1) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 #include "l1gtt_const.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 #include "l1gtt_defty.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #endif |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #if (L1_MP3 == 1) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 #include "l1mp3_defty.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #endif |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 #if (L1_MIDI == 1) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 #include "l1midi_defty.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 #endif |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 #if (L1_AAC == 1) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 #include "l1aac_defty.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 #endif |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 #include "l1_defty.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 #include "l1_time.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 #include "l1_ctl.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 #include "tpudrv.h" |
404
35638332aff5
tpudrv10.c: initial placeholder version
Mychaela Falconia <falcon@freecalypso.org>
parents:
233
diff
changeset
|
53 #include "tpudrv10.h" |
35638332aff5
tpudrv10.c: initial placeholder version
Mychaela Falconia <falcon@freecalypso.org>
parents:
233
diff
changeset
|
54 #include "l1_rf10.h" |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 #include "mem.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 #include "armio.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 #include "clkm.h" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 // Global variables |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 extern T_L1_CONFIG l1_config; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 extern UWORD16 AGC_TABLE[]; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 extern UWORD16 *TP_Ptr; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 |
233
17d79c62e638
tpudrv12.c fix from tcs211-l1-reconst: rf_index static var changed to UWORD8
Mychaela Falconia <falcon@freecalypso.org>
parents:
78
diff
changeset
|
65 static UWORD8 rf_index; /* index into rf_path[] */ |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 static UWORD16 rf_chip_band; /* from tpudrv12.obj, not in tpudrv61.c */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 static UWORD8 rfband; /* ditto */ |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
68 static UWORD8 magic2_byte; |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 // Internal function prototypes |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 void l1dmacro_rx_down (WORD32 t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 SYS_UWORD16 Convert_l1_radio_freq(SYS_UWORD16 radio_freq); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 WORD32 rf_init(WORD32 t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 // External function prototypes |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 UWORD8 Cust_is_band_high(UWORD16 radio_freq); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 extern T_RF_BAND rf_band[]; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 extern T_RF rf; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 /* DEFINITION OF MACROS FOR CHIPS SERIAL PROGRAMMATION */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 /* Is arfcn in the DCS band (512-885) ? */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 #define IS_HIGH_BAND(arfcn) (((arfcn >= 512) && (arfcn <= 885)) ? 1 : 0) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 /* Send a value to Rita RF */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 #define TSP_TO_RF(rf_data)\ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 {\ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 *TP_Ptr++ = TPU_MOVE(TSP_TX_REG_1, ((rf_data) >> 8) & 0xFF); \ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 *TP_Ptr++ = TPU_MOVE(TSP_TX_REG_2, (rf_data) & 0xFF); \ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 *TP_Ptr++ = TPU_MOVE(TSP_CTRL1, TC1_DEVICE_RF | 0x0F); \ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 *TP_Ptr++ = TPU_MOVE(TSP_CTRL2, TC2_WR); \ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 /* Send a TSP command to ABB */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 #define TSP_TO_ABB(data)\ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 {\ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 *TP_Ptr++ = TPU_MOVE(TSP_TX_REG_1, (data) & 0xFF); \ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 *TP_Ptr++ = TPU_MOVE(TSP_CTRL1, TC1_DEVICE_ABB | 0x06); \ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 *TP_Ptr++ = TPU_MOVE(TSP_CTRL2, TC2_WR); \ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 /* Trace arfcn for conversion debug */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 #ifdef ARFCN_DEBUG |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 // ----Debug information : record all arfcn programmed into synthesizer! |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 #define MAX_ARFCN_TRACE 4096 // enough for 5 sessions of 124+374 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 SYS_UWORD16 arfcn_trace[MAX_ARFCN_TRACE]; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 static UWORD32 arfcn_trace_index = 0; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 void trace_arfcn(SYS_UWORD16 arfcn) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 arfcn_trace[arfcn_trace_index++] = arfcn; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 // Wrap to beginning |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 if (arfcn_trace_index == MAX_ARFCN_TRACE) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 arfcn_trace_index = 0; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 #endif |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 /* DEFINITION OF HARWARE DEPENDANT CONSTANTS */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 /* INTERNAL FUNCTIONS OF TPUDRV14.C */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 /* EFFECTIVE DOWNLOADING THROUGH TSP */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 struct synth_s { |
414
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
149 // common |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
150 UWORD16 arfcn0; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
151 UWORD16 limit; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
152 // Tx |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
153 UWORD16 ul_farfcn0; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
154 WORD8 ul_sign; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
155 // Rx |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
156 UWORD16 dl_farfcn0; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
157 UWORD8 dl_mult; |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 }; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 |
412
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
160 struct magic1_s { |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
161 UWORD16 limit; |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
162 UWORD16 magic; |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
163 }; |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
164 |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
165 struct magic2_s { |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
166 UWORD16 limit; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
167 UWORD8 magic; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
168 }; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
169 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 struct rf_path_s { |
411
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
171 UWORD16 rf_chip_band; |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
172 UWORD8 rx_up; |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
173 UWORD8 rx_down; |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
174 UWORD8 tx_up; |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
175 UWORD8 tx_down; |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
176 UWORD8 tx_up_rev; |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
177 const struct synth_s *synth; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
178 const struct magic1_s *tx_magic1; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
179 const struct magic2_s *rx_magic2; |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 }; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 |
412
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
182 static const struct synth_s synth_900[] = |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 { |
414
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
184 { 0, 124, 890, 1, 935, 4},// gsm 0 - 124 |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
185 {974, 1023, 880, 1, 925, 4},// egsm 975 - 1023 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 }; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 |
412
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
188 static const struct magic1_s magic1_900[] = |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
189 { |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
190 { 26, 0x0820}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
191 { 35, 0x0854}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
192 { 42, 0x0847}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
193 { 54, 0x0861}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
194 { 60, 0x0847}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
195 { 69, 0x0861}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
196 { 79, 0x0847}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
197 { 94, 0x083A}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
198 { 105, 0x0847}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
199 { 112, 0x0854}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
200 { 117, 0x082D}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
201 { 124, 0x0847}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
202 { 988, 0x0820}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
203 {1014, 0x083A}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
204 {1023, 0x0820}, |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
205 }; |
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
206 |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
207 static const struct magic2_s magic2_rx900[] = |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
208 { |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
209 {0x4B00, 7}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
210 {0x4E20, 7}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
211 {0xFFFF, 7}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
212 }; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
213 |
412
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
214 static const struct synth_s synth_1800[] = |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 { |
414
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
216 {511, 885, 1710, -1, 1805, 1}, // dcs 512 - 885 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 }; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 |
413
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
219 static const struct magic1_s magic1_1800[] = |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
220 { |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
221 {571, 0x0820}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
222 {610, 0x0847}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
223 {671, 0x083A}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
224 {688, 0x082D}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
225 {719, 0x083A}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
226 {730, 0x0861}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
227 {755, 0x083A}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
228 {794, 0x0847}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
229 {845, 0x0820}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
230 {885, 0x082D}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
231 }; |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
232 |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
233 static const struct magic2_s magic2_rx1800[] = |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
234 { |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
235 {0x24B8, 0}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
236 {0x2710, 0}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
237 {0xFFFF, 0}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
238 }; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
239 |
412
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
240 static const struct synth_s synth_1900[] = |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 { |
414
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
242 {511, 810, 1850, -1, 1930, 1}, // pcs 512 - 810; |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 }; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 |
413
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
245 static const struct magic1_s magic1_1900[] = |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
246 { |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
247 {550, 0x0847}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
248 {615, 0x082D}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
249 {642, 0x083A}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
250 {702, 0x0820}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
251 {777, 0x0854}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
252 {810, 0x0861}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
253 }; |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
254 |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
255 static const struct magic2_s magic2_rx1900[] = |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
256 { |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
257 {0x26DE, 0}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
258 {0x2710, 0}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
259 {0xFFFF, 0}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
260 }; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
261 |
412
2b038b43e31b
tpudrv10.c: magic1_900[] table reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
411
diff
changeset
|
262 static const struct synth_s synth_850[] = |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 { |
414
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
264 {127, 251, 824, 1, 869, 4}, // gsm850 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 }; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 |
413
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
267 static const struct magic1_s magic1_850[] = |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
268 { |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
269 {251, 0x0924}, |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
270 }; |
780fa76e9c9b
tpudrv10.c: all magic1 tables reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
412
diff
changeset
|
271 |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
272 static const struct magic2_s magic2_rx850[] = |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
273 { |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
274 {0x4B00, 7}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
275 {0x4E20, 7}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
276 {0xFFFF, 7}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
277 }; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
278 |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
279 static const struct magic2_s magic2_tx[] = |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
280 { |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
281 {0x1A90, 6}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
282 {0x1CED, 7}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
283 {0x1D4C, 7}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
284 {0xFFFF, 7}, |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
285 }; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
286 |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
287 static const struct rf_path_s rf_path[] = { |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
288 //same index used as for band_config[] - 1 |
411
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
289 /* EGSM */ |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
290 { BAND_SELECT_GSM, RU_900, RD_900, TU_900, TD_900, TU_REV_900, |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
291 synth_900, magic1_900, magic2_rx900}, |
411
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
292 /* DCS */ |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
293 { BAND_SELECT_DCS, RU_1800, RD_1800, TU_1800, TD_1800, TU_REV_1800, |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
294 synth_1800, magic1_1800, magic2_rx1800}, |
411
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
295 /* PCS */ |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
296 { BAND_SELECT_PCS, RU_1900, RD_1900, TU_1900, TD_1900, TU_REV_1900, |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
297 synth_1900, magic1_1900, magic2_rx1900}, |
411
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
298 /* GSM850 */ |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
299 { BAND_SELECT_850, RU_850, RD_850, TU_850, TD_850, TU_REV_850, |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
300 synth_850, magic1_850, magic2_rx850}, |
411
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
301 /* PCS in dual-us */ |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
302 { BAND_SELECT_PCS, RU_1900, RD_1900, TU_1900, TD_1900, TU_REV_1900, |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
303 synth_1900, magic1_1900, magic2_rx1900}, |
411
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
304 /* non-E GSM */ |
ee49b250774f
tpudrv10.c: initial rf_path[] reconstruction
Mychaela Falconia <falcon@freecalypso.org>
parents:
406
diff
changeset
|
305 { BAND_SELECT_GSM, RU_900, RD_900, TU_900, TD_900, TU_REV_900, |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
306 synth_900, magic1_900, magic2_rx900}, |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
307 }; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
308 |
416
5ca341a26dda
tpudrv10.c: frequency programming function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
415
diff
changeset
|
309 static UWORD32 calc_freq_prog(UWORD16 arfcn, UWORD8 downlink) |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 { |
414
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
311 UWORD32 farfcn; /* sp+0x1C, in 200 kHz units */ |
416
5ca341a26dda
tpudrv10.c: frequency programming function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
415
diff
changeset
|
312 const struct synth_s *s; |
5ca341a26dda
tpudrv10.c: frequency programming function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
415
diff
changeset
|
313 const struct magic1_s *m1; |
5ca341a26dda
tpudrv10.c: frequency programming function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
415
diff
changeset
|
314 const struct magic2_s *m2; |
414
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
315 UWORD32 magic1; /* sp+0x24 */ |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
316 UWORD16 sp4; |
416
5ca341a26dda
tpudrv10.c: frequency programming function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
415
diff
changeset
|
317 UWORD32 sp8, sp0xC, sp0x10, sp0x14, sp0x18, sp0x20; |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
319 s = rf_path[rf_index].synth; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
320 while(s->limit < arfcn) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
321 s++; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
322 |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
323 m1 = rf_path[rf_index].tx_magic1; |
414
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
324 while(m1->limit < arfcn) |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
325 m1++; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
326 magic1 = m1->magic; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
327 |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
328 if (downlink) { |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
329 sp0x20 = 0x27627 * s->dl_mult + 8; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
330 farfcn = 5*s->dl_farfcn0 + (arfcn - s->arfcn0); |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
331 sp4 = farfcn * s->dl_mult; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
332 sp0x18 = sp4 << 21; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
333 sp0x14 = sp0x20 * farfcn; |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
334 m2 = rf_path[rf_index].rx_magic2; |
414
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
335 } else { |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
336 sp0x20 = 0x2762F; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
337 farfcn = 5*s->ul_farfcn0 + (arfcn - s->arfcn0); |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
338 sp4 = magic1 * s->ul_sign + farfcn; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
339 sp0x18 = sp4 << 21; |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
340 sp0x14 = sp0x20 * (magic1 * s->ul_sign + farfcn); |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
341 m2 = magic2_tx; |
414
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
342 } |
cbc25978be5a
tpudrv10.c: beginning to reconstruct the frequency programming function
Mychaela Falconia <falcon@freecalypso.org>
parents:
413
diff
changeset
|
343 |
415
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
344 while(m2->limit < sp4) |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
345 m2++; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
346 magic2_byte = (m2->magic & 7) << 5; |
b3d65ae5f02c
tpudrv10.c: magic2 tables added
Mychaela Falconia <falcon@freecalypso.org>
parents:
414
diff
changeset
|
347 |
416
5ca341a26dda
tpudrv10.c: frequency programming function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
415
diff
changeset
|
348 sp8 = (sp0x14 / 16) >> 21; |
5ca341a26dda
tpudrv10.c: frequency programming function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
415
diff
changeset
|
349 sp0xC = sp0x14 - (sp8 << 25); |
5ca341a26dda
tpudrv10.c: frequency programming function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
415
diff
changeset
|
350 sp0x10 = (((sp8 << 4) + sp0xC) * 0x1A00000 - 0x18) >> 21; |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
351 |
416
5ca341a26dda
tpudrv10.c: frequency programming function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
415
diff
changeset
|
352 return ((sp0xC & 0xF) << 12) | ((sp8 & 0x7F) << 16) | ((sp0x10 & 0xF) << 8); |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
353 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
354 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
355 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 /* Convert_l1_radio_freq */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
357 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
358 /* conversion of l1 radio_freq to */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
359 /* real channel number */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
360 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
361 SYS_UWORD16 Convert_l1_radio_freq(SYS_UWORD16 radio_freq) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
362 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
363 switch(l1_config.std.id) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
364 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
365 case GSM: |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
366 case DCS1800: |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
367 case PCS1900: |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
368 case GSM850: |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
369 return (radio_freq); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
370 //omaps00090550 break; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
371 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
372 case DUAL: |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
373 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
374 if (radio_freq < l1_config.std.first_radio_freq_band2) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
375 // GSM band... |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 return(radio_freq); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
377 else |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
378 // DCS band... |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
379 return (radio_freq - l1_config.std.first_radio_freq_band2 + 512); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
380 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
381 //omaps00090550 break; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
382 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
383 case DUALEXT: |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
384 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
385 if (radio_freq < l1_config.std.first_radio_freq_band2) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
386 // E-GSM band... |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
387 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
388 if(radio_freq <= 124) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
389 // GSM part... |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
390 return(radio_freq); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
391 if(radio_freq < 174) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
392 // Extended part... |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
393 return (radio_freq - 125 + 975); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
394 else |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
395 // Extended part, special case of ARFCN=0 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
396 return(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
397 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
398 else |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
399 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
400 // DCS band... |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
401 return (radio_freq - l1_config.std.first_radio_freq_band2 + 512); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
402 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
403 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
404 // break; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
405 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
406 case GSM_E: |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
407 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
408 if(radio_freq <= 124) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
409 // GSM part... |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
410 return(radio_freq); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
411 else |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
412 if(radio_freq < 174) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
413 // Extended part... |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
414 return (radio_freq - 125 + 975); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
415 else |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
416 // Extended part, special case of ARFCN=0 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
417 return(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
418 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
419 //omaps00090550 break; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
420 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
421 case DUAL_US: |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
422 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
423 if (radio_freq < l1_config.std.first_radio_freq_band2) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
424 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
425 return(radio_freq - l1_config.std.first_radio_freq + 128); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
426 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
427 else |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
428 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
429 // PCS band... |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
430 return (radio_freq - l1_config.std.first_radio_freq_band2 + 512); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
431 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
432 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
433 // break; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
434 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
435 default: // should never occur. |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
436 return(radio_freq); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
437 } // end of switch |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
438 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
439 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
440 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
441 /* rf_init */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
442 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
443 /* Initialization routine for PLL */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
444 /* Effective downloading through TSP */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
445 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
446 /* Rita and LoCosto versions look totally */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
447 /* different, reconstructing from disasm. */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
448 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
449 WORD32 rf_init(WORD32 t) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
450 { |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
451 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
452 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
453 *TP_Ptr++ = TPU_MOVE(TSP_CTRL1, 0x47); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
454 t += 5; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
455 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
456 *TP_Ptr++ = TPU_MOVE(TSP_ACT, RF_SER_OFF); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
457 t += 8; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
458 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
459 *TP_Ptr++ = TPU_MOVE(TSP_ACT, RF_SER_ON); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
460 t += 5; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
461 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
462 TSP_TO_RF(0x0012); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
463 t += 7; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
464 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
465 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
466 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
467 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
468 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
469 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
470 TSP_TO_RF(0x003A); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
471 t += 117; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
472 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
473 TSP_TO_RF(0xC003); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
474 t += 7; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
475 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
476 TSP_TO_RF(0x02FE); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
477 t += 7; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
478 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
479 TSP_TO_RF(0x401F); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
480 t += 7; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
481 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
482 TSP_TO_RF(0x043D); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
483 t += 7; |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
484 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
485 return(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
486 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
487 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
488 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
489 /* rf_init_light */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
490 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
491 /* Initialization routine for PLL */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
492 /* Effective downloading through TSP */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
493 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
494 WORD32 rf_init_light(WORD32 t) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
495 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
496 // initialization for change of multi-band configuration dependent on STD |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
497 return(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
498 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
499 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
500 UWORD8 arfcn_to_rf_index(SYS_UWORD16 arfcn) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
501 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
502 UWORD8 index; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
503 extern const T_STD_CONFIG std_config[]; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
504 index = std_config[l1_config.std.id].band[0]; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
505 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
506 if ((std_config[l1_config.std.id].band[1] != BAND_NONE) && IS_HIGH_BAND(arfcn)) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
507 index = std_config[l1_config.std.id].band[1]; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
508 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
509 return (index - 1); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
510 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
511 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
512 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
513 /* rf_program */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
514 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
515 /* Programs the RF synthesizer */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
516 /* called each frame */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
517 /* downloads NA counter value */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
518 /* t = start time in the current frame */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
519 /*------------------------------------------*/ //change 2 UWORD8 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
520 UWORD32 rf_program(UWORD32 t, SYS_UWORD16 radio_freq, UWORD32 rx) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
521 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
522 UWORD32 rfdiv; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
523 SYS_UWORD16 arfcn; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
524 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
525 rfband = Cust_is_band_high(radio_freq); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
526 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
527 arfcn = Convert_l1_radio_freq(radio_freq); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
528 #ifdef ARFCN_DEBUG |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
529 trace_arfcn(arfcn); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
530 #endif |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
531 rf_index = arfcn_to_rf_index(arfcn); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
532 |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
533 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
534 rfdiv = calc_a_b(arfcn, rx); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
535 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
536 if (rx != 1) { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
537 TSP_TO_RF(rfdiv | REG_PLL); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
538 *TP_Ptr++ = TPU_FAT(0x1274); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
539 TSP_TO_RF(0x043A | rf_chip_band); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
540 } else { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
541 TSP_TO_RF(rfdiv | REG_PLL); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
542 *TP_Ptr++ = TPU_FAT(0x12FD); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
543 TSP_TO_RF(0x023A | rf_chip_band); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
544 } |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
545 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
546 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
547 return(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
548 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
549 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
550 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
551 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
552 /* EXTERNAL FUNCTIONS CALLED BY LAYER1 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
553 /* COMMON TO L1 and TOOLKIT */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
554 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
555 /**************************************************************************/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
556 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
557 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
558 /* agc */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
559 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
560 /* Program a gain into IF amp */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
561 /* agc_value : gain in dB */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
562 /* */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
563 /* additional parameter for LNA setting */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
564 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
565 /* Rita and LoCosto versions look totally */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
566 /* different, reconstructing from disasm. */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
567 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
568 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
569 void l1dmacro_agc(SYS_UWORD16 radio_freq, WORD8 gain, UWORD8 lna_off) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
570 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
571 int agc_table_index; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
572 UWORD16 rf_data; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
573 |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
574 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
575 agc_table_index = gain - 2; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
576 if (agc_table_index < 0) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
577 agc_table_index++; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
578 agc_table_index >>= 1; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
579 if (gain >= 42) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
580 agc_table_index = 19; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
581 if (gain < 16) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
582 agc_table_index = 6; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
583 *TP_Ptr++ = TPU_FAT(0x1334); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
584 rf_data = REG_RX; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
585 if (!lna_off) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
586 rf_data |= RF_GAIN; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
587 rf_data |= AGC_TABLE[agc_table_index] << 11; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
588 rf_data |= RX_CAL_MODE; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
589 TSP_TO_RF(rf_data); |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
590 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
591 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
592 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
593 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
594 /* l1dmacro_rx_synth */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
595 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
596 /* programs RF synth for recceive */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
597 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
598 void l1dmacro_rx_synth(SYS_UWORD16 radio_freq) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
599 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
600 UWORD32 t; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
601 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
602 // Important: always use rx_synth_start_time for first TPU_AT |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
603 // Never remove below 2 lines!!! |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
604 t = l1_config.params.rx_synth_start_time; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
605 *TP_Ptr++ = TPU_FAT (t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
606 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
607 t = rf_program(t, radio_freq, 1); // direction is set to 1 for Rx |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
608 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
609 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
610 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
611 /* l1dmacro_tx_synth */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
612 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
613 /* programs RF synth for transmit */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
614 /* programs OPLL for transmit */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
615 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
616 void l1dmacro_tx_synth(SYS_UWORD16 radio_freq) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
617 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
618 UWORD32 t; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
619 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
620 // Important: always use tx_synth_start_time for first TPU_AT |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
621 // Never remove below 2 lines!!! |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
622 t = l1_config.params.tx_synth_start_time; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
623 *TP_Ptr++ = TPU_FAT (t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
624 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
625 t = rf_program(t, radio_freq, 0); // direction set to 0 for Tx |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
626 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
627 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
628 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
629 /* l1dmacro_rx_up */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
630 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
631 /* Open window for normal burst reception */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
632 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
633 /* Rita version differs from LoCosto, */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
634 /* reconstructing from disassembly. */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
635 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
636 void l1dmacro_rx_up (void) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
637 { |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
638 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
639 *TP_Ptr++ = TPU_FAT(0x1377); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
640 TSP_TO_RF(0x0A3A | rf_chip_band); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
641 *TP_Ptr++ = TPU_FAT(0x137E); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
642 TSP_TO_ABB(0x10); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
643 *TP_Ptr++ = TPU_FAT(0x1383); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
644 TSP_TO_ABB(0x18); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
645 *TP_Ptr++ = TPU_FAT(58); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
646 *TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].rx_up | RF_SER_ON); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
647 *TP_Ptr++ = TPU_FAT(62); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
648 TSP_TO_ABB(0x14); |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
649 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
650 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
651 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
652 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
653 /* l1pdmacro_rx_down */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
654 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
655 /* Close window for normal burst reception */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
656 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
657 /* Rita version differs from LoCosto, */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
658 /* reconstructing from disassembly. */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
659 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
660 void l1dmacro_rx_down (WORD32 t) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
661 { |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
662 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
663 *TP_Ptr++ = TPU_FAT(t - 37); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
664 TSP_TO_RF(0x003A); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
665 *TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].rx_down | RF_SER_ON); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
666 *TP_Ptr++ = TPU_FAT(t - 4); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
667 TSP_TO_ABB(0x00); |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
668 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
669 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
670 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
671 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
672 /* l1dmacro_tx_up */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
673 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
674 /* Open transmission window for normal burst*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
675 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
676 /* Rita version differs from LoCosto, */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
677 /* reconstructing from disassembly. */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
678 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
679 void l1dmacro_tx_up (void) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
680 { |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
681 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
682 if (l1_config.std.id == DCS1800 || |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
683 rfband == MULTI_BAND2 && |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
684 (l1_config.std.id == DUAL || l1_config.std.id == DUALEXT)) { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
685 *TP_Ptr++ = TPU_FAT(0x127E); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
686 TSP_TO_RF(0x0007); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
687 *TP_Ptr++ = TPU_FAT(0x1288); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
688 TSP_TO_RF(0xC00B); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
689 *TP_Ptr++ = TPU_FAT(0x1292); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
690 TSP_TO_RF(0x3077); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
691 } else { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
692 *TP_Ptr++ = TPU_FAT(0x127E); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
693 TSP_TO_RF(0xC003); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
694 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
695 *TP_Ptr++ = TPU_FAT(0x12C6); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
696 TSP_TO_ABB(0x80); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
697 *TP_Ptr++ = TPU_FAT(0x12E3); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
698 TSP_TO_RF(0x243A | rf_chip_band); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
699 *TP_Ptr++ = TPU_FAT(0x1302); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
700 TSP_TO_ABB(0xC0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
701 *TP_Ptr++ = TPU_FAT(0x1352); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
702 TSP_TO_ABB(0x80); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
703 *TP_Ptr++ = TPU_FAT(0x1384); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
704 TSP_TO_ABB(0xA0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
705 *TP_Ptr++ = TPU_FAT(16); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
706 *TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].tx_up | RF_SER_ON); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
707 *TP_Ptr++ = TPU_FAT(21); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
708 *TP_Ptr++ = TPU_MOVE(TSP_ACTX, 0x0F); |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
709 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
710 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
711 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
712 /*-------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
713 /* l1dmacro_tx_down */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
714 /*-------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
715 /* Close transmission window for normal burst*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
716 /*-------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
717 /* Rita version differs from LoCosto, */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
718 /* reconstructing from disassembly. */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
719 /*-------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
720 void l1dmacro_tx_down (WORD32 t, BOOL tx_flag, UWORD8 adc_active) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
721 { |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
722 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
723 if (adc_active == ACTIVE) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
724 l1dmacro_adc_read_tx(t - 44); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
725 *TP_Ptr++ = TPU_FAT(t - 4); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
726 TSP_TO_ABB(0x80); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
727 *TP_Ptr++ = TPU_FAT(t + 22); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
728 *TP_Ptr++ = TPU_MOVE(TSP_ACTX, 0x00); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
729 *TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].tx_down | RF_SER_ON); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
730 *TP_Ptr++ = TPU_FAT(t + 25); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
731 TSP_TO_RF(0x003A); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
732 *TP_Ptr++ = TPU_FAT(t + 31); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
733 TSP_TO_ABB(0x00); |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
734 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
735 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
736 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
737 /* |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
738 * l1dmacro_rx_nb |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
739 * |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
740 * Receive Normal burst |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
741 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
742 void l1dmacro_rx_nb (SYS_UWORD16 radio_freq) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
743 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
744 l1dmacro_rx_up(); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
745 l1dmacro_rx_down(STOP_RX_SNB); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
746 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
747 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
748 /* |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
749 * l1dmacro_rx_sb |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
750 * Receive Synchro burst |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
751 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
752 void l1dmacro_rx_sb (SYS_UWORD16 radio_freq) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
753 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
754 l1dmacro_rx_up(); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
755 l1dmacro_rx_down (STOP_RX_SB); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
756 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
757 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
758 /* |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
759 * l1dmacro_rx_ms |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
760 * |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
761 * Receive Power Measurement window |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
762 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
763 void l1dmacro_rx_ms (SYS_UWORD16 radio_freq) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
764 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
765 l1dmacro_rx_up(); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
766 l1dmacro_rx_down (STOP_RX_PW_1); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
767 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
768 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
769 /* |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
770 * l1dmacro_rx_fb |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
771 * |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
772 * Receive Frequency burst |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
773 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
774 void l1dmacro_rx_fb (SYS_UWORD16 radio_freq) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
775 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
776 l1dmacro_rx_up(); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
777 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
778 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
779 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
780 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
781 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
782 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
783 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
784 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
785 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
786 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
787 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
788 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
789 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
790 l1dmacro_rx_down (STOP_RX_FB); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
791 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
792 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
793 /* |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
794 * l1dmacro_rx_fb26 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
795 * |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
796 * Receive Frequency burst for TCH. |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
797 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
798 void l1dmacro_rx_fb26 (SYS_UWORD16 radio_freq) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
799 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
800 l1dmacro_rx_up(); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
801 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
802 *TP_Ptr++ = TPU_AT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
803 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
804 l1dmacro_rx_down (STOP_RX_FB26); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
805 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
806 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
807 /* |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
808 * l1dmacro_tx_nb |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
809 * |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
810 * Transmit Normal burst |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
811 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
812 void l1dmacro_tx_nb (SYS_UWORD16 radio_freq, UWORD8 txpwr, UWORD8 adc_active) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
813 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
814 l1dmacro_tx_up (); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
815 l1dmacro_tx_down (l1_config.params.tx_nb_duration, FALSE, adc_active); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
816 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
817 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
818 /* |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
819 * l1dmacro_tx_ra |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
820 * |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
821 * Transmit Random Access burst |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
822 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
823 void l1dmacro_tx_ra (SYS_UWORD16 radio_freq, UWORD8 txpwr, UWORD8 adc_active) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
824 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
825 l1dmacro_tx_up (); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
826 l1dmacro_tx_down (l1_config.params.tx_ra_duration, FALSE, adc_active); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
827 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
828 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
829 #if TESTMODE |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
830 /* |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
831 * l1dmacro_rx_cont |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
832 * |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
833 * Receive continuously |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
834 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
835 void l1dmacro_rx_cont (SYS_UWORD16 radio_freq, UWORD8 txpwr) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
836 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
837 l1dmacro_rx_up (); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
838 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
839 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
840 /* |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
841 * l1dmacro_tx_cont |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
842 * |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
843 * Transmit continuously |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
844 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
845 void l1dmacro_tx_cont (SYS_UWORD16 radio_freq, UWORD8 txpwr) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
846 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
847 l1dmacro_tx_up (); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
848 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
849 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
850 /* |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
851 * l1d_macro_stop_cont |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
852 * |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
853 * Stop continuous Tx or Rx |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
854 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
855 void l1dmacro_stop_cont (void) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
856 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
857 if (l1_config.tmode.rf_params.down_up == TMODE_DOWNLINK) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
858 l1dmacro_rx_down(STOP_RX_SNB); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
859 else |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
860 l1dmacro_tx_down(l1_config.params.tx_nb_duration, FALSE, 0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
861 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
862 #endif /* TESTMODE */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
863 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
864 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
865 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
866 /* l1dmacro_reset_hw */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
867 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
868 /* Reset and set OFFSET register */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
869 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
870 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
871 void l1dmacro_reset_hw(UWORD32 servingCellOffset) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
872 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
873 TPU_Reset(1); // reset TPU only, no TSP reset |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
874 TPU_Reset(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
875 TP_Ptr = (UWORD16 *) TPU_RAM; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
876 |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
877 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
878 *TP_Ptr++ = TPU_MOVE(TSP_ACT, RF_SER_ON); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
879 *TP_Ptr++ = TPU_MOVE(TSP_ACT, RF_SER_ON | FEM_OFF); |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
880 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
881 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
882 *TP_Ptr++ = TPU_OFFSET(servingCellOffset); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
883 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
884 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
885 // l1dmacro_RF_sleep |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
886 // Program RF for BIG or DEEP sleep |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
887 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
888 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
889 /* Rita version differs from LoCosto, reconstructing from disassembly */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
890 void l1dmacro_RF_sleep (void) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
891 { |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
892 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
893 TSP_TO_RF(0x0002); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
894 *TP_Ptr++ = TPU_MOVE(TSP_ACT, RF_SER_ON); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
895 *TP_Ptr++ = TPU_WAIT(1); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
896 *TP_Ptr++ = TPU_MOVE(TSP_SPI_SET1, 0x21); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
897 *TP_Ptr++ = TPU_MOVE(TSP_SPI_SET2, 0x02); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
898 *TP_Ptr++ = TPU_MOVE(TSP_CTRL1, TC1_DEVICE_RF | 0x01); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
899 *TP_Ptr++ = TPU_MOVE(TSP_CTRL2, TC2_WR); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
900 *TP_Ptr++ = TPU_WAIT(100); |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
901 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
902 /* code from tpudrv61.c follows, same for Rita and LoCosto */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
903 *TP_Ptr++ = TPU_SLEEP; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
904 TP_Ptr = (SYS_UWORD16 *) TPU_RAM; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
905 TP_Enable(1); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
906 #if 0 /* present in LoCosto but not in TCS211 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
907 TPU_wait_idle(); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
908 #endif |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
909 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
910 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
911 // l1dmacro_RF_wakeup |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
912 //* wakeup RF from BIG or DEEP sleep |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
913 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
914 /* Rita version differs from LoCosto, reconstructing from disassembly */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
915 void l1dmacro_RF_wakeup (void) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
916 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
917 TP_Ptr = (SYS_UWORD16 *) TPU_RAM; |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
918 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
919 *TP_Ptr++ = TPU_MOVE(TSP_SPI_SET1, 0x01); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
920 *TP_Ptr++ = TPU_MOVE(TSP_SPI_SET2, 0x06); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
921 *TP_Ptr++ = TPU_MOVE(TSP_CTRL1, TC1_DEVICE_RF | 0x01); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
922 *TP_Ptr++ = TPU_MOVE(TSP_CTRL2, TC2_WR); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
923 *TP_Ptr++ = TPU_WAIT(100); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
924 *TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].rx_down | RF_SER_ON); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
925 *TP_Ptr++ = TPU_WAIT(1); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
926 *TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].rx_down | RF_SER_OFF); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
927 *TP_Ptr++ = TPU_WAIT(8); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
928 *TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].rx_down | RF_SER_ON); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
929 *TP_Ptr++ = TPU_WAIT(5); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
930 TSP_TO_RF(0x0012); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
931 *TP_Ptr++ = TPU_FAT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
932 *TP_Ptr++ = TPU_FAT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
933 *TP_Ptr++ = TPU_FAT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
934 *TP_Ptr++ = TPU_FAT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
935 *TP_Ptr++ = TPU_FAT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
936 *TP_Ptr++ = TPU_FAT(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
937 TSP_TO_RF(0x003A); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
938 *TP_Ptr++ = TPU_WAIT(7); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
939 TSP_TO_RF(0xC003); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
940 *TP_Ptr++ = TPU_WAIT(7); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
941 TSP_TO_RF(0x02FE); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
942 *TP_Ptr++ = TPU_WAIT(7); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
943 TSP_TO_RF(0x401F); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
944 *TP_Ptr++ = TPU_WAIT(7); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
945 TSP_TO_RF(0x043D); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
946 *TP_Ptr++ = TPU_WAIT(7); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
947 *TP_Ptr++ = TPU_WAIT(117); |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
948 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
949 /* code from tpudrv61.c follows, same for Rita and LoCosto */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
950 *TP_Ptr++ = TPU_SLEEP; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
951 TP_Ptr = (SYS_UWORD16 *) TPU_RAM; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
952 TP_Enable(1); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
953 #if 0 /* present in LoCosto but not in TCS211 */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
954 TPU_wait_idle(); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
955 #endif |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
956 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
957 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
958 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
959 // l1dmacro_init_hw |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
960 // Reset VEGA, then remove reset |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
961 // Init RF/IF synthesizers |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
962 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
963 void l1dmacro_init_hw(void) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
964 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
965 WORD32 t = 100; // start time for actions |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
966 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
967 TP_Reset(1); // reset TPU and TSP |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
968 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
969 // GSM 1.5 : TPU clock enable is in TPU |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
970 //--------------------------------------- |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
971 TPU_ClkEnable(1); // TPU CLOCK ON |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
972 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
973 TP_Reset(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
974 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
975 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
976 TP_Ptr = (UWORD16 *) TPU_RAM; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
977 |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
978 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
979 // Set FEM to inactive state before turning ON the RF Board |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
980 // At this point the RF regulators are still OFF. Thus the |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
981 // FEM command is not inverted yet => Must use the FEM "SLEEP programming" |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
982 *TP_Ptr++ = TPU_MOVE(TSP_ACT, FEM_SLEEP | RF_SER_ON); |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
983 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
984 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
985 // TPU_SLEEP |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
986 l1dmacro_idle(); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
987 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
988 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
989 *TP_Ptr++ = TPU_SYNC(0); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
990 |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
991 #if 0 |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
992 /* from disassembly, differs from LoCosto version */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
993 *TP_Ptr++ = TPU_MOVE(TSP_SPI_SET1, 0x20); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
994 *TP_Ptr++ = TPU_MOVE(TSP_SPI_SET2, 0x06); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
995 *TP_Ptr++ = TPU_MOVE(TSP_SPI_SET3, 0x00); |
406
d926a8986755
tpudrv10.c placeholder: all meat disabled in order to compile
Mychaela Falconia <falcon@freecalypso.org>
parents:
404
diff
changeset
|
996 #endif |
69
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
997 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
998 t = 1000; // arbitrary start time |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
999 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1000 t = rf_init(t); // Initialize RF Board |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1001 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1002 *TP_Ptr++ = TPU_AT(t); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1003 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1004 // TPU_SLEEP |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1005 l1dmacro_idle(); |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1006 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1007 return; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1008 } |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1009 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1010 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1011 /* l1dmacro_init_hw_light */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1012 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1013 /* Reset VEGA, then remove reset */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1014 /* Init RF/IF synthesizers */ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1015 /*------------------------------------------*/ |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1016 void l1dmacro_init_hw_light(void) |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1017 { |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1018 UWORD32 t = 100; // start time for actions // |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1019 TP_Ptr = (SYS_UWORD16 *) TPU_RAM; // |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1020 *TP_Ptr++ = TPU_AT(t); // |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1021 t = 1000; // arbitrary start time // |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1022 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1023 t = rf_init_light(t); // Initialize RF Board // |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1024 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1025 *TP_Ptr++ = TPU_AT(t); // |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1026 l1dmacro_idle(); // |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1027 |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1028 return; |
50a15a54801e
src/cs/layer1: import from tcs211-l1-reconst project
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1029 } |