aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/fg/fg_math.h
blob: 45363fe7a1c4db266e5d9f4b71daefc764075513 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * linux/drivers/power/fg/fg_math.h
 *
 * TI Fuel Gauge driver for Linux
 *
 * Copyright (C) 2008-2009 Texas Instruments, Inc.
 * Author: Texas Instruments, Inc.
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#ifndef __FG_MATH_H
#define __FG_MATH_H

#include <linux/types.h>
#include "fg.h"
#include "fg_ocv.h"

#define MAX_CHAR		0x7F
#define MAX_UNSIGNED_CHAR	0xFF
#define MAX_INT			0x7FFF
#define MAX_UNSIGNED_INT	0xFFFF
#define MAX_INT8		0x7F
#define MAX_UINT8		0xFF

/* IIR Filter */
short filter(short y, short x, short a);

/* Diviation between 'size' array members */
unsigned short diff_array(short *arr, unsigned char size);

#endif