#ifndef BETTERYREAD_H
#define BETTERYREAD_H 

#include "esp_err.h"

#define ADC_GET_VOLTAGE_GPIO  5
/* 分压：上拉 100k 到电池正极、下拉 10k 到 GND，采样点接 GPIO5
 * 分压系数 = (R上拉 + R下拉) / R下拉 = (100 + 10) / 10 = 11
 * 所以电压 = ADC电压 × 11
 */
#define BOARD_VOLTAGE_DIVIDER_R_TOP_KOHM     100.0f
#define BOARD_VOLTAGE_DIVIDER_R_BOTTOM_KOHM  10.0f
#define BOARD_VOLTAGE_DIVIDER_GAIN           11.0f
float board_get_voltage_v(void);
/**
 * @brief 电压采样初始化（GPIO5 ADC）
 */
esp_err_t board_adc_init(void);

#define get_voltage_v()     board_get_voltage_v()
#define get_temperature()   (0.0f)

#endif