~toykeeper/flashlight-firmware/lume1

« back to all changes in this revision

Viewing changes to ToyKeeper/tk-attiny.h

  • Committer: Selene Scriven
  • Date: 2020-03-18 09:29:21 UTC
  • mfrom: (433.1.25 d1sv2)
  • Revision ID: bzr@toykeeper.net-20200318092921-7njlos9aa8d510xa
merged Noctigon K1 branch, which changes a few things...
- added support for 10-bit PWM
- 10-bit ADC voltage divider calibration values instead of 8-bit
- added ability to use different DIDR channels on different hardware
- made dynamic underclocking configurable per build target
- expanded RGB aux LED support
- increased resolution of RGB voltage readout (6 colors instead of 3)
- made party strobe ontime configurable per build target
- added support for an enable/disable pin for a regulator chip

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    #define ADMUX_VCC 0b00001100
35
35
    #define DELAY_ZERO_TIME 252
36
36
    #define SWITCH_PORT  PINB  // PINA or PINB or PINC
 
37
    #define VOLTAGE_ADC_DIDR DIDR0  // this MCU only has one DIDR
37
38
#elif (ATTINY == 25)
38
39
    // TODO: Use 6.4 MHz instead of 8 MHz?
39
40
    #define F_CPU 8000000UL
44
45
    #define ADMUX_THERM 0b10001111
45
46
    #define DELAY_ZERO_TIME 1020
46
47
    #define SWITCH_PORT  PINB  // PINA or PINB or PINC
 
48
    #define VOLTAGE_ADC_DIDR DIDR0  // this MCU only has one DIDR
47
49
#elif (ATTINY == 85)
48
50
    // TODO: Use 6.4 MHz instead of 8 MHz?
49
51
    #define F_CPU 8000000UL
56
58
    #define ADMUX_THERM 0b10001111
57
59
    #define DELAY_ZERO_TIME 1020
58
60
    #define SWITCH_PORT  PINB  // PINA or PINB or PINC
 
61
    #define VOLTAGE_ADC_DIDR DIDR0  // this MCU only has one DIDR
59
62
#elif (ATTINY == 1634)
60
63
    #define F_CPU 8000000UL
61
64
    #define V_REF REFS1
66
69
    #define ADMUX_THERM 0b10001110
67
70
    #define DELAY_ZERO_TIME 1020
68
71
    //#define SWITCH_PORT  PINA  // set this in hwdef
 
72
    //#define VOLTAGE_ADC_DIDR DIDR0  // set this in hwdef
69
73
#else
70
74
    #error Hey, you need to define ATTINY.
71
75
#endif