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>
26 lines
568 B
C
26 lines
568 B
C
#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 (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
|