FreeCalypso > hg > fc-magnetite
annotate src/cs/layer1/tm_cust0/l1tm_tpu12.c @ 632:d968a3216ba0
new tangomdm build target
TCS211/Magnetite built for target leonardo runs just fine on the Tango-based
Caramel board, but a more proper tangomdm build target is preferable in order
to better market these Tango modems to prospective commercial customers. The
only differences are in GPIO and MCSI config:
* MCSI is enabled in the tangomdm build config.
* GPIO 1 is loudspeaker amplifier control on Leonardo, but on Tango platforms
it can be used for anything. On Caramel boards this GPIO should be
configured as an output driving high.
* GPIO 2 needs to be configured as Calypso input on Leonardo, but on Tango
platforms it can be used for anything. On Caramel boards this GPIO should be
configured as an output, either high or low is OK.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 04 Jan 2020 19:27:41 +0000 |
parents | b870b6a44d31 |
children |
rev | line source |
---|---|
234
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /************* Revision Controle System Header ************* |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * GSM Layer 1 software |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * L1TM_TPU2.C |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * Filename %M% |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * Version %I% |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * Date %G% |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 * |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 ************* Revision Controle System Header *************/ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include "l1_confg.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #if (TESTMODE && (RF==12)) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #include "tm_defs.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "l1_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #include "l1_types.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #include "l1tm_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 #include "l1tm_cust.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 #include "l1tm_tpu12.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 #if (AUDIO_TASK == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "l1audio_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "l1audio_cust.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #include "l1audio_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 ////////////////////////////henry |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #if (L1_GTT == 1) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 #include "l1gtt_const.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 #include "l1gtt_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 /////////////////////////// |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #include "l1_defty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #include "l1_msgty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 #include "l1_tabs.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #include "l1tm_msgty.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #include "l1tm_varex.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2)) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 #include "spi_drv.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 #endif |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 #include "tpudrv12.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 #include "l1_rf12.h" |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 #include <string.h> |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 // Import band configuration from Flash module (need to replace by an access function) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 // External function prototypes |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 void Cust_tm_tpu_table_write (T_TM_RETURN *tm_return, WORD8 index, UWORD8 size, UWORD8 table[]) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 /* |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 INDICES BETWEEN in [0..63] RANGE ARE RESERVED FOR TI RF MODULE |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 // fill in the cid |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 tm_return->cid = TPU_TABLE_WRITE; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 switch (index) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 default: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 tm_return->size = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 tm_return->status = E_BADINDEX; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 } // end of switch |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 void Cust_tm_tpu_table_read (T_TM_RETURN *tm_return, WORD8 index) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 /* |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 INDICES BETWEEN in [0..63] RANGE ARE RESERVED FOR TI RF MODULE |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 */ |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 // fill in the cid |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 tm_return->cid = TPU_TABLE_READ; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 switch (index) |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 { |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 default: |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 tm_return->size = 0; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 tm_return->status = E_BADINDEX; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 break; |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 } // end of switch |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 } |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 |
b870b6a44d31
l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 #endif //TESTMODE |