6
* Reset -|1 8|- VCC (unused)
7
* eswitch -|2 7|- Voltage divider (2S)
8
* AUX LED -|3 6|- PWM (FET)
9
* GND -|4 5|- PWM (smaller FET)
13
#define PWM_CHANNELS 2
16
#define AUXLED_PIN PB4 // pin 3
20
#define SWITCH_PIN PB3 // pin 2
21
#define SWITCH_PCINT PCINT3 // pin 2 pin change interrupt
25
#define PWM1_PIN PB0 // pin 5, 1x7135 PWM
26
#define PWM1_LVL OCR0A // OCR0A is the output compare register for PB0
29
#define PWM2_PIN PB1 // pin 6, FET PWM
30
#define PWM2_LVL OCR0B // OCR0B is the output compare register for PB1
33
#define USE_VOLTAGE_DIVIDER // use a voltage divider on pin 7, not VCC
35
#define VOLTAGE_PIN PB2 // pin 7, voltage ADC
36
#define VOLTAGE_CHANNEL 0x01 // MUX 01 corresponds with PB2
37
#define VOLTAGE_ADC_DIDR ADC1D // Digital input disable bit corresponding with PB2
38
// 1.1V reference, left-adjust, ADC1/PB2
39
//#define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | (1 << ADLAR) | VOLTAGE_CHANNEL)
40
// 1.1V reference, no left-adjust, ADC1/PB2
41
#define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | VOLTAGE_CHANNEL)
43
#define ADC_PRSCL 0x06 // clk/64
45
// Raw ADC readings at 4.4V and 2.2V (in-between, we assume values form a straight line)
53
#define TEMP_CHANNEL 0b00001111
55
#define FAST 0xA3 // fast PWM both channels
56
#define PHASE 0xA1 // phase-correct PWM both channels
58
#define LAYOUT_DEFINED