2022-04-13 08:00:18 +00:00
|
|
|
# Quantum Painter Configurables
|
|
|
|
QUANTUM_PAINTER_DRIVERS ?=
|
|
|
|
QUANTUM_PAINTER_ANIMATIONS_ENABLE ?= yes
|
|
|
|
|
2022-12-12 20:51:14 +00:00
|
|
|
QUANTUM_PAINTER_LVGL_INTEGRATION ?= no
|
|
|
|
|
2022-04-13 08:00:18 +00:00
|
|
|
# The list of permissible drivers that can be listed in QUANTUM_PAINTER_DRIVERS
|
2022-09-18 21:30:08 +00:00
|
|
|
VALID_QUANTUM_PAINTER_DRIVERS := \
|
2023-10-22 02:27:31 +00:00
|
|
|
surface \
|
|
|
|
ili9163_spi \
|
|
|
|
ili9341_spi \
|
2024-02-17 07:36:05 +00:00
|
|
|
ili9486_spi \
|
2023-10-22 02:27:31 +00:00
|
|
|
ili9488_spi \
|
|
|
|
st7735_spi \
|
|
|
|
st7789_spi \
|
|
|
|
gc9a01_spi \
|
2024-06-04 22:41:26 +00:00
|
|
|
gc9107_spi \
|
2023-10-22 02:27:31 +00:00
|
|
|
ssd1351_spi \
|
|
|
|
sh1106_i2c \
|
2024-09-18 11:44:33 +00:00
|
|
|
sh1106_spi \
|
|
|
|
ld7032_i2c \
|
|
|
|
ld7032_spi
|
2022-04-13 08:00:18 +00:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_ENABLE
|
2022-09-12 15:49:04 +00:00
|
|
|
COMMON_VPATH += $(QUANTUM_DIR)/painter \
|
|
|
|
$(QUANTUM_DIR)/unicode
|
2022-04-13 08:00:18 +00:00
|
|
|
SRC += \
|
2022-09-12 15:49:04 +00:00
|
|
|
$(QUANTUM_DIR)/unicode/utf8.c \
|
2022-04-13 08:00:18 +00:00
|
|
|
$(QUANTUM_DIR)/color.c \
|
|
|
|
$(QUANTUM_DIR)/painter/qp.c \
|
2023-03-20 03:13:53 +00:00
|
|
|
$(QUANTUM_DIR)/painter/qp_internal.c \
|
2022-04-13 08:00:18 +00:00
|
|
|
$(QUANTUM_DIR)/painter/qp_stream.c \
|
|
|
|
$(QUANTUM_DIR)/painter/qgf.c \
|
|
|
|
$(QUANTUM_DIR)/painter/qff.c \
|
|
|
|
$(QUANTUM_DIR)/painter/qp_draw_core.c \
|
|
|
|
$(QUANTUM_DIR)/painter/qp_draw_codec.c \
|
|
|
|
$(QUANTUM_DIR)/painter/qp_draw_circle.c \
|
|
|
|
$(QUANTUM_DIR)/painter/qp_draw_ellipse.c \
|
|
|
|
$(QUANTUM_DIR)/painter/qp_draw_image.c \
|
|
|
|
$(QUANTUM_DIR)/painter/qp_draw_text.c
|
|
|
|
|
|
|
|
# Check if people want animations... enable the defered exec if so.
|
|
|
|
ifeq ($(strip $(QUANTUM_PAINTER_ANIMATIONS_ENABLE)), yes)
|
|
|
|
DEFERRED_EXEC_ENABLE := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_ANIMATIONS_ENABLE
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Comms flags
|
2023-10-22 02:27:31 +00:00
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_DUMMY ?= no
|
2022-04-13 08:00:18 +00:00
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI ?= no
|
2023-10-22 02:27:31 +00:00
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_I2C ?= no
|
2022-04-13 08:00:18 +00:00
|
|
|
|
|
|
|
# Handler for each driver
|
|
|
|
define handle_quantum_painter_driver
|
|
|
|
CURRENT_PAINTER_DRIVER := $1
|
|
|
|
|
|
|
|
ifeq ($$(filter $$(strip $$(CURRENT_PAINTER_DRIVER)),$$(VALID_QUANTUM_PAINTER_DRIVERS)),)
|
|
|
|
$$(error "$$(CURRENT_PAINTER_DRIVER)" is not a valid Quantum Painter driver)
|
|
|
|
|
2023-10-22 02:27:31 +00:00
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),surface)
|
|
|
|
QUANTUM_PAINTER_NEEDS_SURFACE := yes
|
2022-09-18 21:30:08 +00:00
|
|
|
|
2022-04-13 08:00:18 +00:00
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ili9163_spi)
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_ILI9163_ENABLE -DQUANTUM_PAINTER_ILI9163_SPI_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel \
|
|
|
|
$(DRIVER_PATH)/painter/ili9xxx
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
|
|
|
|
$(DRIVER_PATH)/painter/ili9xxx/qp_ili9163.c \
|
|
|
|
|
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ili9341_spi)
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_ILI9341_ENABLE -DQUANTUM_PAINTER_ILI9341_SPI_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel \
|
|
|
|
$(DRIVER_PATH)/painter/ili9xxx
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
|
|
|
|
$(DRIVER_PATH)/painter/ili9xxx/qp_ili9341.c \
|
|
|
|
|
2024-02-17 07:36:05 +00:00
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ili9486_spi)
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_ILI9486_ENABLE -DQUANTUM_PAINTER_ILI9486_SPI_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel \
|
|
|
|
$(DRIVER_PATH)/painter/ili9xxx
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
|
|
|
|
$(DRIVER_PATH)/painter/ili9xxx/qp_ili9486.c \
|
|
|
|
|
2022-07-02 03:20:45 +00:00
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ili9488_spi)
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_ILI9488_ENABLE -DQUANTUM_PAINTER_ILI9488_SPI_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel \
|
|
|
|
$(DRIVER_PATH)/painter/ili9xxx
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
|
|
|
|
$(DRIVER_PATH)/painter/ili9xxx/qp_ili9488.c \
|
|
|
|
|
2022-09-18 21:30:08 +00:00
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),st7735_spi)
|
2022-04-13 08:00:18 +00:00
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
2022-09-18 21:30:08 +00:00
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_ST7735_ENABLE -DQUANTUM_PAINTER_ST7735_SPI_ENABLE
|
2022-04-13 08:00:18 +00:00
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel \
|
|
|
|
$(DRIVER_PATH)/painter/st77xx
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
|
2022-09-18 21:30:08 +00:00
|
|
|
$(DRIVER_PATH)/painter/st77xx/qp_st7735.c
|
2022-04-13 08:00:18 +00:00
|
|
|
|
2022-09-18 21:30:08 +00:00
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),st7789_spi)
|
2022-08-01 02:58:25 +00:00
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
2022-09-18 21:30:08 +00:00
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_ST7789_ENABLE -DQUANTUM_PAINTER_ST7789_SPI_ENABLE
|
2022-08-01 02:58:25 +00:00
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel \
|
|
|
|
$(DRIVER_PATH)/painter/st77xx
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
|
2022-09-18 21:30:08 +00:00
|
|
|
$(DRIVER_PATH)/painter/st77xx/qp_st7789.c
|
2022-08-01 02:58:25 +00:00
|
|
|
|
2022-04-13 08:00:18 +00:00
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),gc9a01_spi)
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_GC9A01_ENABLE -DQUANTUM_PAINTER_GC9A01_SPI_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel \
|
2024-06-04 22:41:26 +00:00
|
|
|
$(DRIVER_PATH)/painter/gc9xxx
|
2022-04-13 08:00:18 +00:00
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
|
2024-06-04 22:41:26 +00:00
|
|
|
$(DRIVER_PATH)/painter/gc9xxx/qp_gc9a01.c
|
|
|
|
|
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),gc9107_spi)
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_GC9107_ENABLE -DQUANTUM_PAINTER_GC9107_SPI_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel \
|
|
|
|
$(DRIVER_PATH)/painter/gc9xxx
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
|
|
|
|
$(DRIVER_PATH)/painter/gc9xxx/qp_gc9107.c
|
2022-04-13 08:00:18 +00:00
|
|
|
|
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ssd1351_spi)
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_SSD1351_ENABLE -DQUANTUM_PAINTER_SSD1351_SPI_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel \
|
|
|
|
$(DRIVER_PATH)/painter/ssd1351
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
|
|
|
|
$(DRIVER_PATH)/painter/ssd1351/qp_ssd1351.c
|
|
|
|
|
2023-10-22 02:27:31 +00:00
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),sh1106_spi)
|
|
|
|
QUANTUM_PAINTER_NEEDS_SURFACE := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_SH1106_ENABLE -DQUANTUM_PAINTER_SH1106_SPI_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/oled_panel \
|
|
|
|
$(DRIVER_PATH)/painter/sh1106
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \
|
|
|
|
$(DRIVER_PATH)/painter/sh1106/qp_sh1106.c
|
|
|
|
|
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),sh1106_i2c)
|
|
|
|
QUANTUM_PAINTER_NEEDS_SURFACE := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_I2C := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_SH1106_ENABLE -DQUANTUM_PAINTER_SH1106_I2C_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/oled_panel \
|
|
|
|
$(DRIVER_PATH)/painter/sh1106
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \
|
|
|
|
$(DRIVER_PATH)/painter/sh1106/qp_sh1106.c
|
|
|
|
|
2024-09-18 11:44:33 +00:00
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ld7032_spi)
|
|
|
|
QUANTUM_PAINTER_NEEDS_SURFACE := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_LD7032_ENABLE -DQUANTUM_PAINTER_LD7032_SPI_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/oled_panel \
|
|
|
|
$(DRIVER_PATH)/painter/ld7032
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \
|
|
|
|
$(DRIVER_PATH)/painter/ld7032/qp_ld7032.c
|
|
|
|
|
|
|
|
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ld7032_i2c)
|
|
|
|
QUANTUM_PAINTER_NEEDS_SURFACE := yes
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_I2C := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_LD7032_ENABLE -DQUANTUM_PAINTER_LD7032_I2C_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/oled_panel \
|
|
|
|
$(DRIVER_PATH)/painter/ld7032
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \
|
|
|
|
$(DRIVER_PATH)/painter/ld7032/qp_ld7032.c
|
|
|
|
|
2022-04-13 08:00:18 +00:00
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Iterate through the listed drivers for the build, including what's necessary
|
|
|
|
$(foreach qp_driver,$(QUANTUM_PAINTER_DRIVERS),$(eval $(call handle_quantum_painter_driver,$(qp_driver))))
|
|
|
|
|
2023-10-22 02:27:31 +00:00
|
|
|
# If a surface is needed, set up the required files
|
|
|
|
ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_SURFACE)), yes)
|
|
|
|
QUANTUM_PAINTER_NEEDS_COMMS_DUMMY := yes
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_SURFACE_ENABLE
|
|
|
|
COMMON_VPATH += \
|
|
|
|
$(DRIVER_PATH)/painter/generic
|
|
|
|
SRC += \
|
|
|
|
$(DRIVER_PATH)/painter/generic/qp_surface_common.c \
|
|
|
|
$(DRIVER_PATH)/painter/generic/qp_surface_mono1bpp.c \
|
|
|
|
$(DRIVER_PATH)/painter/generic/qp_surface_rgb565.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
# If dummy comms is needed, set up the required files
|
|
|
|
ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_COMMS_DUMMY)), yes)
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_DUMMY_COMMS_ENABLE
|
|
|
|
VPATH += $(DRIVER_PATH)/painter/comms
|
|
|
|
SRC += \
|
|
|
|
$(QUANTUM_DIR)/painter/qp_comms.c \
|
|
|
|
$(DRIVER_PATH)/painter/comms/qp_comms_dummy.c
|
|
|
|
endif
|
|
|
|
|
2022-04-13 08:00:18 +00:00
|
|
|
# If SPI comms is needed, set up the required files
|
|
|
|
ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_COMMS_SPI)), yes)
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_SPI_ENABLE
|
2023-10-22 02:27:31 +00:00
|
|
|
SPI_DRIVER_REQUIRED = yes
|
2022-04-13 08:00:18 +00:00
|
|
|
VPATH += $(DRIVER_PATH)/painter/comms
|
|
|
|
SRC += \
|
|
|
|
$(QUANTUM_DIR)/painter/qp_comms.c \
|
|
|
|
$(DRIVER_PATH)/painter/comms/qp_comms_spi.c
|
|
|
|
|
|
|
|
ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET)), yes)
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_SPI_DC_RESET_ENABLE
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2023-10-22 02:27:31 +00:00
|
|
|
# If I2C comms is needed, set up the required files
|
|
|
|
ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_COMMS_I2C)), yes)
|
|
|
|
OPT_DEFS += -DQUANTUM_PAINTER_I2C_ENABLE
|
|
|
|
I2C_DRIVER_REQUIRED = yes
|
|
|
|
VPATH += $(DRIVER_PATH)/painter/comms
|
|
|
|
SRC += \
|
|
|
|
$(QUANTUM_DIR)/painter/qp_comms.c \
|
|
|
|
$(DRIVER_PATH)/painter/comms/qp_comms_i2c.c
|
|
|
|
endif
|
|
|
|
|
2022-12-12 20:51:14 +00:00
|
|
|
# Check if LVGL needs to be enabled
|
|
|
|
ifeq ($(strip $(QUANTUM_PAINTER_LVGL_INTEGRATION)), yes)
|
2023-10-22 02:27:31 +00:00
|
|
|
include $(QUANTUM_DIR)/painter/lvgl/rules.mk
|
2022-12-12 20:51:14 +00:00
|
|
|
endif
|