-
Notifications
You must be signed in to change notification settings - Fork 8
/
Defines.h
326 lines (305 loc) · 8.43 KB
/
Defines.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
#pragma once
// -=-=-=-=-=-=- Uncomment the platform you're building for -=-=-=-=-=-=-
// #define STICK_C_PLUS
// #define STICK_C_PLUS2
// #define STICK_C
// #define CARDPUTER
// #define DIAL
// #define CoreInk
// -=-=- Uncommenting more than one at a time will result in errors -=-=-
// -=-=- Shark Language for Menu and Portal -=- Thanks, @marivaaldo and @Mmatuda! -=-=-
// #define LANGUAGE_EN_US
// #define LANGUAGE_PT_BR
// #define LANGUAGE_GER
// #define LANGUAGE_IT_IT
// #define LANGUAGE_FR_FR
// #define LANGUAGE_NL_NL
#ifndef SHARK_VERSION
#define SHARK_VERSION "dev 1.0.5"
#endif
#if !defined(CARDPUTER) && !defined(STICK_C_PLUS2) && !defined(STICK_C_PLUS) && !defined(STICK_C) && !defined(DIAL) && !defined(CoreInk)
// #define CoreInk
// #define DIAL
#define DINMETER
// #define CARDPUTER
#endif
#if !defined(LANGUAGE_EN_US) && !defined(LANGUAGE_PT_BR) && !defined(LANGUAGE_GER) && !defined(LANGUAGE_IT_IT) && !defined(LANGUAGE_FR_FR) && !defined(LANGUAGE_NL_NL)
#define LANGUAGE_EN_US
#endif
// -- DEPRECATED - THESE ARE NOW EEPROM DEFINED -- //
#ifdef CoreInk
uint16_t BGCOLOR = 0x0000; // placeholder
uint16_t FGCOLOR = 0xFFFF; // placeholder
#else
uint16_t BGCOLOR = 0x0001; // placeholder
uint16_t FGCOLOR = 0xFFF1; // placeholder
#endif
// -=-=- DEAUTHER -=- @bmorcelli -=-=- | Discord: Pirata#5263 bmorcelli
#define DEAUTHER //Need to make some changes in arduino IDE, refer to https://github.com/bmorcelli/m5stickC_Plus2-nemo/tree/main/DEAUTH%20Prerequisites
#if defined(STICK_C_PLUS)
#include <M5StickCPlus.h>
// -=-=- Display -=-=-
String platformName = "StickC+";
#define BIG_TEXT 4
#define MEDIUM_TEXT 3
#define SMALL_TEXT 2
#define TINY_TEXT 1
// -=-=- FEATURES -=-=-
#define M5LED 10
#define RTC
#define AXP
#define ACTIVE_LOW_IR
#define ROTATION
#define USE_EEPROM
#define SDCARD //Requires a custom-built adapter
#define SONG
// -=-=- ALIASES -=-=-
#define DISP M5.Lcd
#define IRLED 9
#define PortBpinIN 33
#define PortBpinOUT 32
#define SPEAKER M5.Beep
// #define BITMAP DISP.pushImage(0, 0, 240, 135, (uint16_t *)SHARKMatrix);// NOT TESTED YET
#define BITMAP Serial.println("unsupported")
#define SD_CLK_PIN 0
#define SD_MISO_PIN 36
#define SD_MOSI_PIN 26
#define SD_CS_PIN -1 //can be 14, to avoid serial messages
#define M5LED_ON LOW
#define M5LED_OFF HIGH
#endif
#if defined(STICK_C_PLUS2)
#include <M5StickCPlus2.h>
// -=-=- Display -=-=-
String platformName = "StickC+2";
#define BIG_TEXT 4
#define MEDIUM_TEXT 3
#define SMALL_TEXT 2
#define TINY_TEXT 1
// -=-=- FEATURES -=-=-
#define ACTIVE_LOW_IR
#define M5LED 19
#define ROTATION
#define USE_EEPROM
#define DTime
#define DTget StickCP2.Rtc
#define RTC //TODO: plus2 has a BM8563 RTC but the class isn't the same, needs work.
#define SDCARD //Requires a custom-built adapter
#define PWRMGMT
#define SPEAKER M5.Speaker
#define SONG
// -=-=- ALIASES -=-=-
#define DISP M5.Lcd
#define IRLED 19
#define PortBpinIN 33
#define PortBpinOUT 32
#define BITMAP DISP.pushImage(0, 0, 240, 135, (uint16_t *)SHARKMatrix);
#define M5_BUTTON_MENU 35
#define M5_BUTTON_HOME 37
#define M5_BUTTON_RST 39
#define BACKLIGHT 27
#define MINBRIGHT 190
#define SD_CLK_PIN 0
#define SD_MISO_PIN 36
#define SD_MOSI_PIN 26
#define SD_CS_PIN -1 //can be -1, but sends a lot of messages of error in serial monitor
#define M5LED_ON HIGH
#define M5LED_OFF LOW
#define SCREEN_WIDTH 80
#define SCREEN_HEIGHT 160
#endif
#if defined(STICK_C)
#include <M5StickC.h>
// -=-=- Display -=-=-
String platformName = "StickC";
#define BIG_TEXT 2
#define MEDIUM_TEXT 2
#define SMALL_TEXT 1
#define TINY_TEXT 1
// -=-=- FEATURES -=-=-
#define M5LED 10
#define RTC
#define AXP
#define ROTATION
#define USE_EEPROM
#define SDCARD //Requires a custom-built adapter
// -=-=- ALIASES -=-=-
#define DISP M5.Lcd
#define IRLED 9
#define PortBpinIN 33
#define PortBpinOUT 32
#define BITMAP Serial.println("unsupported")
#define SD_CLK_PIN 0
#define SD_MISO_PIN 36
#define SD_MOSI_PIN 26
#define SD_CS_PIN -1 //can be 14, to avoid serial messages
#define M5LED_ON LOW
#define M5LED_OFF HIGH
#endif
#if defined(CARDPUTER)
#include <M5Cardputer.h>
// -=-=- RTC -=-=-
#include <ESP32Time.h>
ESP32Time rtcp;
#define ESPTime
// -=-=- Display -=-=-
String platformName = "Cardputer";
#define BIG_TEXT 4
#define MEDIUM_TEXT 3
#define SMALL_TEXT 2
#define TINY_TEXT 1
// -=-=- FEATURES -=-=-
#define KB
#define RTC
#define HID
#define ACTIVE_LOW_IR
#define USE_EEPROM
#define SDCARD
#define SONG
// -=-=- ALIASES -=-=-
#define DISP M5Cardputer.Display
#define UperBtn 0
#define IRLED 44
#define PortBpinIN 1
#define PortBpinOUT 2
#define BACKLIGHT 38
#define MINBRIGHT 165
#define SPEAKER M5Cardputer.Speaker
#define BITMAP DISP.pushImage(0, 0, 240, 135, (uint16_t *)SHARKMatrix);
#define SD_CLK_PIN 40
#define SD_MISO_PIN 39
#define SD_MOSI_PIN 14
#define SD_CS_PIN 12
#define VBAT_PIN 10
#define M5LED_ON HIGH
#define M5LED_OFF LOW
#endif
#if defined(DIAL)
#include <M5Dial.h>
// -=-=- Display -=-=-
String platformName = "Dial";
#define BIG_TEXT 4
#define MEDIUM_TEXT 3
#define SMALL_TEXT 2
#define TINY_TEXT 1
// -=-=- FEATURES -=-=-
#define DTime
#define DTget M5Dial.Rtc
#define RTC
#define USE_EEPROM
#define SONG
#define ROTATION
// -=-=- ALIASES -=-=-
#define DISP M5Dial.Display
#define UperBtn 0
#define Rotary M5Dial.Encoder
#define Rotarysteps 3
#define PortBpinIN 1
#define PortBpinOUT 2
#define IRLED 2
#define BACKLIGHT 9
#define MINBRIGHT 20
#define SPEAKER M5Dial.Speaker
#define BITMAP DISP.pushImage(0, 0, 240, 240, (uint16_t *)SHARKMatrix);
#define VBAT_PIN 15
#define M5_BUTTON_HOME 46
#define M5LED_ON HIGH
#define M5LED_OFF LOW
int abstand[] = { 60, 50, 33, 23, 0, 23, 35, 50, 60, 10, 10 };
float Helligkeit[] = { 0.3, 0.5, 0.7, 0.85, 1, 0.85, 0.7, 0.5, 0.3, 0, 0 };
#endif
#if defined(CoreInk)
#include <M5CoreInk.h>
// -=-=- Display -=-=-
Ink_Sprite PageSprite(&M5.M5Ink);
String platformName = "CoreInk";
#define BIG_TEXT 3
#define MEDIUM_TEXT 2
#define SMALL_TEXT 2
#define TINY_TEXT 1
// -=-=- FEATURES -=-=-
#define RTC
#define HID
#define ACTIVE_LOW_IR
#define USE_EEPROM
#define SDCARD
#define SONG
// -=-=- ALIASES -=-=-
#define DISP M5.M5Ink
#define VBAT_PIN 35
#define UperBtn 0
#define IRLED 32
#define PortBpinIN 32
#define PortBpinOUT 33
#define M5_BUTTON_MENU 5
#define M5_BUTTON_HOME 38
#define M5_BUTTON_RST 39
#define M5_BUTTON_UP 37
#define SPEAKER M5.Speaker
#define BITMAP DISP.pushImage(-20, 32, 240, 135, (uint16_t *)SHARKMatrix);
#define SD_CLK_PIN 25
#define SD_MISO_PIN 36
#define SD_MOSI_PIN 26
#define SD_CS_PIN -1
#define VBAT_PIN 10
#define M5LED_ON HIGH
#define M5LED_OFF LOW
#endif
#if defined(DINMETER)
#include "M5DinMeter.h"
// -=-=- Display -=-=-
String platformName = "DinMeter";
#define BIG_TEXT 4
#define MEDIUM_TEXT 3
#define SMALL_TEXT 2
#define TINY_TEXT 1
// -=-=- FEATURES -=-=-
#define ACTIVE_LOW_IR
#define M5LED 19
#define ROTATION
#define USE_EEPROM
//#define DTime
//#define DTget StickCP2.Rtc
//#define RTC //TODO: plus2 has a BM8563 RTC but the class isn't the same, needs work.
#define SDCARD //Requires a custom-built adapter
#define PWRMGMT
#define SPEAKER DinMeter.Speaker
#define SONG
// -=-=- ALIASES -=-=-
#define DISP DinMeter.Display
#define IRLED 19
#define PortBpinIN 33
#define PortBpinOUT 32
#define BITMAP DISP.pushImage(0, 0, 240, 135, (uint16_t *)SHARKMatrix);
#define M5_BUTTON_HOME 42
//#define M5_BUTTON_MENU 42
#define Rotary DinMeter.Encoder
#define Rotarysteps 2
#define revRotary
#define BACKLIGHT 9
#define MINBRIGHT 190
#define SD_CLK_PIN 0
#define SD_MISO_PIN 36
#define SD_MOSI_PIN 26
#define SD_CS_PIN -1 //can be -1, but sends a lot of messages of error in serial monitor
#define M5LED_ON HIGH
#define M5LED_OFF LOW
#define SCREEN_WIDTH 240
#define SCREEN_HEIGHT 135
#endif
// -=-=-=-=-=- LIST OF CURRENTLY DEFINED FEATURES -=-=-=-=-=-
// M5LED - A visible LED (Red) exposed on this pin number
// IRLED - An IR LED exposed on this pin number
// RTC - Real-time clock exposed as M5.Rtc
// AXP - AXP192 Power Management exposed as M5.Axp
// PWRMGMT - StickC+2 Power Management exposed as M5.Power
// KB - Keyboard exposed as M5Cardputer.Keyboard
// HID - HID exposed as USBHIDKeyboard
// USE_EEPROM - Store settings in EEPROM
// ROTATION - Allow screen to be rotated
// DISP - Set to the API's Display class
// SDCARD - Device has an SD Card Reader attached
// SONG - Play melody or beep on startup
// SPEAKER - Aliased to the prefix used for making noise
// BACKLIGHT - Alias to the pin used for the backlight on some models
// MINBRIGHT - The lowest number (0-255) for the backlight to show through