diff src/cs/drivers/drv_app/fchg/fchg_struct.h @ 322:c4077830aeeb

FCHG implementation code started
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 04 Dec 2017 05:55:58 +0000
parents
children 8166b0afcf8c
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cs/drivers/drv_app/fchg/fchg_struct.h	Mon Dec 04 05:55:58 2017 +0000
@@ -0,0 +1,48 @@
+/*
+ * Internal structure definitions for the FCHG SWE reside here.
+ * abb_inth.c will also need to include this header in order to
+ * get our T_PWR_CTRL_BLOCK definition.
+ */
+
+#ifndef __FCHG_STRUCT_H
+#define __FCHG_STRUCT_H
+
+#include "rv/rv_general.h"
+#include "rvf/rvf_api.h"
+#include "fchg/fchg_common.h"
+
+struct charging_config {
+	UINT16	start_delay;
+	UINT16	start_thresh;
+	UINT16	restart_thresh;
+	UINT16	charge_to_mv;
+	UINT16	overvoltage;
+	UINT16	ci_current;
+	UINT16	end_current;
+	UINT16	bciconf;
+};
+
+/* from original PWR SWE */
+typedef struct {
+	UINT16		bat_voltage;
+	T_PWR_PERCENT	remain_capa;
+} T_PWR_THRESHOLDS;
+
+#define	MAX_THRESHOLDS	101
+
+typedef struct {
+	/* RiViera boilerplate */
+	T_RVF_ADDR_ID		addr_id;
+	T_RVF_MB_ID		prim_id;
+	/* configuration */
+	struct charging_config	config;
+	BOOL			config_present;
+	T_PWR_THRESHOLDS	batt_thresholds[MAX_THRESHOLDS];
+	UINT16			nb_thresholds;
+	/* state */
+	enum fchg_state		state;
+	UINT16			batt_mv;
+	T_PWR_PERCENT		curr_percent;
+} T_PWR_CTRL_BLOCK;
+
+#endif	/* include guard */