FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/g23m-glue/cst/cst_csf.c @ 974:3f67d5bf96ef
doc: TFC139-breakin written, Compal-unlock updated
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Sun, 15 Nov 2015 03:47:19 +0000 |
parents | 55b3de755b7a |
children |
rev | line source |
---|---|
832
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 +-------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 | PROJECT: GSM-F&D (8411) $Workfile:: cst_csf.c $| |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 | $Author:: Be $ CONDAT GmbH $Revision:: 7 $| |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 | CREATED: 01.02.99 $Modtime:: 1.12.99 13:16 $| |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 | STATE : code | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 MODULE : CST_CSF |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 PURPOSE : This Modul defines the custom specific functionalitys |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 for the entity CST. |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 #ifndef CST_CSF_C |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 #define CST_CSF_C |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 #endif |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 |
844
55b3de755b7a
starting to compile cst
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
832
diff
changeset
|
20 #include "config.h" |
55b3de755b7a
starting to compile cst
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
832
diff
changeset
|
21 #include "fixedconf.h" |
55b3de755b7a
starting to compile cst
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
832
diff
changeset
|
22 #include "condat-features.h" |
832
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 #define ENTITY_CST |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 /*==== INCLUDES ===================================================*/ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 #include <string.h> |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 #include "typedefs.h" |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 #include "vsi.h" |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 #include "gsm.h" |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 #include "p_cst.h" |
844
55b3de755b7a
starting to compile cst
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
832
diff
changeset
|
33 #include "cst.h" |
832
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 /*==== CONSTANTS ==================================================*/ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 /*==== TYPES ======================================================*/ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 /*==== EXPORT =====================================================*/ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 /*==== VARIABLES ==================================================*/ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 LOCAL USHORT ADC_CONVERSIONS[9]; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 /*==== FUNCTIONS ==================================================*/ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 #ifdef ALR |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 extern void madc_hex_2_physical (USHORT *adc_hex, USHORT *adc_phy); |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 #endif |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 #if (BOARD==34) |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 extern inline unsigned char GC_GetAdcInfo(void); |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 #endif |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 /* |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 | PROJECT : XXX MODULE : CST_CSF | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 | STATE : code ROUTINE : csf_adc_start | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 PURPOSE : This function sends a primitive to L1A to activate the ADC */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 GLOBAL void csf_adc_start (UBYTE tx_flag, UBYTE traffic_period, UBYTE idle_period) |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 { |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 // This structure and the #define have to be implemented in the MMI. |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 // This is a temporary location for test !!!!!!! |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 // TO BE REMOVED BY USER |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 typedef struct |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 { |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 UBYTE tx_flag; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 UBYTE traffic_period; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 UBYTE idle_period; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 } |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
76 T_MMI_ADC_REQ; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 #define MMI_ADC_REQ (111) |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 PALLOC(adc_req, MMI_ADC_REQ); |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 adc_req->tx_flag = tx_flag; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 adc_req->traffic_period = traffic_period; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 adc_req->idle_period = idle_period; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 PSENDX (L1, adc_req); |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 } |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 /* |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 | PROJECT : XXX MODULE : CST_CSF | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 | STATE : code ROUTINE : csf_adc_process | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 PURPOSE : This function processes ADC results. It stores 10 consecutive |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 results in an array. |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 GLOBAL void csf_adc_process (T_CST_ADC_IND *adc_results) |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 { |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 #ifdef ALR |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 volatile USHORT adc_converted[9]; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 #endif |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 #ifdef ALR |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 /* convert adc value into physical values */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 madc_hex_2_physical (adc_results->adc_values, (USHORT*) adc_converted); |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 ADC_CONVERSIONS[0] = adc_converted[0]; /* Battery Voltage */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 ADC_CONVERSIONS[1] = adc_converted[1]; /* Charger Voltage */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 ADC_CONVERSIONS[2] = adc_converted[2]; /* I Charger */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 ADC_CONVERSIONS[3] = adc_converted[3]; /* I Charger */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 ADC_CONVERSIONS[4] = adc_converted[4]; /* Battery Type */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 ADC_CONVERSIONS[5] = adc_converted[5]; /* Battery Temperature */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 ADC_CONVERSIONS[6] = adc_converted[6]; /* RF temperature */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 ADC_CONVERSIONS[7] = adc_converted[7]; /* Touch Screen X */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 ADC_CONVERSIONS[8] = adc_converted[8]; /* Touch Screen Y */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 #else |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 ADC_CONVERSIONS[0] = adc_results->adc_values[0]; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 ADC_CONVERSIONS[1] = adc_results->adc_values[1]; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 ADC_CONVERSIONS[2] = adc_results->adc_values[2]; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
126 ADC_CONVERSIONS[3] = adc_results->adc_values[3]; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 ADC_CONVERSIONS[4] = adc_results->adc_values[4]; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 #endif |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 // WCS Patch :Avenger 2 uses adc index 5 to store battery informations bit field |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 #if (BOARD == 34) |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 ADC_CONVERSIONS[5] = GC_GetAdcInfo(); |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 #endif |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 PFREE (adc_results); |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 } |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 /* |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 | PROJECT : XXX MODULE : CST_CSF | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 | STATE : code ROUTINE : csf_aec_enable | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
144 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
145 PURPOSE : This function sends a primitive to L1A to activate the AEC */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
146 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
147 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
148 GLOBAL void csf_aec_enable (USHORT aec_ctrl_reg) |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
149 { |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
150 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
151 // This structure and the #define have to be implemented in the MMI. |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
152 // This is a temporary location for test !!!!!!! |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
153 // TO BE REMOVED BY USER |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
154 typedef struct |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
155 { |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
156 USHORT aec_control; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
157 } |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
158 T_MMI_AEC_REQ; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
159 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
160 #define MMI_AEC_REQ ( ( ( 0x18 ) << 8 ) | 40 ) |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
161 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
162 PALLOC(aec_req, MMI_AEC_REQ); |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
163 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
164 aec_req->aec_control = aec_ctrl_reg; |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
165 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
166 PSENDX (L1, aec_req); |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
167 } |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
168 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
169 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
170 /* |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
171 Returns the ADC conversions results array |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
172 */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
173 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
174 GLOBAL USHORT * csf_return_adc (void) |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
175 { |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
176 return &(ADC_CONVERSIONS[0]); |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
177 } |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
178 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
179 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
180 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
181 #ifdef ALR |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
182 /* |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
183 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
184 | PROJECT : GSM-PS (8403) MODULE : CST_CSF | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
185 | STATE : code ROUTINE : csf_vm_record | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
186 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
187 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
188 PURPOSE : activate the Voice Memo recording process for a ten seconds duration |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
189 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
190 */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
191 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
192 GLOBAL void csf_vm_record (CHAR *output, UBYTE vm_flash_index) |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
193 { |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
194 // Dummy function |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
195 } |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
196 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
197 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
198 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
199 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
200 /* |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
201 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
202 | PROJECT : GSM-PS (8403) MODULE : CST_CSF | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
203 | STATE : code ROUTINE : csf_vm_play | |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
204 +--------------------------------------------------------------------+ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
205 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
206 PURPOSE : activate the Voice Memo playing process |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
207 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
208 */ |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
209 |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
210 GLOBAL void csf_vm_play (CHAR *output, UBYTE vm_flash_index) |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
211 { |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
212 // Dummy function |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
213 } |
c14bc60c6c30
gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
214 #endif |