2014-10-28 09:58:25 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
2015-11-19 17:13:33 +01:00
|
|
|
/**
|
|
|
|
* @defgroup drivers_ltc4150 LTC4150 Coulomb Counter
|
|
|
|
* @ingroup drivers_sensors
|
|
|
|
* @brief Device driver for LTC4150 coulomb counters
|
|
|
|
*
|
|
|
|
* @deprecated This driver should be ported to the peripheral driver interface
|
|
|
|
* (@ref drivers_periph)
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Driver interface for the LTC4150 driver
|
|
|
|
*
|
|
|
|
* @author Heiko Will <heiko.will@fu-berlin.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2015-03-23 21:06:28 +01:00
|
|
|
#ifndef LTC4150_H
|
|
|
|
#define LTC4150_H
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2013-12-16 17:54:58 +01:00
|
|
|
#include "ltc4150_arch.h"
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2014-10-13 15:49:17 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-11-19 17:13:33 +01:00
|
|
|
/**
|
|
|
|
* @brief Initialize the counter
|
|
|
|
*/
|
2013-02-06 13:20:21 +01:00
|
|
|
void ltc4150_init(void);
|
2015-11-19 17:13:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Start a measurement
|
|
|
|
*/
|
2013-02-06 13:20:21 +01:00
|
|
|
void ltc4150_start(void);
|
2015-11-19 17:13:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief End the ongoing measurement
|
|
|
|
*/
|
2013-02-06 13:20:21 +01:00
|
|
|
void ltc4150_stop(void);
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2015-11-19 17:13:33 +01:00
|
|
|
/**
|
|
|
|
* @brief Get the current electrical current
|
|
|
|
*
|
|
|
|
* @return electrical current in mA
|
|
|
|
*/
|
2013-02-06 13:20:21 +01:00
|
|
|
double ltc4150_get_current_mA(void);
|
2015-11-19 17:13:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the total power used since @p ltc4150_start was called
|
|
|
|
*
|
|
|
|
* @return power used in mAh
|
|
|
|
*/
|
2013-02-06 13:20:21 +01:00
|
|
|
double ltc4150_get_total_mAh(void);
|
2015-11-19 17:13:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the total energy used since @p ltc4150_start was called
|
|
|
|
*
|
|
|
|
* @return energy used in Joule
|
|
|
|
*/
|
2011-03-04 16:46:20 +01:00
|
|
|
double ltc4150_get_total_Joule(void);
|
2015-11-19 17:13:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the average electrical current sine @p ltc4150_start was called
|
|
|
|
*
|
|
|
|
* @return average current in mA
|
|
|
|
*/
|
2013-02-06 13:20:21 +01:00
|
|
|
double ltc4150_get_avg_mA(void);
|
2015-11-19 17:13:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the time the current measurement is going on
|
|
|
|
*
|
|
|
|
* @return time
|
|
|
|
*/
|
2013-02-06 13:20:21 +01:00
|
|
|
int ltc4150_get_interval(void);
|
2015-11-19 17:13:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the number of samples taken
|
|
|
|
*
|
|
|
|
* @return number of samples in the current interval
|
|
|
|
*/
|
2011-01-31 18:25:20 +01:00
|
|
|
long ltc4150_get_intcount(void);
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2014-10-13 15:49:17 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-03-23 21:06:28 +01:00
|
|
|
#endif /* LTC4150_H */
|
2015-11-19 17:13:33 +01:00
|
|
|
/** @} */
|