initial check in based on SVN revision 575
This commit is contained in:
64
source/pwr_level.h
Normal file
64
source/pwr_level.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* pwr_level.h
|
||||
*
|
||||
* Created on: Jun 30, 2022
|
||||
* Author: Keith.Lloyd
|
||||
*/
|
||||
|
||||
#ifndef PWR_LEVEL_H_
|
||||
#define PWR_LEVEL_H_
|
||||
|
||||
#include <arm_math.h>
|
||||
|
||||
//#define MAX_POWER 4
|
||||
#define PL1_50MA 1 // for single frequency when dual frequency 1/2 each per level
|
||||
#define PL2_150MA 2
|
||||
#define PL3_400MA 3
|
||||
#define PL4_1AMP 4
|
||||
|
||||
#define MIN_BCAST_PWR 0
|
||||
#define MAX_BCAST_PWR 4
|
||||
|
||||
#define RESTRICTED 3
|
||||
#define RESTRICT_CLAMP_FRQ 1170 //1KHz
|
||||
|
||||
|
||||
//#define MAX_CLAMP_VOLTAGE 80.0f
|
||||
#define MAX_POWER_TARGET_LF 10.0f // < 45kHz
|
||||
#define MAX_POWER_TARGET_VLF 8.0f // < 800Hz (keep vibrations low)
|
||||
#define MAX_POWER_TARGET_HF 1.0f // >= 45kHz
|
||||
|
||||
#define CLAMP_REGULATE_DELAY 250 // milliseconds
|
||||
|
||||
typedef enum {
|
||||
RS_STOP = 0, //Not regulating
|
||||
RS_START, //Startup
|
||||
RS_RUN, //run regulation algorithm
|
||||
RS_MAINTAIN //regulation has finished. either hit requestedCurrent or didn't
|
||||
}REG_STATE_t;
|
||||
|
||||
typedef struct {
|
||||
REG_STATE_t state;
|
||||
|
||||
float32_t requestedCurrent;
|
||||
float32_t maxVoltage;
|
||||
float32_t maxCurrent;
|
||||
float32_t maxPower;
|
||||
|
||||
bool targetCurrentReached; //regulation complete, target acheived
|
||||
|
||||
}REGULATE_t;
|
||||
|
||||
void setTestPot(void);
|
||||
void doClampPower(void);
|
||||
void inc_pwr(void);
|
||||
void dec_pwr(void);
|
||||
void Increase_BC_PWR(void);
|
||||
void Decrease_BC_PWR(void);
|
||||
void Request_Current_Change(void);
|
||||
void Get_Clamp_Value(void);
|
||||
void Adjust_Pot_Val(void);
|
||||
uint8_t Get_BC_Alk_Value(void);
|
||||
void Check_New_Pot_Volts();
|
||||
float Requested_Current(uint8_t Battery_Type);
|
||||
#endif /* PWR_LEVEL_H_ */
|
||||
Reference in New Issue
Block a user