This commit is contained in:
hamza
2024-07-05 12:46:52 +03:00
parent 676b5bb8d1
commit f50643cc84
6 changed files with 146 additions and 39 deletions

View File

@ -46,8 +46,8 @@ struct ADBMS6830_Internal_Status {
};
typedef struct {
int16_t cellVoltages[MAXIMUM_CELL_VOLTAGES];
int16_t auxVoltages[MAXIMUM_AUX_VOLTAGES];
float cellVoltages[MAXIMUM_CELL_VOLTAGES];
float auxVoltages[MAXIMUM_AUX_VOLTAGES];
struct ADBMS6830_Internal_Status status;
uint16 internalDieTemp;

View File

@ -14,9 +14,9 @@
#define MIN_VEHICLE_SIDE_VOLTAGE 150000 // mV
// Time to wait after reaching 95% of battery voltage before exiting precharge
// Set this to 1000 in scruti to demonstrate the voltage on the multimeter
#define PRECHARGE_95_DURATION 0 // ms
#define PRECHARGE_DURATION 3000 // ms
// Time to wait for discharge
#define DISCHARGE_DURATION 5000 // ms
#define DISCHARGE_DURATION 3000 // ms
// Time to wait after there is no more error condition before exiting TS_ERROR
#define NO_ERROR_TIME 1000 // ms
// Time to wait for charger voltage before going to TS_ERROR
@ -88,6 +88,10 @@ void sm_check_battery_temperature(int8_t* id, int16_t* temp);
int16_t sm_return_cell_temperature(int id);
int16_t sm_return_cell_voltage(int id);
void sm_calibrate_powerground();
void sm_precharge_discharge_manager();
void sm_powerground_manager(int8_t percent, bool source);
void sm_handle_ams_in(const uint8 *data);
void sm_check_errors();
void sm_set_error(ErrorKind error_kind, bool is_errored);