comparison src/cs/drivers/drv_app/pwr/pwr_api.h @ 145:246f4a7dd92b

src/cs/drivers/drv_app/pwr: import from MV100 source
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 09 Oct 2016 05:59:14 +0000
parents
children fb95e3f83dc5
comparison
equal deleted inserted replaced
144:fd8227e3047d 145:246f4a7dd92b
1 /*******************************************************************************
2 *
3 * pwr_api.h
4 *
5 * Purpose: This file contains definitions that can be used by any SWE
6 * for power management services.
7 *
8 * Author Candice Bazanegue (c-brille@ti.com)
9 *
10 * (C) Texas Instruments 2001
11 *
12 ******************************************************************************/
13
14 #ifndef __PWR_API_H__
15 #define __PWR_API_H__
16
17 #include "rv_general.h"
18
19 typedef T_RV_RET T_POWER_RET;
20
21 typedef enum
22 {
23 POWER_OK = 0, /* OK */
24 POWER_ERROR = -1 /* ERROR */
25 };
26
27
28 /* Define the different charging process states */
29 typedef enum
30 {
31 CHARGE_STOPPED,
32 TESTING_BATTERY,
33 CI_CHARGE_STARTED, /* constant current charge */
34 CV_CHARGE_STARTED /* constant voltage charge */
35 }T_PWR_CHARGING_STATE;
36
37
38 /* Define the different states for TIMER0 use */
39 typedef enum
40 {
41 BATTERY_TYPE_TEST,
42 BATTERY_SHORT_TEST,
43 BATTERY_OPEN_TEST,
44 BATTERY_50UA_TEMP_TEST,
45 BATTERY_10UA_TEMP_TEST,
46 BATTERY_CALIBRATION
47 }T_PWR_TIMER0_STATE;
48
49
50 typedef struct
51 {
52 BOOLEAN info_enable;
53 T_RV_RETURN return_path;
54 }T_POWER_INFO;
55
56 typedef UINT8 T_PWR_PERCENT;
57
58 typedef struct
59 {
60 T_PWR_PERCENT remain_capa_threshold;
61 T_RV_RETURN return_path;
62 }T_POWER_ALERT;
63
64 typedef enum
65 {
66 BAT_TEMP_OUTSIDE_LIMITS,
67 BAT_OPEN_TEST_FAILED,
68 BAT_SHORT_TEST_FAILED,
69 BAT_TYPE_UNKNOWN
70 } T_BAT_PROBLEM;
71
72
73
74
75 /* Prototypes */
76
77 T_POWER_RET power_info_register(BOOLEAN info_enable, T_RV_RETURN return_path);
78 T_POWER_RET power_alert_register(T_PWR_PERCENT remain_capa_threshold, T_RV_RETURN return_path);
79 T_POWER_RET power_emergency_register(T_RV_RETURN return_path);
80 T_POWER_RET power_battery_information(void);
81 void pwr_get_bat_info(void);
82
83 #endif /* __PWR_API_H__ */