~toykeeper/flashlight-firmware/trunk

« back to all changes in this revision

Viewing changes to ToyKeeper/hwdef-BLF_GT.h

  • Committer: Selene Scriven
  • Date: 2020-07-06 20:24:28 UTC
  • mfrom: (188.1.294 fsm)
  • Revision ID: bzr@toykeeper.net-20200706202428-7pyen2ow9q2rtd9p
merged nearly a year of updates from the fsm branch, including the new product map

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#ifndef VOLTAGE_PIN
35
35
#define VOLTAGE_PIN PB2     // pin 7, voltage ADC
36
36
#define VOLTAGE_CHANNEL 0x01 // MUX 01 corresponds with PB2
37
 
#define VOLTAGE_ADC_DIDR ADC1D  // Digital input disable bit corresponding with PB2
 
37
#define VOLTAGE_ADC ADC1D  // Digital input disable bit corresponding with PB2
 
38
// inherited from tk-attiny.h
 
39
//#define VOLTAGE_ADC_DIDR DIDR0  // DIDR for ADC1
38
40
// 1.1V reference, left-adjust, ADC1/PB2
39
41
//#define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | (1 << ADLAR) | VOLTAGE_CHANNEL)
40
42
// 1.1V reference, no left-adjust, ADC1/PB2
41
43
#define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | VOLTAGE_CHANNEL)
42
44
#endif
43
 
#define ADC_PRSCL   0x06    // clk/64
 
45
#define ADC_PRSCL   0x07    // clk/128
44
46
 
45
47
// Raw ADC readings at 4.4V and 2.2V (in-between, we assume values form a straight line)
46
48
#ifndef ADC_44
47
 
#define ADC_44 184
 
49
#define ADC_44 (184*4)
48
50
#endif
49
51
#ifndef ADC_22
50
 
#define ADC_22 92
 
52
#define ADC_22 (92*4)
51
53
#endif
52
54
 
53
 
#define TEMP_CHANNEL 0b00001111
54
 
 
55
55
#define FAST 0xA3           // fast PWM both channels
56
56
#define PHASE 0xA1          // phase-correct PWM both channels
57
57