software almost finished, changed documents

This commit is contained in:
2025-03-26 19:37:58 +01:00
parent 9ca69a2494
commit 98c0abc1f6
31 changed files with 11925 additions and 12358 deletions

View File

@ -29,5 +29,6 @@ typedef struct {
void can_init(CAN_HandleTypeDef* hcan);
void can_rxupdateFrame();
void can_sendloop();
void can_error_report();
#endif /* INC_CAN_COMMUNICATION_H_ */

View File

@ -11,7 +11,7 @@
#include "stm32f3xx_hal.h"
// convert ADC quants to V
#define ADC_V_FACTOR (3.3f / 4095) // 3.3V / 12bit
#define ADC_V_FACTOR ((3.3f / 4095) * (3.3f / 3.14f)) // 3.3V / 12bit
// scale to LV by divider to mV
#define LV_SENSE_FACTOR (1e3 * (ADC_V_FACTOR * ((12.f + 1.8f) / 1.8f))) // scaled with voltage divider

View File

@ -12,6 +12,42 @@
#include "channel_control.h"
#include "can_communication.h"
typedef union {
struct {
uint8_t sdc_open : 1;
uint8_t noload_acc_cooling : 1;
uint8_t noload_ts_cooling : 1;
uint8_t noload_drs : 1;
uint8_t noload_acu : 1;
uint8_t noload_epsc : 1;
uint8_t noload_inverter : 1;
uint8_t noload_lidar : 1;
};
uint8_t group1;
} err_group1;
typedef union {
struct {
uint8_t noload_misc : 1;
uint8_t noload_alwayson : 1;
uint8_t noload_sdc : 1;
uint8_t noload_ebs1 : 1;
uint8_t noload_ebs2 : 1;
uint8_t noload_ebs3 : 1;
uint8_t power_critcal : 1;
uint8_t power_limit : 1;
};
uint8_t group2;
} err_group2;
typedef union {
struct {
err_group1 group1;
err_group2 group2;
};
uint16_t err_bitmask;
} err_states;
void check_plausibility();
#endif /* INC_PLAUSIBILITY_CHECK_H_ */