Initial commit

This commit is contained in:
Yury Shuvakin
2022-11-12 23:42:55 +03:00
parent 9a18b5d8e7
commit 190522943f
228 changed files with 141037 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
#ifndef __MODSTATEOFCHARGE_H
#define __MODSTATEOFCHARGE_H
#include "stdint.h"
#include "stdbool.h"
#include "modPowerElectronics.h"
#include "modConfig.h"
typedef struct {
float generalStateOfCharge;
float generalStateOfHealth;
float remainingCapacityAh;
float remainingCapacityWh;
} modStateOfChargeStructTypeDef;
extern float real_capacity;
extern float previous_capacity;
extern float previous_SoC;
//static float current_SoC = 0;
extern float soc_diff;
extern float capacity_diff;
extern uint8_t SoC_Save_Flag;
typedef enum {
EVENT_FULL = 0,
EVENT_EMPTY,
} modStateOfChargeVoltageEventTypeDef;
modStateOfChargeStructTypeDef* modStateOfChargeInit(modPowerElectronicsPackStateTypedef *packState, modConfigGeneralConfigStructTypedef *generalConfigPointer);
void modStateOfChargeProcess(void);
bool modStateOfChargeStoreAndLoadDefaultStateOfCharge(void);
bool modStateOfChargeStoreStateOfCharge(void);
bool modStateOfChargeLoadStateOfCharge(void);
bool modStateOfChargePowerDownSave(void);
void modStateOfChargeVoltageEvent(modStateOfChargeVoltageEventTypeDef eventType);
#endif