Skip to content

Commit

Permalink
drivers/st7735: support for ST7789
Browse files Browse the repository at this point in the history
ST7735 driver can also be used for ST7789. st7789 is simply defined as pseudomodule that pulls in automatically module st7735.
  • Loading branch information
gschorcht committed Jul 7, 2023
1 parent e487ac5 commit 115a3ea
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drivers/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions drivers/include/st7735.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/


Expand Down
10 changes: 10 additions & 0 deletions drivers/st7735/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions drivers/st7735/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
PSEUDOMODULES += st7789

USEMODULE_INCLUDES_st7735 := $(LAST_MAKEFILEDIR)/include
USEMODULE_INCLUDES += $(USEMODULE_INCLUDES_st7735)
7 changes: 6 additions & 1 deletion drivers/st7735/st7735.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down

0 comments on commit 115a3ea

Please sign in to comment.