1#ifndef __AMSINTERFACE_H__
2#define __AMSINTERFACE_H__
6#define CANBufferType_mock int
7#define CAN_message_t_mock int
46 void init(SysTick_s &initial_tick) {};
91 const float VOLTAGE_LOOKUP_TABLE[101] = {3.972, 3.945, 3.918, 3.891, 3.885, 3.874, 3.864, 3.858, 3.847, 3.836, 3.82, 3.815, 3.815, 3.798, 3.788,
92 3.782, 3.771, 3.755, 3.744, 3.744, 3.733, 3.728, 3.723, 3.712, 3.701, 3.695, 3.69, 3.679, 3.679, 3.668, 3.663, 3.657, 3.647,
93 3.647, 3.636, 3.625, 3.625, 3.625, 3.614, 3.609, 3.603, 3.603, 3.592, 3.592, 3.592, 3.581, 3.581, 3.571, 3.571, 3.571, 3.56,
94 3.56, 3.56, 3.549, 3.549, 3.549, 3.549, 3.538, 3.538, 3.551, 3.546, 3.535, 3.535, 3.535, 3.53, 3.524, 3.524, 3.524, 3.513,
95 3.513, 3.513, 3.503, 3.503, 3.492, 3.492, 3.492, 3.487, 3.481, 3.481, 3.476, 3.471, 3.46, 3.46, 3.449, 3.444, 3.428, 3.428,
96 3.417, 3.401, 3.39, 3.379, 3.363, 3.331, 3.299, 3.267, 3.213, 3.149, 3.041, 3, 3, 0};
this class is for interfacing with the AMS (accumulator management system)
float get_acc_derate_factor()
bool has_initialized_charge_
void enqueue_state_of_charge_CAN()
void tick(const SysTick_s &tick)
float filtered_min_cell_voltage
void set_heartbeat(unsigned long curr_millis)
void retrieve_current_shunt_CAN(const CAN_message_t_mock &can_msg)
float get_filtered_min_cell_voltage()
void retrieve_status_CAN(unsigned long curr_millis, CAN_message_t_mock &recvd_msg)
bool is_below_pack_charge_critical_total_thresh()
void init(SysTick_s &initial_tick)
AMSInterface(CANBufferType_mock *msg_output_queue, int sw_ok_pin)
void retrieve_temp_CAN(CAN_message_t_mock &recvd_msg)
unsigned long last_heartbeat_time_
bool heartbeat_received(unsigned long curr_millis)
void calculate_SoC_acu(const SysTick_s &tick)
float get_filtered_max_cell_temp()
unsigned long timestamp_start_
void set_state_ok_high(bool ok_high)
CANBufferType_mock * msg_queue_
bool is_using_em_for_soc()
bool has_received_bms_voltage_
bool is_below_pack_charge_critical_low_thresh()
AMSInterface(CANBufferType_mock *msg_output_queue, int sw_ok_pin, float init_temp, float init_volt, float temp_alpha, float volt_alpha)
void retrieve_voltage_CAN(CAN_message_t_mock &recvd_msg)
void retrieve_em_measurement_CAN(CAN_message_t_mock &can_msg)
CANBufferType * msg_queue_
float initialize_charge()
float filtered_max_cell_temp
const float VOLTAGE_LOOKUP_TABLE[101]
void set_use_em_for_soc(bool new_use_em_for_soc)
bool pack_charge_is_critical()
void calculate_acc_derate_factor()
void calculate_SoC_em(const SysTick_s &tick)
const float DEFAULT_VOLTAGE_ALPHA
const float DEFAULT_INIT_VOLTAGE
const unsigned long PACK_CHARGE_CRIT_LOWEST_CELL_THRESHOLD
const float DEFAULT_INIT_TEMP
const uint16_t MAX_PACK_CHARGE
const float DEFAULT_TEMP_ALPHA
const unsigned long PACK_CHARGE_CRIT_TOTAL_THRESHOLD
const unsigned long DEFAULT_INITIALIZATION_WAIT_INTERVAL
const unsigned long HEARTBEAT_INTERVAL
const float DEFAULT_VOLTAGE_ALPHA
const float DEFAULT_INIT_VOLTAGE
#define CAN_message_t_mock
const float DEFAULT_INIT_TEMP
const float DEFAULT_TEMP_ALPHA
const unsigned long HEARTBEAT_INTERVAL
#define CANBufferType_mock