Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 47 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,43 @@ project(hub75 C CXX ASM)
# Initialise the Raspberry Pi Pico SDK
pico_sdk_init()

# Add executable. Default name is the project name
add_executable(hub75 hub75_demo.cpp )
# Add library. This is the core HUB75 driver.
add_library(hub75 STATIC)

pico_set_program_name(hub75 "hub75_demo")
pico_set_program_version(hub75 "3.1")
target_sources(hub75 PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src/hub75.cpp
${CMAKE_CURRENT_LIST_DIR}/src/rul6024.cpp
${CMAKE_CURRENT_LIST_DIR}/src/fm6126a.cpp
)

target_link_libraries(hub75 PUBLIC
pico_stdlib
pico_multicore
pico_aon_timer
hardware_pio
hardware_dma
hardware_vreg
pico_graphics
)

target_include_directories(hub75 PUBLIC
${CMAKE_CURRENT_LIST_DIR}/include
)

set(PICO_PIO_VERSION 1)
pico_set_float_implementation(hub75 pico)
target_include_directories(hub75 PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src
)

pico_generate_pio_header(hub75 ${CMAKE_CURRENT_LIST_DIR}/src/hub75.pio)


# Add demo executable. Everything that is only required for the demo remains here.
add_executable(hub75_demo hub75_demo.cpp )

pico_set_program_name(hub75_demo "hub75_demo")
pico_set_program_version(hub75_demo "3.1")

pico_set_float_implementation(hub75_demo pico)

set(PANEL_GENERIC 0)
set(PANEL_FM6126A 1)
Expand All @@ -60,7 +89,7 @@ set(CHAIN_MODE_RASTER 1)
# Example:
# Settings for a RP2350B microcontroller with GPIO pins spanning from 30 to 43.
# Beware to set `PICO_PLATFORM rp2350` and `PICO_BOARD none` prior to `include(pico_sdk_import.cmake)`
target_compile_definitions(hub75 PRIVATE
target_compile_definitions(hub75_demo PRIVATE
# PICO_RP2350A=0 # PICO_RP2350A=0` means not a RP2350A but a RP2350B microcontroller - uncomment for RP235xB microcontroller only!
USE_PICO_GRAPHICS=true # set to false if you use hub75 as a library - any reference to pico_graphics is removed
MATRIX_PANEL_WIDTH=64 # your matrix panel width
Expand Down Expand Up @@ -91,17 +120,14 @@ target_compile_definitions(hub75 PRIVATE
FRAME_RATE=false # for testing and debugging purpose only: output frame rate information (printf) in monitor - set to `false` for production
)

# Generate PIO header
pico_generate_pio_header(hub75 ${CMAKE_CURRENT_LIST_DIR}/src/hub75.pio)

# Modify the below lines to enable/disable output over UART/USB
pico_enable_stdio_uart(hub75 0)
pico_enable_stdio_usb(hub75 1)
pico_enable_stdio_uart(hub75_demo 0)
pico_enable_stdio_usb(hub75_demo 1)

add_subdirectory(common)
add_subdirectory(libraries)

target_sources(hub75 PRIVATE
target_sources(hub75_demo PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src/hub75.cpp
${CMAKE_CURRENT_LIST_DIR}/examples/bouncing_balls.cpp
${CMAKE_CURRENT_LIST_DIR}/examples/antialiased_line.cpp
Expand All @@ -118,7 +144,7 @@ target_sources(hub75 PRIVATE
)

# Add the standard library to the build
target_link_libraries(hub75
target_link_libraries(hub75_demo PRIVATE
pico_stdlib
pico_multicore
pico_aon_timer
Expand All @@ -128,16 +154,19 @@ target_link_libraries(hub75
pico_graphics)

if(PICO_CYW43_SUPPORTED)
target_link_libraries(hub75
target_link_libraries(hub75_demo PRIVATE
pico_cyw43_arch_none)
endif()

# Add the standard include files to the build
target_include_directories(hub75 PRIVATE
target_include_directories(hub75_demo PRIVATE
${CMAKE_CURRENT_LIST_DIR}/include
${CMAKE_CURRENT_LIST_DIR}/src
${CMAKE_CURRENT_LIST_DIR}/examples
${CMAKE_CURRENT_LIST_DIR}
)

pico_add_extra_outputs(hub75)
pico_generate_pio_header(hub75_demo ${CMAKE_CURRENT_LIST_DIR}/src/hub75.pio)


pico_add_extra_outputs(hub75_demo)

4 changes: 2 additions & 2 deletions examples/antialiased_line.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#pragma once

#include "libraries/pico_graphics/pico_graphics.hpp"
#include "libraries/bitmap_fonts/font14_outline_data.hpp"
#include "pico_graphics.hpp"
#include "font14_outline_data.hpp"

using namespace pimoroni;

Expand Down
2 changes: 1 addition & 1 deletion examples/fire_effect.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Example derived from https://github.com/pimoroni/pimoroni-pico/blob/main/examples/interstate75/interstate75_fire_effect.cpp
#include "libraries/pico_graphics/pico_graphics.hpp"
#include "pico_graphics.hpp"

using namespace pimoroni;

Expand Down
2 changes: 1 addition & 1 deletion examples/grey_scale_stripes.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#pragma once

#include "libraries/pico_graphics/pico_graphics.hpp"
#include "pico_graphics.hpp"

using namespace pimoroni;

Expand Down
4 changes: 2 additions & 2 deletions examples/hue_value_spectrum.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Example derviced from https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA/blob/master/examples/HueValueSpectrum/HueValueSpectrum.ino
#include <algorithm>

#include "libraries/pico_graphics/pico_graphics.hpp"
#include "libraries/bitmap_fonts/font14_outline_data.hpp"
#include "pico_graphics.hpp"
#include "font14_outline_data.hpp"

using namespace pimoroni;

Expand Down
2 changes: 1 addition & 1 deletion examples/pixel_fill.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libraries/pico_graphics/pico_graphics.hpp"
#include "pico_graphics.hpp"

using namespace pimoroni;

Expand Down
2 changes: 1 addition & 1 deletion examples/rectangle.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libraries/pico_graphics/pico_graphics.hpp"
#include "pico_graphics.hpp"
#include <cstdint>

using namespace pimoroni;
Expand Down
2 changes: 1 addition & 1 deletion src/hub75.hpp → include/hub75.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#endif

#if USE_PICO_GRAPHICS == true
#include "libraries/pico_graphics/pico_graphics.hpp"
#include "pico_graphics.hpp"
#endif

// See README.md file chapter "How to Configure" for some hints how to adapt the configuration to your panel
Expand Down