FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/g23m-glue/gdi/power.c @ 1034:405b5469abc4 default tip
top README: repository change notice
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 12 Jun 2016 19:06:34 +0000 |
parents | 5ab66dadefdd |
children |
rev | line source |
---|---|
831
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 +----------------------------------------------------------------------------- |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 | Project : GSM-PS |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 | Modul : DRV_PWR |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 +----------------------------------------------------------------------------- |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 | Copyright 2002 Texas Instruments Berlin, AG |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 | All rights reserved. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 | This file is confidential and a trade secret of Texas |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 | Instruments Berlin, AG |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 | The receipt of or possession of this file does not convey |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 | any rights to reproduce or disclose its contents or to |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 | manufacture, use, or sell anything it may describe, in |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 | whole, or in part, without the specific written consent of |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 | Texas Instruments Berlin, AG. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 +----------------------------------------------------------------------------- |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 | Purpose : This Module defines the power management device driver |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 | for the G23 protocol stack. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 | This driver is used to control all power related functions |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 | such as charger and battery control. The driver does support |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 | multiple devices and therefore no open and close functionality |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 | is supported. The driver can be configured to signal different |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 | state transitions, for example battery level has reached the |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 | "battery low" level. This is done by setting an OS signal or |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 | calling a specified call-back function. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 +----------------------------------------------------------------------------- |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 #ifndef DRV_PWR_C |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 #define DRV_PWR_C |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 #endif |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 |
839
5ab66dadefdd
gdi: power.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
831
diff
changeset
|
34 #include "config.h" |
5ab66dadefdd
gdi: power.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
831
diff
changeset
|
35 #include "fixedconf.h" |
5ab66dadefdd
gdi: power.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
831
diff
changeset
|
36 #include "condat-features.h" |
5ab66dadefdd
gdi: power.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
831
diff
changeset
|
37 |
831
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 /*==== INCLUDES ===================================================*/ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 #if defined (NEW_FRAME) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 #include <string.h> |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 #include "typedefs.h" |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 #include "gdi.h" |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 #include "pwr.h" |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 #else |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 #include <string.h> |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 #include "stddefs.h" |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 #include "gdi.h" |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 #include "pwr.h" |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 #endif |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 /*==== EXPORT =====================================================*/ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 #if defined (_TMS470_NOT_YET) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 EXTERN void BAT_Init (void (*pwr_batlevel)(UBYTE level), |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 void (*pwr_batstatus)(UBYTE status)); |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 #else |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 LOCAL void BAT_Init (void (*pwr_batlevel)(UBYTE level), |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 void (*pwr_batstatus)(UBYTE status)); |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 #endif |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 LOCAL void pwr_batlevel (UBYTE level); |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 LOCAL void pwr_batstatus (UBYTE status); |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 /*==== VARIABLES ==================================================*/ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 drv_SignalCB_Type pwr_signal_callback = NULL; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 UBYTE pwr_act_level; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 UBYTE pwr_act_status; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 pwr_DCB_Type pwr_DCB; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 pwr_Status_Type pwr_Status; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 /*==== VARIABLES ==================================================*/ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 /*==== FUNCTIONS ==================================================*/ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
76 /*==== CONSTANTS ==================================================*/ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 | PROJECT : GSM-PS (6103) MODULE : DRV_PWR | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 | STATE : code ROUTINE : pwr_Init | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 PURPOSE : The function initializes the driver´s internal data. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 The function returns DRV_OK in case of a successful |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 completition. The function returns DRV_INITIALIZED if |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 the driver has already been initialized and is ready to |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 be used or is already in use. In case of an initialization |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 failure, which means the that the driver cannot be used, |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 the function returns DRV_INITFAILURE. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 GLOBAL UBYTE pwr_Init (drv_SignalCB_Type in_SignalCBPtr) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 pwr_signal_callback = in_SignalCBPtr; /* store call-back function */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 pwr_DCB.RangeMin = 10; /* 10 Percent */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 pwr_DCB.RangeMax = 100; /* 100 Percent */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 pwr_DCB.Steps = 4; /* 4 Steps */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 pwr_Status.Status = 0; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 pwr_Status.BatteryLevel = 0; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 pwr_Status.ChargeLevel = 0; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 * Initialise TI driver with internal callback functions |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 * |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 * pwr_batlevel is called after change of battery level |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 * pwr_batstatus is called after change of external or charger |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 * unit |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 * |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 BAT_Init (pwr_batlevel, pwr_batstatus); |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 return DRV_OK; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 | PROJECT : GSM-PS (6103) MODULE : DRV_PWR | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 | STATE : code ROUTINE : pwr_Exit | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 PURPOSE : The function is used to indicate PWR that the driver |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 and its functionality isn´t needed anymore. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
126 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 GLOBAL void pwr_Exit (void) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 pwr_signal_callback = NULL; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 | PROJECT : GSM-PS (6103) MODULE : DRV_PWR | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 | STATE : code ROUTINE : pwr_SetSignal | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 PURPOSE : This function is used to define a single signal or multiple |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 signals that is/are indicated to the process when the event |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 identified in the signal information data type as SignalType |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 occurs. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 To remove a signal, call the function pwr_ResetSignal(). |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
144 If one of the parameters of the signal information data is |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
145 invalid, the function returns DRV_INVALID_PARAMS. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
146 If no signal call-back function has been defined at the |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
147 time of initilization the driver returns DRV_SIGFCT_NOTAVAILABLE. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
148 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
149 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
150 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
151 GLOBAL UBYTE pwr_SetSignal (drv_SignalID_Type * in_SignalIDPtr) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
152 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
153 return DRV_OK; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
154 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
155 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
156 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
157 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
158 | PROJECT : GSM-PS (6103) MODULE : DRV_PWR | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
159 | STATE : code ROUTINE : pwr_ResetSignal | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
160 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
161 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
162 PURPOSE : The function is used to remove a single or multiple signals |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
163 that has previously been set. The signals that are removed |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
164 are identified by the Signal Information Data element called |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
165 SignalType. All other elements of the Signal Information Data |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
166 must be identical to the signal(s) that is/are to be |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
167 removed. If the SignalID provided can not be found, the |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
168 function returns DRV_INVALID_PARAMS. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
169 If no signal call-back function has beed defined at the |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
170 time of initialization, the driver returns DRV_SIGFCT_NOTAVAILABLE. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
171 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
172 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
173 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
174 GLOBAL UBYTE pwr_ResetSignal (drv_SignalID_Type * in_SignalIDPtr) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
175 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
176 return DRV_OK; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
177 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
178 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
179 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
180 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
181 | PROJECT : GSM-PS (6103) MODULE : DRV_PWR | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
182 | STATE : code ROUTINE : pwr_SetConfig | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
183 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
184 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
185 PURPOSE : This function is used to configure the driver. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
186 If any value of this configuration is out of range or |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
187 invalid in combination with any other value of the |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
188 configuration, the function returns DRV_INVALID_PARAMS. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
189 Call the pwr_GetConfig() function to retrieve the drivers |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
190 configuration. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
191 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
192 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
193 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
194 GLOBAL UBYTE pwr_SetConfig (pwr_DCB_Type * in_DCBPtr) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
195 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
196 memcpy (&pwr_DCB, in_DCBPtr, sizeof (pwr_DCB_Type)); |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
197 pwr_Status.BatteryLevel = 0; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
198 pwr_Status.ChargeLevel = 0; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
199 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
200 return DRV_OK; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
201 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
202 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
203 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
204 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
205 | PROJECT : GSM-PS (6103) MODULE : DRV_PWR | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
206 | STATE : code ROUTINE : pwr_GetConfig | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
207 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
208 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
209 PURPOSE : The function is used to retrieve the configuration of |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
210 the driver. The configuration is returned in the driver |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
211 control block to which the pointer out_DCBPtr points. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
212 If the driver is not configured, the function returns |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
213 DRV_NOTCONFIGURED. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
214 Call the pwr_SetConfig() function to configure the driver. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
215 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
216 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
217 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
218 GLOBAL UBYTE pwr_GetConfig (pwr_DCB_Type * out_DCBPtr) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
219 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
220 return DRV_OK; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
221 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
222 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
223 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
224 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
225 | PROJECT : GSM-PS (6103) MODULE : DRV_PWR | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
226 | STATE : code ROUTINE : pwr_GetStatus | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
227 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
228 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
229 PURPOSE : This function is used to retrieve the status of the driver |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
230 respectively the power unit. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
231 In case of a successful completion the driver returns |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
232 DRV_OK and the current status of the driver in the buffer |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
233 out_StatusPtr points to. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
234 In case the driver is not configured yet, it returns |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
235 DRV_NOTCONFIGURED. In this case the contents of the |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
236 buffer out_StatusPtr is invalid. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
237 In case out_StatusPtr equals NULL the driver returns |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
238 DRV_INVALID_PARAMS. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
239 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
240 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
241 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
242 GLOBAL UBYTE pwr_GetStatus (pwr_Status_Type * out_StatusPtr) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
243 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
244 if ( out_StatusPtr EQ NULL ) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
245 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
246 return DRV_INVALID_PARAMS; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
247 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
248 else |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
249 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
250 out_StatusPtr->Status = pwr_Status.Status; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
251 out_StatusPtr->BatteryLevel = pwr_Status.BatteryLevel; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
252 out_StatusPtr->ChargeLevel = pwr_Status.ChargeLevel; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
253 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
254 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
255 return DRV_OK; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
256 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
257 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
258 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
259 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
260 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
261 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
262 | PROJECT : GSM-PS (6103) MODULE : DRV_PWR | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
263 | STATE : code ROUTINE : pwr_BatLevel | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
264 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
265 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
266 PURPOSE : This function is called by the low level driver after |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
267 change of battery level. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
268 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
269 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
270 LOCAL void pwr_batlevel (UBYTE level) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
271 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
272 UBYTE calculated_level; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
273 drv_SignalID_Type signal_params; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
274 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
275 pwr_Status.ChargeLevel = level; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
276 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
277 if (level <= pwr_DCB.RangeMin) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
278 calculated_level = 0; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
279 if (level >= pwr_DCB.RangeMax) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
280 calculated_level = pwr_DCB.Steps +1; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
281 if (level > pwr_DCB.RangeMin AND |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
282 level < pwr_DCB.RangeMax) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
283 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
284 level -= pwr_DCB.RangeMin; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
285 calculated_level = ((level * pwr_DCB.Steps) / |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
286 (pwr_DCB.RangeMax - pwr_DCB.RangeMin))+1; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
287 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
288 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
289 if (calculated_level EQ pwr_Status.BatteryLevel) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
290 return; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
291 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
292 signal_params.SignalType = PWR_SIGTYPE_BATLEVEL; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
293 #if defined (NEW_FRAME) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
294 signal_params.UserData = (void*)&pwr_Status; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
295 #else |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
296 signal_params.SignalValue = 0; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
297 signal_params.UserData = (ULONG)&pwr_Status; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
298 #endif |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
299 pwr_Status.BatteryLevel = calculated_level; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
300 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
301 if (pwr_signal_callback NEQ NULL) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
302 (*pwr_signal_callback)(&signal_params); |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
303 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
304 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
305 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
306 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
307 | PROJECT : GSM-PS (6103) MODULE : DRV_PWR | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
308 | STATE : code ROUTINE : pwr_batstatus | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
309 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
310 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
311 PURPOSE : This function is called by the low level driver after |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
312 detecting a status change. |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
313 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
314 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
315 LOCAL void pwr_batstatus (UBYTE status) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
316 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
317 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
318 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
319 /******************************************************************* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
320 * * |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
321 * PART II: Simulation for Windows * |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
322 * * |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
323 *******************************************************************/ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
324 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
325 /*#if defined (WIN32)*/ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
326 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
327 * Dummies for driver calls |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
328 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
329 LOCAL void BAT_Init (void (*pwr_batlevel)(UBYTE), |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
330 void (*pwr_batstatus)(UBYTE)) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
331 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
332 } |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
333 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
334 /*#endif*/ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
335 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
336 /* |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
337 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
338 | PROJECT : GSM-PS (6103) MODULE : DRV_PWR | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
339 | STATE : code ROUTINE : pwr_PowerOffMobile | |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
340 +--------------------------------------------------------------------+ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
341 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
342 PURPOSE : This function is switching off the mobile |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
343 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
344 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
345 GLOBAL UBYTE pwr_PowerOffMobile (void) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
346 { |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
347 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
348 /* power off HW is not applicable in simulation */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
349 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
350 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
351 #if !defined (WIN32) |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
352 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
353 /* power-off the board / HW */ |
839
5ab66dadefdd
gdi: power.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
831
diff
changeset
|
354 ABB_Power_Off(); |
831
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
355 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
356 //#endif /* _TARGET_ */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
357 #endif /* _TMS470 */ |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
358 |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
359 return 1; |
549b7ac60300
gsm-fw/g23m-glue/gdi/*.c: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
360 } |