forked from achamaikin/CCSModuleSW30Web
Policy/executor hooks, event-driven OFF/ON state machine, and release binaries. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
1.2 KiB
C
Executable File
30 lines
1.2 KiB
C
Executable File
#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 */
|