add proj
This commit is contained in:
48
B-G474E-DPOW1_Keil/Core/Inc/dcdc.h
Normal file
48
B-G474E-DPOW1_Keil/Core/Inc/dcdc.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef DCDC_H
|
||||
#define DCDC_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t vin_raw;
|
||||
uint16_t iin_raw;
|
||||
uint16_t vout_raw;
|
||||
uint32_t vin_mv;
|
||||
uint32_t iin_ma;
|
||||
uint32_t vout_mv;
|
||||
} DCDC_Measurements;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DCDC_STATE_STOPPED = 0,
|
||||
DCDC_STATE_READY,
|
||||
DCDC_STATE_RUNNING,
|
||||
DCDC_STATE_FAULT
|
||||
} DCDC_State;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DCDC_FAULT_NONE = 0,
|
||||
DCDC_FAULT_UNDERVOLTAGE,
|
||||
DCDC_FAULT_OVERVOLTAGE,
|
||||
DCDC_FAULT_OVERCURRENT,
|
||||
DCDC_FAULT_HRTIM
|
||||
} DCDC_Fault;
|
||||
|
||||
void DCDC_Init(void);
|
||||
void DCDC_Start(void);
|
||||
void DCDC_Stop(void);
|
||||
void DCDC_ControlStep(void);
|
||||
void DCDC_ReadMeasurements(DCDC_Measurements *out);
|
||||
|
||||
DCDC_State DCDC_GetState(void);
|
||||
DCDC_Fault DCDC_GetFault(void);
|
||||
bool DCDC_IsHrtimReady(void);
|
||||
uint32_t DCDC_GetDutyTicks(void);
|
||||
uint32_t DCDC_GetPeriodTicks(void);
|
||||
const char *DCDC_StateText(DCDC_State state);
|
||||
const char *DCDC_FaultText(DCDC_Fault fault);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user