#ifndef MAD_CORE_BUS_PWM_H
#define MAD_CORE_BUS_PWM_H

#include <avr/io.h>

// Devices
#define FAN01 PD4  // NF-12 Fan Peltier Hot Side
#define FAN02 PD5  // NF-A8 Fan Peltier Cold Side
#define FAN03 PD7  // NF-R8 Fan Heating Element

#define PWM_CYCLE_TOP  (F_CPU / 25000 - 1) // 8 MHz / 25 KHz
#define FAN01_MIN_DUTY (PWM_CYCLE_TOP * 0.2f)
#define FAN02_MIN_DUTY (PWM_CYCLE_TOP * 0.2f)
#define FAN03_MIN_DUTY (PWM_CYCLE_TOP * 0.2f)

int   PWM_Init(void);
void  PWM_SetValue(int port, int value);

#endif // MAD_CORE_BUS_PWM_H
