-
Notifications
You must be signed in to change notification settings - Fork 35
/
board_defs.h
134 lines (107 loc) · 2.78 KB
/
board_defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef BOARD_DEFS
#define BOARD_DEFS
#define LED_TYPE_SINGLE 1
#define LED_TYPE_NEOPIXEL 2
#define LED_TYPE_RGB 3
// PiPico
#if BOARD_ID == 1
#define CRSF_TX 4 // physical 6
#define CRSF_RX 5 // physical 7
#define LED_TYPE LED_TYPE_SINGLE
#define LED_PIN 25
void boardSetup() {
pinMode(LED_PIN,OUTPUT);
}
void led_off() {
digitalWrite(LED_PIN, LOW);
}
void led_on() {
digitalWrite(LED_PIN, HIGH);
}
#endif
// TINY2040
#if BOARD_ID == 2
#define CRSF_TX 4
#define CRSF_RX 5
#define LED_TYPE LED_TYPE_RGB
#define LED_PIN_R 18
#define LED_PIN_G 19
#define LED_PIN_B 20
void boardSetup() {
pinMode(LED_PIN_R,OUTPUT);
pinMode(LED_PIN_G,OUTPUT);
pinMode(LED_PIN_B,OUTPUT);
}
void led_off() {
digitalWrite(LED_PIN_R, HIGH);
digitalWrite(LED_PIN_G, HIGH);
digitalWrite(LED_PIN_B, HIGH);
}
void led_on() {
digitalWrite(LED_PIN_R, HIGH);
digitalWrite(LED_PIN_G, HIGH);
digitalWrite(LED_PIN_B, LOW);
}
#endif
// WaveShare RP2040-Zero
#if BOARD_ID == 3
#define CRSF_TX 4
#define CRSF_RX 5
#define LED_TYPE LED_TYPE_NEOPIXEL
#define LED_PIN 16
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel pixels(1, LED_PIN, NEO_GRB + NEO_KHZ800);
void boardSetup() {
// noop
}
void led_off() {
pixels.setPixelColor(0, pixels.Color(0,0,0));
pixels.show();
}
void led_on() {
pixels.setPixelColor(0, pixels.Color(0,0,255));
pixels.show();
}
void led_color(uint8_t r, uint8_t g, uint8_t b) {
pixels.setPixelColor(0, pixels.Color(r,g,b));
pixels.show();
}
#endif
// Seeed XAIO 2040
#if BOARD_ID == 4
#define CRSF_TX 0
#define CRSF_RX 1
// 1 NEOPixel - currently unused
#define LED_TYPE LED_TYPE_NEOPIXEL
#define LED_NEO_PWR 11
#define LED_PIN 12
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel pixels(1, LED_PIN, NEO_GRB + NEO_KHZ800);
// 1 Active Low RGB
//#define LED_ACTIVE_LOW LED_ACTIVE_LOW_TRUE
//#define LED_TYPE LED_TYPE_RGB
#define LED_PIN_R 17
#define LED_PIN_G 16
#define LED_PIN_B 25
void boardSetup() {
// Enable neopixel LED
pinMode(LED_NEO_PWR, OUTPUT);
digitalWrite(LED_NEO_PWR,HIGH);
// Turn off user led
pinMode(LED_PIN_R,OUTPUT);
pinMode(LED_PIN_G,OUTPUT);
pinMode(LED_PIN_B,OUTPUT);
digitalWrite(LED_PIN_R, HIGH);
digitalWrite(LED_PIN_G, HIGH);
digitalWrite(LED_PIN_B, HIGH);
}
void led_off() {
pixels.setPixelColor(0, pixels.Color(0,0,0));
pixels.show();
}
void led_on() {
pixels.setPixelColor(0, pixels.Color(0,0,255));
pixels.show();
}
#endif
#endif