~gabe/flashlight-firmware/anduril2

414.1.7 by Selene Scriven
added support for Mateminco MF01-Mini
1
#ifndef HWDEF_MF01_MINI_H
2
#define HWDEF_MF01_MINI_H
3
4
/* MF01-Mini driver layout
5
 *           ----
6
 *   Reset -|1  8|- VCC
7
 * eswitch -|2  7|- aux LEDs
8
 * FET PWM -|3  6|- PWM (7x7135)
9
 *     GND -|4  5|- PWM (1x7135)
10
 *           ----
11
 */
12
13
#define PWM_CHANNELS 3
14
15
#ifndef AUXLED_PIN
16
#define AUXLED_PIN   PB2    // pin 7
17
#endif
18
19
#ifndef SWITCH_PIN
20
#define SWITCH_PIN   PB3    // pin 2
21
#define SWITCH_PCINT PCINT3 // pin 2 pin change interrupt
22
#endif
23
24
#ifndef PWM1_PIN
25
#define PWM1_PIN PB0        // pin 5, 1x7135 PWM
26
#define PWM1_LVL OCR0A      // OCR0A is the output compare register for PB0
27
#endif
28
#ifndef PWM2_PIN
414.1.10 by Selene Scriven
just cleaning up some comments
29
#define PWM2_PIN PB1        // pin 6, 7x7135 PWM
414.1.7 by Selene Scriven
added support for Mateminco MF01-Mini
30
#define PWM2_LVL OCR0B      // OCR0B is the output compare register for PB1
31
#endif
32
#ifndef PWM3_PIN
33
#define PWM3_PIN PB4        // pin 3, FET PWM
34
#define PWM3_LVL OCR1B      // OCR1B is the output compare register for PB4
35
#endif
36
464.1.11 by Selene Scriven
went back to slower clk/128 ADC timing
37
#define ADC_PRSCL   0x07    // clk/128
414.1.7 by Selene Scriven
added support for Mateminco MF01-Mini
38
39
// average drop across diode on this hardware
40
#ifndef VOLTAGE_FUDGE_FACTOR
41
#define VOLTAGE_FUDGE_FACTOR 5  // add 0.25V
42
#endif
43
44
#define FAST 0xA3           // fast PWM both channels
45
#define PHASE 0xA1          // phase-correct PWM both channels
46
47
#define LAYOUT_DEFINED
48
49
#endif