view 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
line wrap: on
line source

/*
 * 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 */