Add multi-panel Pico UDP firmware and Python LED control.
Pico panels get static IPs on 10.1.1.10–14 with per-panel LED counts, Makefile deploy targets, and Python examples for animations, sync tests, and direct Pi SPI control. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
74
firmware/panel/CMakeLists.txt
Normal file
74
firmware/panel/CMakeLists.txt
Normal file
@@ -0,0 +1,74 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(PICO_BOARD pico CACHE STRING "Board type")
|
||||
|
||||
include(pico_sdk_import.cmake)
|
||||
|
||||
project(portal_panel C CXX ASM)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
|
||||
pico_sdk_init()
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
iolibrary
|
||||
GIT_REPOSITORY https://github.com/Wiznet/ioLibrary_Driver.git
|
||||
GIT_TAG master
|
||||
)
|
||||
FetchContent_MakeAvailable(iolibrary)
|
||||
|
||||
set(IOLIB_DIR ${iolibrary_SOURCE_DIR})
|
||||
|
||||
add_executable(panel
|
||||
main.c
|
||||
wizchip_spi.c
|
||||
timer.c
|
||||
ws2812_led.cpp
|
||||
WS2812.cpp
|
||||
${IOLIB_DIR}/Ethernet/socket.c
|
||||
${IOLIB_DIR}/Ethernet/wizchip_conf.c
|
||||
${IOLIB_DIR}/Ethernet/W5500/w5500.c
|
||||
${IOLIB_DIR}/Internet/DHCP/dhcp.c
|
||||
)
|
||||
|
||||
pico_generate_pio_header(panel ${CMAKE_CURRENT_LIST_DIR}/WS2812.pio)
|
||||
|
||||
target_include_directories(panel PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${IOLIB_DIR}/Ethernet
|
||||
${IOLIB_DIR}/Internet/DHCP
|
||||
)
|
||||
|
||||
target_compile_definitions(panel PRIVATE
|
||||
_WIZCHIP_=W5500
|
||||
)
|
||||
|
||||
if (DEFINED PANEL_ID_BUILD)
|
||||
target_compile_definitions(panel PRIVATE PANEL_ID=${PANEL_ID_BUILD})
|
||||
endif ()
|
||||
|
||||
if (DEFINED NUM_LEDS_BUILD)
|
||||
target_compile_definitions(panel PRIVATE NUM_LEDS=${NUM_LEDS_BUILD})
|
||||
endif ()
|
||||
|
||||
if (DEFINED WS2812_PIN_BUILD)
|
||||
target_compile_definitions(panel PRIVATE PIN_WS2812=${WS2812_PIN_BUILD})
|
||||
endif ()
|
||||
|
||||
option(PORTAL_USE_DHCP "Use DHCP for W5500" OFF)
|
||||
if (PORTAL_USE_DHCP)
|
||||
target_compile_definitions(panel PRIVATE USE_DHCP=1)
|
||||
else ()
|
||||
target_compile_definitions(panel PRIVATE USE_DHCP=0)
|
||||
endif ()
|
||||
|
||||
target_link_libraries(panel
|
||||
pico_stdlib
|
||||
hardware_spi
|
||||
hardware_pio
|
||||
)
|
||||
|
||||
pico_enable_stdio_usb(panel 1)
|
||||
pico_enable_stdio_uart(panel 0)
|
||||
|
||||
pico_add_extra_outputs(panel)
|
||||
Reference in New Issue
Block a user