annotate gsm-fw/g23m-glue/cst/cst_csf.c @ 832:c14bc60c6c30

gsm-fw/g23m-glue/cst: import from Leonardo source
author Space Falcon <falcon@ivan.Harhan.ORG>
date Thu, 23 Apr 2015 06:45:55 +0000
parents
children 55b3de755b7a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 #include "config/swconfig.cfg"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 #include "config/board.cfg"
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
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 #define ENTITY_CST
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 /*==== INCLUDES ===================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29 #include <string.h>
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30 #include "typedefs.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
31 #include "vsi.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 #include "gsm.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 #include "p_cst.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 #include "cst/cst.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 /*==== CONSTANTS ==================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 /*==== TYPES ======================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 /*==== EXPORT =====================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 /*==== VARIABLES ==================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 LOCAL USHORT ADC_CONVERSIONS[9];
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46 /*==== FUNCTIONS ==================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
47
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
48 #ifdef ALR
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
49 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
50 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
51
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52 #if (BOARD==34)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53 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
54 #endif
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 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58 | PROJECT : XXX MODULE : CST_CSF |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59 | 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
60 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62 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
63
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 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
66 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 // 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
69 // 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
70 // TO BE REMOVED BY USER
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
71 typedef struct
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
72 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
73 UBYTE tx_flag;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
74 UBYTE traffic_period;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
75 UBYTE idle_period;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
76 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
77 T_MMI_ADC_REQ;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
78
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
79 #define MMI_ADC_REQ (111)
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
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
82 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
83
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
84 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
85 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
86 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
87
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
88 PSENDX (L1, adc_req);
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 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
95 | PROJECT : XXX MODULE : CST_CSF |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
96 | 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
97 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
98
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
99 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
100 results in an array.
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
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
104 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
105 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
106 #ifdef ALR
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
107 volatile USHORT adc_converted[9];
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
108 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
109
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
110 #ifdef ALR
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
111 /* 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
112 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
113
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 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
115 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
116 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
117 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
118 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
119 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
120 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
121 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
122 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
123 #else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 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
125 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
126 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
127 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
128 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
129 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
130
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
131 // 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
132 #if (BOARD == 34)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
133 ADC_CONVERSIONS[5] = GC_GetAdcInfo();
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
134 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
135
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
136 PFREE (adc_results);
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 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
142 | PROJECT : XXX MODULE : CST_CSF |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
143 | 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
144 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
145
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
146 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
147
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
148
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
149 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
150 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
151
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
152 // 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
153 // 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
154 // TO BE REMOVED BY USER
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
155 typedef struct
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
156 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
157 USHORT aec_control;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
158 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
159 T_MMI_AEC_REQ;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
160
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
161 #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
162
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
163 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
164
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
165 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
166
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
167 PSENDX (L1, aec_req);
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 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
172 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
173 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
174
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
175 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
176 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
177 return &(ADC_CONVERSIONS[0]);
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
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
182 #ifdef ALR
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 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
185 | 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
186 | 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
187 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
188
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
189 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
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
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
193 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
194 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
195 // Dummy function
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 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
203 | 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
204 | 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
205 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
206
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
207 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
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
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
211 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
212 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
213 // Dummy function
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
214 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
215 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
216
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
217
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
218