Handle slave status frames
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
#define CAN_ID_SLAVE_PANIC 0x009
|
||||
#define CAN_ID_AMS_STATUS 0x00A
|
||||
#define CAN_ID_AMS_IN 0x00B
|
||||
#define CAN_ID_SLAVE_STATUS 0x014
|
||||
#define CAN_ID_SLAVE_LOG 0x4F4
|
||||
#define CAN_ID_SHUNT_BASE 0x520
|
||||
#define CAN_ID_SHUNT_CURRENT 0x521
|
||||
|
||||
@ -20,7 +20,8 @@ typedef enum {
|
||||
SLAVE_ERR_OT,
|
||||
SLAVE_ERR_UT,
|
||||
SLAVE_ERR_OV,
|
||||
SLAVE_ERR_UV
|
||||
SLAVE_ERR_UV,
|
||||
SLAVE_ERR_UNKNOWN,
|
||||
} SlaveErrorKind;
|
||||
|
||||
typedef struct {
|
||||
@ -31,8 +32,10 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint8_t id;
|
||||
SlaveError error;
|
||||
uint16_t voltages[N_CELLS_SERIES];
|
||||
int16_t temperatures[N_TEMP_SENSORS];
|
||||
uint8_t soc;
|
||||
uint16_t min_voltage;
|
||||
uint16_t max_voltage;
|
||||
int16_t max_temp;
|
||||
uint32_t last_message;
|
||||
} SlaveHandle;
|
||||
|
||||
@ -44,6 +47,7 @@ void slaves_init();
|
||||
void slaves_check();
|
||||
|
||||
void slaves_handle_panic(const uint8_t *data);
|
||||
void slaves_handle_status(const uint8_t *data);
|
||||
void slaves_handle_log(const uint8_t *data);
|
||||
|
||||
#endif // INC_SLAVE_MONITORING_H
|
||||
|
||||
Reference in New Issue
Block a user