#pragma once

#include <stdint.h>

#include "power_setpoint_policy.h"

typedef enum {
	PSD_TRY_IDLE = 0,
	PSD_TRY_APPLIED_NORMAL,
	PSD_TRY_START_FAST_DISCHARGE,
} PowerSetpointTryResult_t;

void PowerSetpoint_Init(void);
void PowerSetpoint_OnCommand(uint16_t voltage_V, uint16_t current_0p1A);
void PowerSetpoint_UpdateDeliveryLatch(void);
uint8_t PowerSetpoint_HasPending(void);
uint8_t PowerSetpoint_IsBusy(void);
PowerSetpointTryResult_t PowerSetpoint_TryApply(void);
void PowerSetpoint_GetFastDischargeTarget(PowerSetpoint_t *target);
void PowerSetpoint_OnFastDischargeComplete(void);
void PowerSetpoint_OnFastDischargeAbort(void);
