#pragma once
#ifndef __BATTERY_H
#define __BATTERY_H
#include "config_ADBMS6830.h"
#include "stm32h7xx_hal.h"
#include <stdint.h>
#include <stddef.h>

extern uint16_t min_voltage;
extern uint16_t max_voltage;
extern struct {uint16_t min; uint16_t max;} module_voltages[N_BMS];
extern int16_t max_temp;
extern int16_t min_temp;
extern struct {int16_t min; int16_t max;} module_temps[N_BMS];
extern float module_std_deviation[N_BMS];

extern int16_t cellTemps[N_BMS][N_CELLS];

HAL_StatusTypeDef battery_init(SPI_HandleTypeDef* hspi);
HAL_StatusTypeDef battery_update();

void print_battery_info();
void print_master_status();

#endif // __BATTERY_H