Add LiPo battery monitoring with ESP-NOW cache and dashboard API.
Slaves report pack voltages every 30s; the master caches them for fast BATTERY_STATUS reads. goTool exposes REST/WebSocket and shows values in the dashboard, with a nanopb fix so optional lipo submessages encode. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+14
-1
@@ -1,12 +1,25 @@
|
||||
#ifndef BOARD_INPUT_H
|
||||
#define BOARD_INPUT_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
typedef struct {
|
||||
bool lipo1_valid;
|
||||
bool lipo2_valid;
|
||||
uint32_t lipo1_mv;
|
||||
uint32_t lipo2_mv;
|
||||
} board_lipo_reading_t;
|
||||
|
||||
/**
|
||||
* Button (log on press) and LiPo ADC sampling (log every 10 s).
|
||||
* Button (log on press) and LiPo ADC sampling (background log every 10 s).
|
||||
* TODO: Pin assignments come from powerpod.h and may not match final hardware yet.
|
||||
*/
|
||||
esp_err_t board_input_init(void);
|
||||
|
||||
/** On-demand ADC read of both LiPo sense inputs (if configured). */
|
||||
void board_input_read_lipo(board_lipo_reading_t *out);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user