#include <MCUInterface.h>
|
| | MCUInterface (CANBufferType *msg_output_queue, const MainECUHardwareReadPins &pins) |
| |
| | MCUInterface (CANBufferType *msg_output_queue) |
| |
| void | init () |
| |
| void | read_mcu_status () |
| |
| void | set_brake_light (bool brake_pedal_is_active) |
| |
| void | enable_inverters_pin () |
| |
| void | disable_inverters_pin () |
| |
| bool | bms_ok_is_high () |
| |
| bool | imd_ok_is_high () |
| |
| bool | brb_ok_is_high () |
| |
| bool | get_bots_ok () |
| |
| void | update_mcu_status_CAN_fsm (int fsm_state) |
| |
| void | update_mcu_status_CAN_drivetrain (bool has_error) |
| |
| void | update_mcu_status_CAN_safety (bool is_ok) |
| |
| void | update_mcu_status_CAN_TCMux (int drive_mode, int torque_mode, float max_torque) |
| |
| void | update_mcu_status_CAN_buzzer (bool is_on) |
| |
| void | update_mcu_status_CAN_pedals (const PedalsSystemData_s &pedals) |
| |
| void | update_mcu_status_CAN_ams (bool is_critical) |
| |
| void | update_mcu_status_CAN_dashboard (bool is_active) |
| |
| void | update_brake_pressure_CAN () |
| |
| void | enqueue_CAN_mcu_status () |
| |
| void | tick (int fsm_state, bool inv_has_error, bool software_is_ok, const TorqueControllerMuxStatus &tc_mux_status, bool buzzer_is_on, const PedalsSystemData_s &pedals_data, bool pack_charge_is_critical, bool button_is_pressed) |
| |
| | MCUInterface () |
| |
| void | enable_inverters_pin () |
| |
| void | disable_inverters_pin () |
| |
Definition at line 47 of file MCUInterface.h.
◆ MCUInterface() [1/3]
Definition at line 81 of file MCUInterface.h.
81 :
82
MainECUHardwareReadPins pins_
CANBufferType * msg_queue_
◆ MCUInterface() [2/3]
◆ MCUInterface() [3/3]
| MCUInterface::MCUInterface |
( |
| ) |
|
|
inline |
◆ bms_ok_is_high()
| bool MCUInterface::bms_ok_is_high |
( |
| ) |
|
◆ brb_ok_is_high()
| bool MCUInterface::brb_ok_is_high |
( |
| ) |
|
◆ disable_inverters_pin() [1/2]
| void MCUInterface::disable_inverters_pin |
( |
| ) |
|
◆ disable_inverters_pin() [2/2]
| void MCUInterface::disable_inverters_pin |
( |
| ) |
|
|
inline |
◆ enable_inverters_pin() [1/2]
| void MCUInterface::enable_inverters_pin |
( |
| ) |
|
◆ enable_inverters_pin() [2/2]
| void MCUInterface::enable_inverters_pin |
( |
| ) |
|
|
inline |
◆ enqueue_CAN_mcu_status()
| void MCUInterface::enqueue_CAN_mcu_status |
( |
| ) |
|
Definition at line 96 of file MCUInterface.cpp.
97{
99
101
102 uint8_t buf[sizeof(CAN_message_t)] = {};
103 memmove(buf, &
msg,
sizeof(CAN_message_t));
104 msg_queue_->push_back(buf,
sizeof(CAN_message_t));
105}
◆ get_bots_ok()
| bool MCUInterface::get_bots_ok |
( |
| ) |
|
◆ imd_ok_is_high()
| bool MCUInterface::imd_ok_is_high |
( |
| ) |
|
◆ init()
| void MCUInterface::init |
( |
| ) |
|
◆ measure_shutdown_circuit_input()
| void MCUInterface::measure_shutdown_circuit_input |
( |
| ) |
|
|
private |
Definition at line 31 of file MCUInterface.cpp.
32{
33
36
40
41}
const int DEFAULT_BMS_SENSE_PIN
const int DEFAULT_IMD_SENSE_PIN
◆ measure_shutdown_circuit_voltage()
| void MCUInterface::measure_shutdown_circuit_voltage |
( |
| ) |
|
|
private |
Definition at line 44 of file MCUInterface.cpp.
45{
46
52}
bool shutdown_e_above_threshold
bool shutdown_d_above_threshold
bool shutdown_g_above_threshold
bool shutdown_c_above_threshold
◆ read_mcu_status()
| void MCUInterface::read_mcu_status |
( |
| ) |
|
Definition at line 23 of file MCUInterface.cpp.
24{
25
28}
void measure_shutdown_circuit_input()
void measure_shutdown_circuit_voltage()
◆ set_brake_light()
| void MCUInterface::set_brake_light |
( |
bool |
brake_pedal_is_active | ) |
|
◆ tick()
| void MCUInterface::tick |
( |
int |
fsm_state, |
|
|
bool |
inv_has_error, |
|
|
bool |
software_is_ok, |
|
|
const TorqueControllerMuxStatus & |
tc_mux_status, |
|
|
bool |
buzzer_is_on, |
|
|
const PedalsSystemData_s & |
pedals_data, |
|
|
bool |
pack_charge_is_critical, |
|
|
bool |
button_is_pressed |
|
) |
| |
Definition at line 199 of file MCUInterface.cpp.
208{
209
211
214
218
222
226
228
231}
void update_mcu_status_CAN_pedals(const PedalsSystemData_s &pedals)
void update_mcu_status_CAN_drivetrain(bool has_error)
void update_mcu_status_CAN_fsm(int fsm_state)
void enqueue_CAN_mcu_status()
void update_mcu_status_CAN_buzzer(bool is_on)
void update_mcu_status_CAN_ams(bool is_critical)
void update_brake_pressure_CAN()
void set_brake_light(bool brake_pedal_is_active)
void update_mcu_status_CAN_TCMux(int drive_mode, int torque_mode, float max_torque)
void update_mcu_status_CAN_safety(bool is_ok)
void update_mcu_status_CAN()
void update_mcu_status_CAN_dashboard(bool is_active)
TorqueLimit_e active_torque_limit_enum
float active_torque_limit_value
ControllerMode_e active_controller_mode
◆ update_brake_pressure_CAN()
| void MCUInterface::update_brake_pressure_CAN |
( |
| ) |
|
Definition at line 185 of file MCUInterface.cpp.
186{
187 BRAKE_PRESSURE_SENSOR_t brake_sensor_msg;
189
191
192 msg.id = Pack_BRAKE_PRESSURE_SENSOR_hytech(&brake_sensor_msg,
msg.buf, &
msg.len, (uint8_t*) &
msg.flags.extended);
193
194 uint8_t buf[sizeof(CAN_message_t)] = {};
195 memmove(buf, &
msg,
sizeof(CAN_message_t));
196 msg_queue_->push_back(buf,
sizeof(CAN_message_t));
197}
int pin_brake_pressure_sensor_read
◆ update_mcu_status_CAN()
| void MCUInterface::update_mcu_status_CAN |
( |
| ) |
|
|
private |
◆ update_mcu_status_CAN_ams()
| void MCUInterface::update_mcu_status_CAN_ams |
( |
bool |
is_critical | ) |
|
◆ update_mcu_status_CAN_buzzer()
| void MCUInterface::update_mcu_status_CAN_buzzer |
( |
bool |
is_on | ) |
|
◆ update_mcu_status_CAN_dashboard()
| void MCUInterface::update_mcu_status_CAN_dashboard |
( |
bool |
is_active | ) |
|
◆ update_mcu_status_CAN_drivetrain()
| void MCUInterface::update_mcu_status_CAN_drivetrain |
( |
bool |
has_error | ) |
|
◆ update_mcu_status_CAN_fsm()
| void MCUInterface::update_mcu_status_CAN_fsm |
( |
int |
fsm_state | ) |
|
◆ update_mcu_status_CAN_pedals()
Definition at line 176 of file MCUInterface.cpp.
177{
178
180
184}
bool brakeAndAccelPressedImplausibility
◆ update_mcu_status_CAN_safety()
| void MCUInterface::update_mcu_status_CAN_safety |
( |
bool |
is_ok | ) |
|
◆ update_mcu_status_CAN_TCMux()
| void MCUInterface::update_mcu_status_CAN_TCMux |
( |
int |
drive_mode, |
|
|
int |
torque_mode, |
|
|
float |
max_torque |
|
) |
| |
◆ bms_ok_high
| bool MCUInterface::bms_ok_high |
|
private |
◆ brb_ok_high
| bool MCUInterface::brb_ok_high |
|
private |
◆ bspd_ok_high
| bool MCUInterface::bspd_ok_high |
|
private |
◆ imd_ok_high
| bool MCUInterface::imd_ok_high |
|
private |
◆ mcu_status_
| MCU_STATUS_t MCUInterface::mcu_status_ |
|
private |
◆ msg_queue_
◆ pins_
◆ shutdown_b_above_threshold
| bool MCUInterface::shutdown_b_above_threshold |
|
private |
◆ shutdown_c_above_threshold
| bool MCUInterface::shutdown_c_above_threshold |
|
private |
◆ shutdown_d_above_threshold
| bool MCUInterface::shutdown_d_above_threshold |
|
private |
◆ shutdown_e_above_threshold
| bool MCUInterface::shutdown_e_above_threshold |
|
private |
◆ shutdown_g_above_threshold
| bool MCUInterface::shutdown_g_above_threshold |
|
private |
◆ software_ok_high
| bool MCUInterface::software_ok_high |
|
private |
The documentation for this class was generated from the following files: