intermediate version

This commit is contained in:
2024-11-15 19:31:10 +03:00
parent 5b424697c7
commit 5ea401f34d
176 changed files with 21963 additions and 20712 deletions

0
Core/Inc/.DS_Store vendored Normal file → Executable file
View File

0
Core/Inc/adc.h Normal file → Executable file
View File

1
Core/Inc/board.h Normal file → Executable file
View File

@@ -22,6 +22,7 @@ uint8_t GBT_LockGetState();
void GBT_Lock(uint8_t state);
uint8_t SW_GetAddr();
void ADC_Select_Channel(uint32_t ch);
int16_t GBT_ReadTemp(uint8_t ch);
#endif /* SRC_BOARD_H_ */

0
Core/Inc/can.h Normal file → Executable file
View File

55
Core/Inc/charger_gbt.h Normal file → Executable file
View File

@@ -10,18 +10,18 @@
#include "main.h"
#include "connector.h"
#define GBT_CST_NO_REASON 0x0000F0F0
#define GBT_CST_CONDITION_REACHED 0x0100F0F0 // заряд завершен
#define GBT_CST_SUSPENDS_ARTIFICIALLY 0x0400F0F0
#define GBT_CST_FAULT_SUSPENSION 0x1000F0F0
#define GBT_CST_BMS_ACTIVELY_SUSPENDS 0x4000F0F0 //завершение по инициативе BMS
#define GBT_CST_CONNECTOR_OVER_TEMP 0x0001F0F0
#define GBT_CST_INT_PART_OVER_TEMP 0x0010F0F0
#define GBT_CST_CANNOT_SUPPLY_REQ_ELQ 0x0040F0F0
#define GBT_CST_SUDDENSTOP 0x0000F1F0
#define GBT_CST_OTHERFALUT 0x0000F4F0
#define GBT_CST_CURRENT_MISMATCH 0x0000F0F1
#define GBT_CST_ABNORMALVOLTAGEERROR 0x0000F0F4
#define GBT_CST_NO_REASON 0x0000F0F0 // Без причины
#define GBT_CST_CONDITION_REACHED 0x0100F0F0 // Заряд завершен
#define GBT_CST_SUSPENDS_ARTIFICIALLY 0x0400F0F0 // Искуственная остановка
#define GBT_CST_FAULT_SUSPENSION 0x1000F0F0 // Приостановка из за неисправности
#define GBT_CST_BMS_ACTIVELY_SUSPENDS 0x4000F0F0 // завершение по инициативе BMS
#define GBT_CST_CONNECTOR_OVER_TEMP 0x0001F0F0 // Перегрев коннектора
#define GBT_CST_INT_PART_OVER_TEMP 0x0010F0F0 // Перегрев внутренних частей
#define GBT_CST_CANNOT_SUPPLY_REQ_ELQ 0x0040F0F0 // Неполучится обеспечить столько энергии
#define GBT_CST_SUDDENSTOP 0x0000F1F0 // Внезапная остановка
#define GBT_CST_OTHERFALUT 0x0000F4F0 // Прочая ошибка
#define GBT_CST_CURRENT_MISMATCH 0x0000F0F1 // Неправильный ток
#define GBT_CST_ABNORMALVOLTAGEERROR 0x0000F0F4 // Ненормальное напряжение
typedef enum{
@@ -39,22 +39,28 @@ typedef enum{
// GBT_S1_CONNECTED = 0x11, //СС1 4V СС2 4V (6V)
// GBT_S2_LOCKED = 0x12, //
GBT_S3_STARTED = 0x13, // 12V AUX
GBT_S4_ISOTEST = 0x14, // testing isolation, send CHM receive BHM
GBT_S5_BAT_INFO = 0x15, // identifying BMS, send CRM receive BRM (long)
GBT_S6_BAT_STAT = 0x16, // send CRM(AA), receive BCP (long)
GBT_S7_BMS_WAIT = 0x17, // wait for BMS, send CTS+CML receive BRO(00), next BRO(AA)
GBT_S8_INIT_CHARGER = 0x18,// starting power modules, send CRO(00)
GBT_S9_WAIT_BCL = 0x19, // waiting for BCL (requested voltage), send CRO(00)
GBT_S10_CHARGING = 0x20, // charging, contactor ON, send CCS, receiving BCL+BCS+BSM
GBT_STOP = 0x21, // normal stop
GBT_STOP_CSD = 0x22, // normal stop
GBT_ERROR = 0x23, // Error
GBT_COMPLETE = 0x24,
GBT_S31_WAIT_BHM = 0x14, // testing isolation, send CHM receive BHM
GBT_S4_ISOTEST = 0x15, // testing isolation, send CHM receive BHM
GBT_S5_BAT_INFO = 0x16, // identifying BMS, send CRM receive BRM (long)
GBT_S6_BAT_STAT = 0x17, // send CRM(AA), receive BCP (long)
GBT_S7_BMS_WAIT = 0x18, // wait for BMS, send CTS+CML receive BRO(00), next BRO(AA)
GBT_S8_INIT_CHARGER = 0x19,// starting power modules, send CRO(00)
GBT_S9_WAIT_BCL = 0x20, // waiting for BCL (requested voltage), send CRO(00)
GBT_S10_CHARGING = 0x21, // charging, contactor ON, send CCS, receiving BCL+BCS+BSM
GBT_STOP = 0x22, // normal stop
GBT_STOP_CSD = 0x23, // normal stop
GBT_ERROR = 0x24, // Error
GBT_COMPLETE = 0x25,
}gbtState_t;
#pragma pack(push, 1)
typedef enum __attribute__((packed)){
GBT_ERR_OKAY = 0,
GBT_ERR_INSULATION = 1,
}GBT_Error_t;
#pragma pack(push, 1)
typedef struct {
uint16_t maxOutputVoltage;
@@ -169,6 +175,7 @@ typedef struct {
uint16_t measuredCurrent; // 0.1A/bit
CONN_Control_t chargeControl;
GBT_Error_t chargingError; // 0 if okay
}GBT_EDCAN_Input_t;

12
Core/Inc/connector.h Normal file → Executable file
View File

@@ -17,12 +17,14 @@
typedef enum __attribute__((packed)) {
CONN_Initializing = 1,
CONN_Error = 2,
CONN_Faulted = 2,
CONN_Available = 3,
CONN_Occupied_waiting = 4,// to charge
CONN_Occupied_charging = 5,
CONN_Occupied_complete = 6,//, waiting to disconnect
CONN_Preparing = 4,// to charge
CONN_Charging = 5,
CONN_Finishing = 6,//, waiting to disconnect
CONN_Suspended_EV = 7,
CONN_Suspended_EVSE = 8,
//Reserved
} CONN_State_t;
// Управление

0
Core/Inc/debug.h Normal file → Executable file
View File

0
Core/Inc/edcan_config.h Normal file → Executable file
View File

0
Core/Inc/gpio.h Normal file → Executable file
View File

0
Core/Inc/j1939.h Normal file → Executable file
View File

0
Core/Inc/lock.h Normal file → Executable file
View File

0
Core/Inc/main.h Normal file → Executable file
View File

0
Core/Inc/rtc.h Normal file → Executable file
View File

0
Core/Inc/soft_rtc.h Normal file → Executable file
View File

0
Core/Inc/stm32f1xx_hal_conf.h Normal file → Executable file
View File

0
Core/Inc/stm32f1xx_it.h Normal file → Executable file
View File

0
Core/Inc/usart.h Normal file → Executable file
View File