41#include "../../../revision.h"
42#include "../sources_common/Totempole_Application_Setup.h"
51#define rnd(a) ((uint16_t)((a)+((a)<0?-0.5:0.5)))
60#define min(a,b) ((uint16_t)(((a)>(b)) ? (b):(a)))
69#define max(a,b) ((uint16_t)(((a)>(b)) ? (a):(b)))
84#define FCALL_AC_MONITOR (1.0/10.0e-6)
96#define AC_SENSE_GAIN (3.771e-3)
98#define AC_SENSE_GAIN (37.585e-3)
108#define FIN_MIN (40.0)
117#define FIN_MAX (65.0)
156#define OV_TRIG (80.0)
177#define ZC_TIMEOUT (2.0e-3)
187#define ZC_TMIN (100.0e-6)
199#define AC_DROP_TIMEOUT (25.0e-3)
216#define DC_ACCEPTANCE_PERIOD_TICKS (rnd(FCALL_AC_MONITOR * 40.0e-3))
225#define FIN_MIN_TICKS (rnd(FCALL_AC_MONITOR / FIN_MIN))
234#define FIN_MAX_TICKS (rnd(FCALL_AC_MONITOR / FIN_MAX))
241#define ZC_TIMEOUT_TICKS (rnd(FCALL_AC_MONITOR * ZC_TIMEOUT))
248#define ZC_TMIN_TICKS (rnd(FCALL_AC_MONITOR * ZC_TMIN))
255#define AC_DROP_TIMEOUT_TICKS (rnd(FCALL_AC_MONITOR * AC_DROP_TIMEOUT))
268#define UV_TRIG_ADC (rnd((UV_TRIG*AC_SENSE_GAIN)/3.3*4096))
278#define UV_CLR_ADC (rnd(((UV_TRIG + UV_HYS)*AC_SENSE_GAIN)/3.3*4096))
287#define OV_TRIG_ADC (rnd((OV_TRIG*AC_SENSE_GAIN)/3.3*4096))
297#define OV_CLR_ADC (rnd(((OV_TRIG - OV_HYS)*AC_SENSE_GAIN)/3.3*4096))
307#define HV_FLAG (1<<15)
309#define HV_FLAG (0<<15)
313#define OPAMP_BIAS_IDEAL ((uint16_t)(1.65/3.3*4096))
316#define OPAMP_BIAS_HIGH_LIMIT ((uint16_t)(OPAMP_BIAS_IDEAL*1.05))
317#define OPAMP_BIAS_LOW_LIMIT ((uint16_t)(OPAMP_BIAS_IDEAL*0.95))
337#error HIGH_VOLTAGE must be defined as either 0 or 1 in revision.h
339#if HIGH_VOLTAGE != 0 && HIGH_VOLTAGE != 1
340#error HIGH_VOLTAGE must be defined as either 0 or 1 in revision.h
void vacm_state_machine(struct VACM_s *vacm_obj)
void vacm_reset_phase_monitor_object(struct VACM_s *vacm_obj)
void vacm_reset_state_machine(struct VACM_s *vacm_obj)
Main AC Monitor data object data type declaration.