change directory structure, using normed naming scheme

This commit is contained in:
2024-11-22 20:32:12 +01:00
parent 4a7b54acd2
commit 105e91f36c
230 changed files with 1384054 additions and 0 deletions

View File

@ -0,0 +1,46 @@
/*
* slave_handler.h
*
* Created on: Jun 21, 2023
* Author: max
*/
#ifndef INC_SLAVE_HANDLER_H_
#define INC_SLAVE_HANDLER_H_
#include "stm32h7xx_hal.h"
#define N_SLAVES 6
typedef enum {
SLAVE_ERR_NONE,
SLAVE_ERR_TIMEOUT,
SLAVE_ERR_OT,
SLAVE_ERR_UT,
SLAVE_ERR_OV,
SLAVE_ERR_UV,
SLAVE_ERR_UNKNOWN,
} SlaveErrorKind;
typedef struct {
SlaveErrorKind kind;
uint32_t data; // Cell/temperature ID etc
} SlaveError;
typedef struct {
uint8_t id;
SlaveError error;
uint8_t soc;
uint16_t min_voltage;
uint16_t max_voltage;
int16_t max_temp;
uint32_t last_message;
} SlaveHandle;
extern SlaveHandle slaves[N_SLAVES];
float slaves_get_maximum_voltage();
void slaves_handle_status(const uint8_t *data);
void slave_handler_init();
#endif /* INC_SLAVE_HANDLER_H_ */