-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcounter.h
35 lines (26 loc) · 856 Bytes
/
counter.h
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
/**
* Handles accumulation of measurement values.
*/
#include <stdint.h>
/** Initialises the counter system. */
void CounterInit(void);
/** Resets the charge counter. */
void CounterChargeReset(void);
/**
* Updates the charge counter with a new current value.
* @param[in] micros the time in microseconds
* @param[in] current the actual current in amperes
*/
void CounterChargeUpdate(uint32_t timestamp, float current);
/** @return the charge counter value */
double CounterChargeGet(void);
/** Resets the energy counter. */
void CounterEnergyReset(void);
/**
* Updates the energy counter with a new power value.
* @param[in] micros the time in microseconds
* @param[in] power the actual power in Watts
*/
void CounterEnergyUpdate(uint32_t timestamp, float power);
/** @return the energy counter value */
double CounterEnergyGet(void);