phase.h
Go to the documentation of this file.00001
00043 #ifndef DRV_PHASE_H
00044 #define DRV_PHASE_H
00045
00046 #include "hw/phase_map.h"
00047
00048 #include "cfg/cfg_phase.h"
00049
00050 #include <drv/timer.h>
00051
00052 #define TRIAC_POWER_K CONFIG_TRIAC_MAX_DUTY * (1 / sqrt(2 * CONFIG_TRIAC_MAX_POWER))
00053
00058 typedef uint16_t triac_duty_t;
00059 typedef uint16_t triac_power_t;
00060
00061
00062
00063 DB(extern bool phase_initialized;)
00064
00069 typedef struct Triac
00070 {
00071 Timer timer;
00072 triac_duty_t duty;
00073 bool running;
00074 } Triac;
00075
00076
00077 void phase_setDutyUnlock(TriacDev dev, triac_duty_t duty);
00078 void phase_setDuty(TriacDev dev, triac_duty_t duty);
00079 void phase_setPower(TriacDev dev, triac_power_t power);
00080
00081 void phase_init(void);
00082
00083
00084 #endif