Files
led-driver-8/firmware/board_config.h
T
jimmyandCursor 881e0ecaeb Switch panel firmware to DDP and match portal W5500 pinout.
Replace custom UDP RGB with DDP on 4048, fix picotool -f ordering for v1.1.2, and chunk test frames under MTU so the W5500 receives them.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-06 16:58:47 +13:00

75 lines
1.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef BOARD_CONFIG_H
#define BOARD_CONFIG_H
/* W5500 on SPI1; eight WS2812 strips (DDP protocol) */
#define PIN_LED_STATUS 25
#define SPI_PORT spi1
#define SPI_CLK_MHZ 15
/* This adapter board: CS=9, RST=13 (some portal PCBs use CS=13 / RST=9) */
#define PIN_CS 9
#define PIN_SCK 10
#define PIN_MOSI 11
#define PIN_MISO 12
#define PIN_RST 13
/* Strip 0 / 1 overridable; remaining pins fixed in DEFAULT_STRIP_PINS */
#ifndef PIN_WS2812
#define PIN_WS2812 18
#endif
#ifndef PIN_WS2812_1
#define PIN_WS2812_1 19
#endif
/* Strip / buffer capacity. Pixel count comes from each UDP frame length. */
#ifndef MAX_LEDS
#define MAX_LEDS 512
#endif
#define LED_RGB_BYTES (MAX_LEDS * 3)
/* Eight WS2812 outputs (one PIO SM each on RP2040). */
#ifndef MAX_STRIPS
#define MAX_STRIPS 8
#endif
#define DEFAULT_STRIP_PINS \
{ PIN_WS2812, PIN_WS2812_1, 20, 21, 22, 26, 27, 28 }
/* W5500 socket assignments */
#define SOCKET_DHCP 0
#define SOCKET_UDP 1
/* DDP (Distributed Display Protocol) default port */
#define UDP_PORT 4048
/* Compile-time panel index for filtered frames (0–4). 255 = accept all. */
#ifndef PANEL_ID
#define PANEL_ID 255
#endif
#ifndef USE_DHCP
#define USE_DHCP 0
#endif
#ifndef STATIC_IP
#define STATIC_IP_OCT4 ((PANEL_ID) == 255 ? 19u : (10u + (unsigned)(PANEL_ID)))
#define STATIC_IP {10, 1, 1, (uint8_t)STATIC_IP_OCT4}
#endif
#ifndef STATIC_SN
#define STATIC_SN {255, 255, 255, 0}
#endif
#ifndef STATIC_GW
#define STATIC_GW {10, 1, 1, 1}
#endif
#ifndef STATIC_DNS
#define STATIC_DNS {10, 1, 1, 1}
#endif
/* Locally administered; last byte = PANEL_ID (unique per panel 0–4). */
#define MAC_ADDR {0x02, 0x50, 0x52, 0x54, 0x4C, (uint8_t)PANEL_ID}
#endif