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