FastLED 3.9.15
Loading...
Searching...
No Matches
AutoResearchPlatform.h
Go to the documentation of this file.
1// AutoResearchPlatform.h - Platform-specific defaults for AutoResearch example
2//
3// Encapsulates all platform #ifdefs so AutoResearch.ino stays clean.
4
5#pragma once
6
7#include "platforms/is_platform.h"
8
9namespace autoresearch {
10
11// Default TX pin for each platform
12constexpr int defaultTxPin() {
13#if defined(FL_IS_STUB)
14 return 1; // Stub: TX and RX same pin — NativeRxDevice monitors TX output directly
15#elif defined(FL_IS_ESP_32S3)
16 return 1; // ESP32-S3: Connect GPIO 1 (TX) to GPIO 2 (RX) with jumper wire
17#elif defined(FL_IS_ESP_32S2)
18 return 1; // ESP32-S2
19#elif defined(FL_IS_ESP_32C6)
20 return 1; // ESP32-C6 (RISC-V)
21#elif defined(FL_IS_ESP_32C3)
22 return 1; // ESP32-C3 (RISC-V)
23#elif defined(FL_IS_ESP_32P4)
24 return 5; // ESP32-P4: Connect GPIO 5 (TX) to GPIO 6 (RX) with jumper wire
25#elif defined(FL_IS_TEENSY_4X)
26 return 1; // Teensy 4.x: any GPIO works for TX
27#else
28 return 1; // ESP32 (classic) and other variants
29#endif
30}
31
32// Default RX pin for each platform
33constexpr int defaultRxPin() {
34#if defined(FL_IS_STUB)
35 return 1; // Stub: same pin as TX — internal loopback
36#elif defined(FL_IS_ESP_32S3)
37 return 2; // ESP32-S3: jumper wire from GPIO 1
38#elif defined(FL_IS_ESP_32S2)
39 return 0;
40#elif defined(FL_IS_ESP_32C6)
41 return 0;
42#elif defined(FL_IS_ESP_32C3)
43 return 0;
44#elif defined(FL_IS_ESP_32P4)
45 return 6; // ESP32-P4: jumper wire from GPIO 5
46#elif defined(FL_IS_TEENSY_4X)
47 return 2; // Teensy 4.x: FlexPWM-capable pin, jumper wire from pin 1
48#else
49 return 0; // ESP32 (classic) and other variants
50#endif
51}
52
53// Human-readable chip/platform name
54constexpr const char* chipName() {
55#if defined(FL_IS_STUB)
56 return "Stub/Native";
57#elif defined(FL_IS_ESP_32C6)
58 return "ESP32-C6 (RISC-V)";
59#elif defined(FL_IS_ESP_32S3)
60 return "ESP32-S3 (Xtensa)";
61#elif defined(FL_IS_ESP_32C3)
62 return "ESP32-C3 (RISC-V)";
63#elif defined(FL_IS_ESP_32DEV)
64 return "ESP32 (Xtensa)";
65#elif defined(FL_IS_ESP_32P4)
66 return "ESP32-P4 (dual-core RISC-V)";
67#elif defined(FL_IS_TEENSY_4X)
68 return "Teensy 4.x (Cortex-M7)";
69#else
70 return "Unknown platform";
71#endif
72}
73
74} // namespace autoresearch
constexpr int defaultTxPin()
constexpr int defaultRxPin()
constexpr const char * chipName()