pdu/Software/Code/Core/Inc/plausibility_check.h

54 lines
999 B
C

/*
* plausibility_check.h
*
* Created on: Mar 18, 2025
* Author: janek
*/
#ifndef INC_PLAUSIBILITY_CHECK_H_
#define INC_PLAUSIBILITY_CHECK_H_
#include "current_monitoring.h"
#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_ */