Files
CCSModuleSW30Web/Core/Inc/charger_config.h
T
raduetandCursor a583e12132 Add PSU fast discharge API for DC precharge step-down (v1.0.23).
Policy/executor hooks, event-driven OFF/ON state machine, and release binaries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 16:28:25 +02:00

30 lines
1.2 KiB
C
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include "main.h"
#define PSU_MAX_VOLTAGE 1000 //1V/bit
#define PSU_MIN_VOLTAGE 150 //1V/bit
#define PSU_MAX_CURRENT 133 //1A/bit
#define PSU_MIN_CURRENT 1 //1A/bit
#define PSU_MAX_POWER 40000 //1W/bit
#define PSU_NUM 1
/* Everest / стенд: запрос «500 В» на шине — реально на PSU задаются U/I ниже; статус может оставаться 500 В (serial.c). */
#define FAKE_EVREQ_VOLTAGE_V 500u
#define FAKE_PSU_VOLTAGE_V 300u
#define FAKE_PSU_CURRENT_0P1A 10u
/* Fast discharge: PSU off/on cycle on step-down setpoint (unloaded bus). */
#define PSD_ENABLE 1u
#define PSD_MAX_CMD_CURRENT_0P1A 20u /* 2.0 A */
#define PSD_MAX_MEASURED_CURRENT_0P1A 30u /* 3.0 A */
#define PSD_MEASURED_LATCH_MS 500u
#define PSD_MIN_VOLTAGE_STEP_V 50u
#define PSD_DISCHARGE_MARGIN_V 15u
#define PSD_DEBOUNCE_MS 2000u
#define PSD_MAX_PER_SESSION 4u
#define PSD_OFF_TIMEOUT_MS 10000u /* как PSU_WAIT_ACK_OFF */
#define PSD_ON_TIMEOUT_MS 10000u
#define PSD_ON_RETRY_MS 500u /* повтор SET+ON в ON_WAIT */
#define PSD_PRECHARGE_TOLERANCE_V 40u /* ~±10% for 350 V precharge window */