diff options
Diffstat (limited to 'quantum/painter/rules.mk')
-rw-r--r-- | quantum/painter/rules.mk | 86 |
1 files changed, 70 insertions, 16 deletions
diff --git a/quantum/painter/rules.mk b/quantum/painter/rules.mk index 7752936cbd..ca81cffb03 100644 --- a/quantum/painter/rules.mk +++ b/quantum/painter/rules.mk @@ -6,14 +6,16 @@ QUANTUM_PAINTER_LVGL_INTEGRATION ?= no # The list of permissible drivers that can be listed in QUANTUM_PAINTER_DRIVERS VALID_QUANTUM_PAINTER_DRIVERS := \ - rgb565_surface \ - ili9163_spi \ - ili9341_spi \ - ili9488_spi \ - st7735_spi \ - st7789_spi \ - gc9a01_spi \ - ssd1351_spi + surface \ + ili9163_spi \ + ili9341_spi \ + ili9488_spi \ + st7735_spi \ + st7789_spi \ + gc9a01_spi \ + ssd1351_spi \ + sh1106_i2c \ + sh1106_spi #------------------------------------------------------------------------------- @@ -42,7 +44,9 @@ ifeq ($(strip $(QUANTUM_PAINTER_ANIMATIONS_ENABLE)), yes) endif # Comms flags +QUANTUM_PAINTER_NEEDS_COMMS_DUMMY ?= no QUANTUM_PAINTER_NEEDS_COMMS_SPI ?= no +QUANTUM_PAINTER_NEEDS_COMMS_I2C ?= no # Handler for each driver define handle_quantum_painter_driver @@ -51,12 +55,8 @@ define handle_quantum_painter_driver ifeq ($$(filter $$(strip $$(CURRENT_PAINTER_DRIVER)),$$(VALID_QUANTUM_PAINTER_DRIVERS)),) $$(error "$$(CURRENT_PAINTER_DRIVER)" is not a valid Quantum Painter driver) - else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),rgb565_surface) - OPT_DEFS += -DQUANTUM_PAINTER_RGB565_SURFACE_ENABLE - COMMON_VPATH += \ - $(DRIVER_PATH)/painter/generic - SRC += \ - $(DRIVER_PATH)/painter/generic/qp_rgb565_surface.c \ + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),surface) + QUANTUM_PAINTER_NEEDS_SURFACE := yes else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ili9163_spi) QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes @@ -135,16 +135,60 @@ define handle_quantum_painter_driver $(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \ $(DRIVER_PATH)/painter/ssd1351/qp_ssd1351.c + 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 + 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)))) +# 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 + # If SPI comms is needed, set up the required files ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_COMMS_SPI)), yes) OPT_DEFS += -DQUANTUM_PAINTER_SPI_ENABLE - QUANTUM_LIB_SRC += spi_master.c + SPI_DRIVER_REQUIRED = yes VPATH += $(DRIVER_PATH)/painter/comms SRC += \ $(QUANTUM_DIR)/painter/qp_comms.c \ @@ -155,7 +199,17 @@ ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_COMMS_SPI)), yes) endif endif +# 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 + # Check if LVGL needs to be enabled ifeq ($(strip $(QUANTUM_PAINTER_LVGL_INTEGRATION)), yes) - include $(QUANTUM_DIR)/painter/lvgl/rules.mk + include $(QUANTUM_DIR)/painter/lvgl/rules.mk endif |