Skip to main content

dmx_interface/boards/
s2_mini.rs

1//! Lolin S2 Mini board configuration.
2//!
3//! Pin definitions and hardware constants for the Lolin S2 Mini (ESP32-S2).
4//! This is the primary target board.
5
6#![allow(dead_code)]
7
8/// Human-readable board identifier.
9pub const BOARD_NAME: &str = "Lolin S2 Mini";
10
11// ─────────────────────────────────────────────────────────────────────────────
12// DMX / RS-485
13// ─────────────────────────────────────────────────────────────────────────────
14
15/// UART TX pin for DMX/RS-485 output.
16pub const DMX_UART_TX: u8 = 17;
17
18/// UART RX pin for DMX/RS-485 input.
19pub const DMX_UART_RX: u8 = 18;
20
21/// GPIO pin for RS-485 DE/RE (direction enable/disable).
22pub const DMX_UART_DE_RE: u8 = 16;
23
24// ─────────────────────────────────────────────────────────────────────────────
25// STATUS LED (PWM)
26// ─────────────────────────────────────────────────────────────────────────────
27
28/// GPIO pin for the external status LED (via MOSFET, if connected).
29pub const LED_GPIO: u8 = 7;
30
31/// GPIO pin for the on-board status LED (active-low).
32pub const ONBOARD_LED_GPIO: u8 = 15;
33
34// ─────────────────────────────────────────────────────────────────────────────
35// USER BUTTON (external, pull-up)
36// ─────────────────────────────────────────────────────────────────────────────
37
38/// GPIO pin for the external user button (active low, pull-up).
39pub const BUTTON_GPIO: u8 = 5;
40
41// ─────────────────────────────────────────────────────────────────────────────
42// BOOT BUTTON (on-board)
43// ─────────────────────────────────────────────────────────────────────────────
44
45/// GPIO pin for the on-board BOOT button.
46pub const BOOT_BUTTON_GPIO: u8 = 0;
47
48// ─────────────────────────────────────────────────────────────────────────────
49// CONSOLE UART (USB CDC / USB Serial JTAG)
50// ─────────────────────────────────────────────────────────────────────────────
51
52/// UART TX pin for console output (USB CDC).
53pub const CONSOLE_TX: u8 = 43;
54
55/// UART RX pin for console input (USB CDC).
56pub const CONSOLE_RX: u8 = 44;
57
58// ─────────────────────────────────────────────────────────────────────────────
59// USB-OTG (native USB-CDC)
60// ─────────────────────────────────────────────────────────────────────────────
61
62/// USB D+ pin (USB-OTG, fixed by hardware).
63pub const USB_DP_GPIO: u8 = 20;
64
65/// USB D- pin (USB-OTG, fixed by hardware).
66pub const USB_DM_GPIO: u8 = 19;
67
68// ─────────────────────────────────────────────────────────────────────────────
69// SPI (W5500 Ethernet — future)
70// ─────────────────────────────────────────────────────────────────────────────
71
72/// SPI chip select pin for W5500 Ethernet module.
73pub const W5500_CS: u8 = 34;
74
75/// SPI MOSI pin for W5500 Ethernet module.
76pub const W5500_MOSI: u8 = 35;
77
78/// SPI SCK pin for W5500 Ethernet module.
79pub const W5500_SCK: u8 = 36;
80
81/// SPI MISO pin for W5500 Ethernet module.
82pub const W5500_MISO: u8 = 37;