annotate src/cs/drivers/drv_app/fchg/fchg_struct.h @ 327:d7b25dca1266

.../drv_core/abb/abb.c: don't set backup battery bits in BCICONF
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 08 Dec 2017 03:05:19 +0000
parents c4077830aeeb
children 8166b0afcf8c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
322
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * Internal structure definitions for the FCHG SWE reside here.
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * abb_inth.c will also need to include this header in order to
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * get our T_PWR_CTRL_BLOCK definition.
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 */
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #ifndef __FCHG_STRUCT_H
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #define __FCHG_STRUCT_H
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include "rv/rv_general.h"
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #include "rvf/rvf_api.h"
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 #include "fchg/fchg_common.h"
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 struct charging_config {
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 UINT16 start_delay;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 UINT16 start_thresh;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 UINT16 restart_thresh;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 UINT16 charge_to_mv;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 UINT16 overvoltage;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 UINT16 ci_current;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 UINT16 end_current;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 UINT16 bciconf;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 };
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 /* from original PWR SWE */
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 typedef struct {
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 UINT16 bat_voltage;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 T_PWR_PERCENT remain_capa;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 } T_PWR_THRESHOLDS;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #define MAX_THRESHOLDS 101
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 typedef struct {
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 /* RiViera boilerplate */
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 T_RVF_ADDR_ID addr_id;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 T_RVF_MB_ID prim_id;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 /* configuration */
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 struct charging_config config;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 BOOL config_present;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 T_PWR_THRESHOLDS batt_thresholds[MAX_THRESHOLDS];
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 UINT16 nb_thresholds;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 /* state */
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 enum fchg_state state;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 UINT16 batt_mv;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 T_PWR_PERCENT curr_percent;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 } T_PWR_CTRL_BLOCK;
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47
c4077830aeeb FCHG implementation code started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 #endif /* include guard */