view src/cs/drivers/drv_app/fchg/fchg_struct.h @ 331:8166b0afcf8c

FCHG: main ADC process implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 14 Dec 2017 16:22:30 +0000
parents c4077830aeeb
children 8a90038c0173
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;
	/* valid only during a charging cycle */
	UINT16			i2v_offset;
} T_PWR_CTRL_BLOCK;

#endif	/* include guard */