root / tidsense / audio_power.h @ 166:1a6a85e8d2e7
History | View | Annotate | Download (802 Bytes)
1 | #ifndef __audio_power_h_
|
---|---|
2 | #define __audio_power_h_
|
3 | |
4 | #include <stdbool.h> |
5 | |
6 | #include "i2cmaster.h" |
7 | |
8 | #define AUDIO_POWER_DEVICE 0x30 |
9 | #define AUDIO_POWER_SIG 0xBD |
10 | |
11 | #define AUDIO_POWER_LIPO_REG 0x10 |
12 | #define AUDIO_POWER_MPPT_REG 0x20 |
13 | #define AUDIO_POWER_MPPT_STATUS_REG 0x30 |
14 | |
15 | typedef struct { |
16 | int16_t charge_capacity; |
17 | int16_t charge; |
18 | int16_t current; |
19 | int16_t voltage; |
20 | uint8_t state; |
21 | } audio_power_lipo_data_t; |
22 | |
23 | typedef struct { |
24 | uint16_t sla_voltage; |
25 | uint16_t pv_voltage; |
26 | uint16_t load_current; |
27 | uint16_t overdischarge_voltage; |
28 | uint16_t full_voltage; |
29 | uint8_t flags; |
30 | uint8_t temperature; |
31 | uint16_t charge_current; |
32 | uint16_t charge; |
33 | } audio_power_mppt_data_t; |
34 | |
35 | bool audio_power_setup(i2c_bus_t *b);
|
36 | bool audio_power_probe(void); |
37 | |
38 | #endif // __audio_power_h_ |
39 |