matlab_23550/Inu/main_matlab/pwm_sim.h

60 lines
1.3 KiB
C
Raw Normal View History

#include "mcu_wrapper_conf.h"
#ifndef PWM_SIM
#define PWM_SIM
// <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Event Manager
// ... Dead-Band Submodule
typedef struct
{
int DtCntPeriod;
int stateDt;
int dtcnt;
int ciA_DT;
int ciB_DT;
}DeadBandSimHandle;
// ... Time-Base Submodule, Counter-Compare Submodule <20> Event-Trigger Submodule
typedef struct
{
double TxCntPlus;
double TPr;
double tcntAux;
double tcntAuxPrev;
double tcnt;
double cmpA;
double cmpB;
int ciA;
int ciB;
DeadBandSimHandle dtsim;
}TimerSimHandle;
extern TimerSimHandle t1sim;
extern TimerSimHandle t2sim;
extern TimerSimHandle t3sim;
extern TimerSimHandle t4sim;
extern TimerSimHandle t5sim;
extern TimerSimHandle t6sim;
extern TimerSimHandle t7sim;
extern TimerSimHandle t8sim;
extern TimerSimHandle t9sim;
extern TimerSimHandle t10sim;
extern TimerSimHandle t11sim;
extern TimerSimHandle t12sim;
void Simulate_Timers(void);
void Init_Timers(void);
void initSimulateTim(TimerSimHandle* tsim, int period, double step);
void SimulateMainPWM(TimerSimHandle* tsim, int compare);
void SimulatePWM(TimerSimHandle* tsim, int compare);
int simulateTimAndGetCompare(TimerSimHandle* tsim, int compare);
void simulateActionActionQualifierSubmodule(TimerSimHandle* tsim);
void simulateDeadBendSubmodule(TimerSimHandle* tsim);
void simulateTripZoneSubmodule(TimerSimHandle* tsim);
#endif //PWM_SIM