2013-06-22 05:11:53 +02:00
|
|
|
/**
|
2014-02-11 18:15:43 +01:00
|
|
|
* Shell commands for coulomb counter
|
2013-06-22 05:11:53 +02:00
|
|
|
*
|
|
|
|
* Copyright (C) 2013 INRIA.
|
|
|
|
*
|
2014-07-31 19:45:27 +02:00
|
|
|
* 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.
|
2013-06-22 05:11:53 +02:00
|
|
|
*
|
|
|
|
* @ingroup shell_commands
|
|
|
|
* @{
|
|
|
|
* @file sc_ltc4150.c
|
|
|
|
* @brief provides shell commands to access ltc4150
|
|
|
|
* @author Oliver Hahm <oliver.hahm@inria.fr>
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2010-11-05 23:44:12 +01:00
|
|
|
#include <stdio.h>
|
2013-12-16 17:54:58 +01:00
|
|
|
#include "ltc4150.h"
|
2010-11-05 23:44:12 +01:00
|
|
|
|
2014-02-21 19:10:24 +01:00
|
|
|
void _get_current_handler(int argc, char **argv)
|
2013-06-22 05:11:53 +02:00
|
|
|
{
|
2014-02-21 19:10:24 +01:00
|
|
|
(void) argc;
|
|
|
|
(void) argv;
|
2013-08-08 18:34:51 +02:00
|
|
|
|
2014-02-21 19:10:24 +01:00
|
|
|
printf("Power usage: %.4f mA (%.4f mA avg/ %.4f mAh total / %i usec)\n",
|
|
|
|
ltc4150_get_current_mA(), ltc4150_get_avg_mA(), ltc4150_get_total_mAh(), ltc4150_get_interval());
|
2010-11-05 23:44:12 +01:00
|
|
|
}
|
|
|
|
|
2014-02-21 19:10:24 +01:00
|
|
|
void _reset_current_handler(int argc, char **argv)
|
2013-06-22 05:11:53 +02:00
|
|
|
{
|
2014-02-21 19:10:24 +01:00
|
|
|
(void) argc;
|
|
|
|
(void) argv;
|
2013-08-08 18:34:51 +02:00
|
|
|
|
2013-06-22 05:11:53 +02:00
|
|
|
ltc4150_start();
|
2010-11-05 23:44:12 +01:00
|
|
|
}
|