Files
portal/firmware/pico/board_config.h
Jimmy 5094c7bcee Add portal web simulator, SPI bridges, and Pico firmware updates.
Bring the five-panel hex portal online with a browser 3D/schematic preview, Pi SPI backends, and renamed multi-panel Pico UDP firmware.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 14:54:51 +12:00

64 lines
1.4 KiB
C
Raw Permalink 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; two WS2812 strips on GP27 + GP28 */
#define PIN_LED_STATUS 25
#define SPI_PORT spi1
#define SPI_CLK_MHZ 20
#define PIN_CS 9
#define PIN_SCK 10
#define PIN_MOSI 11
#define PIN_MISO 12
#define PIN_RST 13
/* Strip 0 / strip 1 data pins (override with -DPIN_WS2812=… / -DPIN_WS2812_1=…). */
#ifndef PIN_WS2812
#define PIN_WS2812 28
#endif
#ifndef PIN_WS2812_1
#define PIN_WS2812_1 27
#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)
/* Two WS2812 outputs on one Pico (separate GPIOs / PIO SMs). */
#ifndef MAX_STRIPS
#define MAX_STRIPS 2
#endif
/* W5500 socket assignments */
#define SOCKET_DHCP 0
#define SOCKET_UDP 1
/* UDP port (same as CircuitPython adapter) */
#define UDP_PORT 50007
/* Compile-time panel index for filtered frames (04). 255 = accept all. */
#ifndef PANEL_ID
#define PANEL_ID 255
#endif
/* 1 = DHCP, 0 = static IP below */
#ifndef USE_DHCP
#define USE_DHCP 0
#endif
#define STATIC_IP_OCT4 ((PANEL_ID) == 255 ? 19u : (10u + (unsigned)(PANEL_ID)))
#define STATIC_IP {10, 1, 1, (uint8_t)STATIC_IP_OCT4}
#define STATIC_SN {255, 255, 255, 0}
#define STATIC_GW {10, 1, 1, 1}
#define STATIC_DNS {10, 1, 1, 1}
/* Locally administered; last byte = PANEL_ID (unique per panel 04). */
#define MAC_ADDR {0x02, 0x50, 0x52, 0x54, 0x4C, (uint8_t)PANEL_ID}
#endif