diff options
| author | Selene ToyKeeper | 2023-10-26 08:29:44 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2023-10-26 08:29:44 -0600 |
| commit | fd7aa0297954c511d3f0ec2353a8fcc3c68a3b5a (patch) | |
| tree | e3d99e926bf6ad7d71fa37b78fdf4bbb08dc6329 /hwdef-sofirn-lt1s-pro.h | |
| parent | converted blf-gt-mini to new API (diff) | |
| download | anduril-fd7aa0297954c511d3f0ec2353a8fcc3c68a3b5a.tar.gz anduril-fd7aa0297954c511d3f0ec2353a8fcc3c68a3b5a.tar.bz2 anduril-fd7aa0297954c511d3f0ec2353a8fcc3c68a3b5a.zip | |
converted Sofirn LT1-t1616 to new API, using SiteRelEnby's branch for reference
(needs further updates though, to improve ramping, since this version is
basically a straight conversion of the old t85 code with 8-bit ramps)
Diffstat (limited to '')
| -rw-r--r-- | hwdef-sofirn-lt1s-pro.h | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/hwdef-sofirn-lt1s-pro.h b/hwdef-sofirn-lt1s-pro.h index 3cc0ca9..97de7d7 100644 --- a/hwdef-sofirn-lt1s-pro.h +++ b/hwdef-sofirn-lt1s-pro.h @@ -43,57 +43,54 @@ enum channel_modes_e { //#define USE_CALC_AUTO_3CH_BLEND -// TODO: remove this as soon as it's not needed -#define PWM_CHANNELS 1 +#define PWM_CHANNELS 1 // old, remove this -#define SWITCH_PIN PIN5_bp -#define SWITCH_PORT VPORTA.IN -#define SWITCH_ISC_REG PORTA.PIN2CTRL -#define SWITCH_VECT PORTA_PORT_vect -#define SWITCH_INTFLG VPORTA.INTFLAGS +// only using 16-bit PWM on this light +#define PWM_BITS 16 +#define PWM_GET PWM_GET16 +#define PWM_DATATYPE uint16_t +#define PWM1_DATATYPE uint16_t +#define PWM_DATATYPE2 uint32_t // dynamic PWM // PWM parameters of all channels are tied together because they share a counter -#define PWM_TOP_INIT 511 // highest value used in the top half of the ramp +#define PWM_TOP_INIT 511 // highest value used in the top half of the ramp #define PWM_TOP TCA0.SINGLE.PERBUF // holds the TOP value for for variable-resolution PWM #define PWM_CNT TCA0.SINGLE.CNT // for resetting phase after each TOP adjustment -// warm tint channel +// warm LEDs //#define WARM_PWM_PIN PB0 #define WARM_PWM_LVL TCA0.SINGLE.CMP0BUF // CMP1 is the output compare register for PB0 -// cold tint channel +// cold LEDs //#define COOL_PWM_PIN PB1 #define COOL_PWM_LVL TCA0.SINGLE.CMP1BUF // CMP0 is the output compare register for PB1 -// red channel +// red LEDs //#define RED_PWM_PIN PB2 #define RED_PWM_LVL TCA0.SINGLE.CMP2BUF // CMP2 is the output compare register for PB2 -// only using 16-bit PWM on this light -#define PWM_BITS 16 -#define PWM_GET PWM_GET16 -#define PWM_DATATYPE uint16_t -#define PWM1_DATATYPE uint16_t -#define PWM_DATATYPE2 uint32_t - - -// average drop across diode on this hardware -#ifndef VOLTAGE_FUDGE_FACTOR -#define VOLTAGE_FUDGE_FACTOR 7 // add 0.35V -#endif - - // lighted button -#define AUXLED_PIN PIN5_bp -#define AUXLED_PORT PORTB +#define AUXLED_PIN PIN5_bp +#define AUXLED_PORT PORTB // the button lights up #define USE_INDICATOR_LED // the button is visible while main LEDs are on #define USE_INDICATOR_LED_WHILE_RAMPING +// e-switch +#define SWITCH_PIN PIN5_bp +#define SWITCH_PORT VPORTA.IN +#define SWITCH_ISC_REG PORTA.PIN2CTRL +#define SWITCH_VECT PORTA_PORT_vect +#define SWITCH_INTFLG VPORTA.INTFLAGS + +// average drop across diode on this hardware +#ifndef VOLTAGE_FUDGE_FACTOR +#define VOLTAGE_FUDGE_FACTOR 7 // add 0.35V +#endif inline void hwdef_setup() { |
