~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to ToyKeeper/hwdef-Mateminco_MT35-Mini.h

  • Committer: Selene ToyKeeper
  • Date: 2022-04-15 01:59:55 UTC
  • mfrom: (613 anduril2)
  • mto: (579.1.70 anduril2)
  • mto: This revision was merged to the branch mainline in revision 614.
  • Revision ID: bzr@toykeeper.net-20220415015955-h0akxkzd2wtjv6b4
merged gchart's latest changes:
- sp10-pro shutoff fix
- mt35-mini support
- power channel enable/disable timing delays
  (though I wouldn't recommend doing 80ms like the thefreeman code does,
   since that's more than one WDT cycle (16ms))

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef HWDEF_MT35_MINI_H
 
2
#define HWDEF_MT35_MINI_H
 
3
 
 
4
/* Mateminco MT35-Mini / Astrolux FT03
 
5
 *           ----
 
6
 *   Reset -|1  8|- VCC
 
7
 * eswitch -|2  7|- Aux LED
 
8
 *  1x7135 -|3  6|- NC
 
9
 *     GND -|4  5|- FET
 
10
 *           ----
 
11
 */
 
12
 
 
13
#define PWM_CHANNELS 2
 
14
 
 
15
#ifndef SWITCH_PIN
 
16
#define SWITCH_PIN   PB3    // pin 2
 
17
#define SWITCH_PCINT PCINT3 // pin 2 pin change interrupt
 
18
#endif
 
19
 
 
20
#ifndef PWM1_PIN
 
21
#define PWM1_PIN PB4        // pin 3, 1x7135 PWM
 
22
#define PWM1_LVL OCR1B      // OCR1B is the output compare register for PB0
 
23
#endif
 
24
 
 
25
#ifndef PWM2_PIN
 
26
#define PWM2_PIN PB0        // pin 5, FET PWM
 
27
#define PWM2_LVL OCR0A      // OCR0A is the output compare register for PB4
 
28
#endif
 
29
 
 
30
#define ADC_PRSCL   0x07    // clk/128
 
31
 
 
32
// average drop across diode on this hardware
 
33
#ifndef VOLTAGE_FUDGE_FACTOR
 
34
#define VOLTAGE_FUDGE_FACTOR 7  // add 0.35V
 
35
#endif
 
36
 
 
37
// lighted button
 
38
#ifndef AUXLED_PIN
 
39
#define AUXLED_PIN   PB2    // pin 7
 
40
#endif
 
41
 
 
42
#define FAST 0xA3           // fast PWM both channels
 
43
#define PHASE 0xA1          // phase-correct PWM both channels
 
44
 
 
45
#define LAYOUT_DEFINED
 
46
 
 
47
#endif