#pragma once
#ifndef __CONFIG_ADBMS6830_H
#define __CONFIG_ADBMS6830_H
#include "main.h"

#define N_BMS 1
#define N_CELLS 16
#define ADBMS_MAX_CHIP_TEMP 110 // max temperature of ADBMS6830B (not battery) in C
#define ADBMS_SPI_TIMEOUT    50 // Timeout in ms
#define DEFAULT_UV 3000 // mV
#define DEFAULT_OV 4200 // mV

[[maybe_unused, gnu::always_inline]]
static inline void mcuAdbmsCSLow() {
    HAL_GPIO_WritePin(AMS_CS_GPIO_Port, AMS_CS_Pin, GPIO_PIN_RESET);
}

[[maybe_unused, gnu::always_inline]]
static inline void mcuAdbmsCSHigh() {
    HAL_GPIO_WritePin(AMS_CS_GPIO_Port, AMS_CS_Pin, GPIO_PIN_SET);
}

#endif //__CONFIG_ADBMS6830_H
