~toykeeper/flashlight-firmware/fsm

« back to all changes in this revision

Viewing changes to ToyKeeper/hwdef-Noctigon_MD11.h

  • Committer: Selene Scriven
  • Date: 2021-09-24 11:28:15 UTC
  • mto: (483.1.154 anduril2)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: bzr@toykeeper.net-20210924112815-aymgx3z5chnie2dc
just a few adjustments to start with

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef HWDEF_NOCTIGON_K1_H
2
 
#define HWDEF_NOCTIGON_K1_H
 
1
#ifndef HWDEF_NOCTIGON_MD11_H
 
2
#define HWDEF_NOCTIGON_MD11_H
3
3
 
4
 
/* Noctigon K1 driver layout (attiny1634)
5
 
 * (originally known as Emisar D1S V2)
 
4
/* Noctigon MD11 driver layout (attiny1634)
 
5
 * (based on Noctigon K1)
6
6
 *
7
7
 * Pin / Name / Function
8
8
 *   1    PA6   (none) (PWM1B) (reserved for DD drivers)
9
9
 *   2    PA5   R: red aux LED (PWM0B)
10
10
 *   3    PA4   G: green aux LED
11
11
 *   4    PA3   B: blue aux LED
12
 
 *   5    PA2   (none) (reserved for L: button LED (on some models))
 
12
 *   5    PA2   L: button LED
13
13
 *   6    PA1   (none)
14
14
 *   7    PA0   (none)
15
15
 *   8    GND   GND
95
95
#define AUXLED_RGB_DDR  DDRA   // DDRA or DDRB or DDRC
96
96
#define AUXLED_RGB_PUE  PUEA   // PUEA or PUEB or PUEC
97
97
 
 
98
#define BUTTON_LED_PIN  PA2    // pin 5
 
99
#define BUTTON_LED_PORT PORTA  // for all "PA" pins
 
100
#define BUTTON_LED_DDR  DDRA   // for all "PA" pins
 
101
#define BUTTON_LED_PUE  PUEA   // for all "PA" pins
 
102
 
98
103
// with so many pins, doing this all with #ifdefs gets awkward...
99
104
// ... so just hardcode it in each hwdef file instead
100
105
inline void hwdef_setup() {
106
111
  DDRA = (1 << AUXLED_R_PIN)
107
112
       | (1 << AUXLED_G_PIN)
108
113
       | (1 << AUXLED_B_PIN)
 
114
       | (1 << BUTTON_LED_PIN)
109
115
       ;
110
116
 
111
117
  // configure PWM