-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathBMSModuleManager.h
41 lines (37 loc) · 1.08 KB
/
BMSModuleManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include "config.h"
#include "BMSModule.h"
#include <due_can.h>
class BMSModuleManager
{
public:
BMSModuleManager();
void balanceCells();
void setupBoards();
void findBoards();
void renumberBoardIDs();
void clearFaults();
void sleepBoards();
void wakeBoards();
void getAllVoltTemp();
void readSetpoints();
void setBatteryID();
float getPackVoltage();
float getAvgTemperature();
float getAvgCellVolt();
void processCANMsg(CAN_FRAME &frame);
void printPackSummary();
void printPackDetails();
private:
float packVolt; // All modules added together
float lowestPackVolt;
float highestPackVolt;
float lowestPackTemp;
float highestPackTemp;
BMSModule modules[MAX_MODULE_ADDR + 1]; // store data for as many modules as we've configured for.
int numFoundModules; // The number of modules that seem to exist
bool isFaulted;
void sendBatterySummary();
void sendModuleSummary(int module);
void sendCellDetails(int module, int cell);
};