diff --git a/drivers/Makefile.dep b/drivers/Makefile.dep index 9be99ff67e82..46b78b5cd747 100644 --- a/drivers/Makefile.dep +++ b/drivers/Makefile.dep @@ -204,6 +204,10 @@ ifneq (,$(filter stmpe811_%,$(USEMODULE))) USEMODULE += stmpe811 endif +ifneq (,$(filter st7789,$(USEMODULE))) + USEMODULE += st7735 +endif + ifneq (,$(filter sx126%,$(USEMODULE))) USEMODULE += sx126x endif diff --git a/drivers/include/st7735.h b/drivers/include/st7735.h index 8198c08ebf43..ccc0e10efa86 100644 --- a/drivers/include/st7735.h +++ b/drivers/include/st7735.h @@ -28,6 +28,10 @@ * when strictly necessary. This option will slow down the driver as it * certainly can't use DMA anymore, every short has to be converted before * transfer. + * + * @note The driver can also be used for the ST7789 which is compatible with + * the ST7735 but supports higher resolutions. Just enable the module + * `st7789` instead of `st7735` if your board uses the ST7789. */ diff --git a/drivers/st7735/Kconfig b/drivers/st7735/Kconfig index f914e59f19e7..40fa5643b727 100644 --- a/drivers/st7735/Kconfig +++ b/drivers/st7735/Kconfig @@ -22,6 +22,16 @@ config HAVE_ST7735 help Indicates that an ST7735 display is present. +config MODULE_ST7789 + bool "ST7789 display driver" + select MODULE_ST7735 + +config HAVE_ST7789 + bool + select MODULE_ST7789 if MODULE_DISP_DEV + help + Indicates that an ST7789 display is present. + menuconfig KCONFIG_USEMODULE_ST7735 bool "Configure ST7735 driver" depends on USEMODULE_ST7735 diff --git a/drivers/st7735/Makefile.include b/drivers/st7735/Makefile.include index 6bd23d7e46b2..4958157cd4d4 100644 --- a/drivers/st7735/Makefile.include +++ b/drivers/st7735/Makefile.include @@ -1,2 +1,4 @@ +PSEUDOMODULES += st7789 + USEMODULE_INCLUDES_st7735 := $(LAST_MAKEFILEDIR)/include USEMODULE_INCLUDES += $(USEMODULE_INCLUDES_st7735) diff --git a/drivers/st7735/st7735.c b/drivers/st7735/st7735.c index c95e5588642e..2c7deef504da 100644 --- a/drivers/st7735/st7735.c +++ b/drivers/st7735/st7735.c @@ -66,7 +66,12 @@ static uint8_t _st7735_calc_vml(int16_t vcoml) static int _init(lcd_t *dev, const lcd_params_t *params) { - assert(params->lines <= 162); + if (IS_USED(MODULE_ST7789)) { + assert(params->lines <= 320); + } + else { + assert(params->lines <= 162); + } dev->params = params; uint8_t command_params[4] = { 0 };