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>
This commit is contained in:
raduet
2026-06-30 16:28:25 +02:00
co-authored by Cursor
parent ecf8e3d2f0
commit a583e12132
13 changed files with 7916 additions and 7128 deletions
+35
View File
@@ -0,0 +1,35 @@
#pragma once
#include <stdint.h>
#include "charger_config.h"
typedef struct {
uint16_t voltage_V;
uint16_t current_0p1A;
} PowerSetpoint_t;
typedef enum {
POWER_SETPOINT_NORMAL,
POWER_SETPOINT_FAST_DISCHARGE,
} PowerSetpointAction_t;
typedef struct {
uint8_t dc_contactor_closed;
uint8_t psu_hv_enabled;
uint16_t measured_voltage_V;
uint16_t measured_current_0p1A;
uint8_t power_delivery_active;
uint8_t enable_output;
uint8_t psu_state_connected;
uint8_t psu_cont_fault;
uint8_t psu_fault;
uint8_t fast_discharge_count;
uint32_t last_fast_discharge_ms;
uint32_t now_ms;
} PowerPathContext_t;
PowerSetpointAction_t PowerSetpoint_Decide(
const PowerSetpoint_t *applied,
const PowerSetpoint_t *next,
const PowerPathContext_t *ctx);