~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to ToyKeeper/hwdef-BLF_GT.h

merged recent fsm branch updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
#define PWM_CHANNELS 2
11
11
 
 
12
#ifndef AUXLED_PIN
12
13
#define AUXLED_PIN   PB4    // pin 3
 
14
#endif
13
15
 
 
16
#ifndef SWITCH_PIN
14
17
#define SWITCH_PIN   PB3    // pin 2
15
18
#define SWITCH_PCINT PCINT3 // pin 2 pin change interrupt
 
19
#endif
16
20
 
 
21
#ifndef PWM1_PIN
17
22
#define PWM1_PIN PB0        // pin 5, 1x7135 PWM
18
23
#define PWM1_LVL OCR0A      // OCR0A is the output compare register for PB0
 
24
#endif
 
25
#ifndef PWM2_PIN
19
26
#define PWM2_PIN PB1        // pin 6, FET PWM
20
27
#define PWM2_LVL OCR0B      // OCR0B is the output compare register for PB1
 
28
#endif
21
29
 
22
30
#define USE_VOLTAGE_DIVIDER // use a voltage divider on pin 7, not VCC
 
31
#ifndef VOLTAGE_PIN
23
32
#define VOLTAGE_PIN PB2     // pin 7, voltage ADC
24
33
#define VOLTAGE_CHANNEL 0x01 // MUX 01 corresponds with PB2
 
34
#define VOLTAGE_ADC_DIDR ADC1D  // Digital input disable bit corresponding with PB2
25
35
// 1.1V reference, left-adjust, ADC1/PB2
26
36
//#define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | (1 << ADLAR) | VOLTAGE_CHANNEL)
27
37
// 1.1V reference, no left-adjust, ADC1/PB2
28
38
#define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | VOLTAGE_CHANNEL)
29
 
#define VOLTAGE_ADC_DIDR    ADC1D   // Digital input disable bit corresponding with PB2
 
39
#endif
30
40
#define ADC_PRSCL   0x06    // clk/64
31
41
 
32
42
// Raw ADC readings at 4.4V and 2.2V (in-between, we assume values form a straight line)
 
43
#ifndef ADC_44
33
44
#define ADC_44 184
 
45
#endif
 
46
#ifndef ADC_22
34
47
#define ADC_22 92
 
48
#endif
35
49
 
36
50
#define TEMP_CHANNEL 0b00001111
37
51