Driver for displays with a ST77xx display controller. More...
Driver for displays with a ST77xx display controller.
The ST77xx display controller driver is a driver for small RGB displays using a ST77xx display controller. The driver supports ST7735, ST7789 and ST7796. The support of the respective controller is enabled by the corresponding module st7735
, st7789
or st7796
. The ST77xx controller used by a display must be specified in the board definition in parameter lcd_params_t::cntrl or as macro ST77XX_PARAM_CNTRL if the default parameter set ST77XX_PARAMS is used.
The driver communicates with the device either via an
lcd_spi
enabled) or anlcd_parallel
or module lcd_parallel_16
is enabled).Usually the device driver is used either for a single display with SPI serial interface or for a display with parallel MCU 8080 8-/16-bit parallel interface. However, the device driver can also be used simultaneously for multiple displays with different interfaces if several of the lcd_spi
, lcd_parallel
and lcd_parallel_16bit
modules are enabled at the same time. In this case, please refer to the notes in lcd_params_t.
The device requires colors to be send in big endian RGB-565 format. The CONFIG_LCD_LE_MODE compile time option can switch this, but only use this 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.
Files | |
file | st77xx.h |
file | st7735_internal.h |
Specific internal definitions for the ST7735 controller variant. | |
file | st7789_internal.h |
Specific internal definitions for the ST7789 controller variant. | |
file | st7796_internal.h |
Specific internal definitions for the ST7789 controller variant. | |
file | st77xx_internal.h |
Internal definitions that are common for all ST77xx controllers. | |
file | st77xx_params.h |
Default configuration for ST77xx LCD controllers. | |
Data Structures | |
struct | st77xx_t |
Device descriptor for a ST77xx display. More... | |
Macros | |
#define | CONFIG_ST7735_CUSTOM_CONFIG 0 |
ST7735 Customized Configuration Enable. | |
#define | CONFIG_ST7735_AVDD 4900 |
ST7735 AVDD voltage (in millivolts) | |
#define | CONFIG_ST7735_GVDD 4600 |
ST7735 GVDD voltage (in millivolts) | |
#define | CONFIG_ST7735_GVCL -4600 |
ST7735 GVL voltage (in millivolts) | |
#define | CONFIG_ST7735_VCOM -775 |
ST7735 VCOM voltage (in millivolts) | |
#define | CONFIG_ST7735_VGH 14700 |
ST7735 VGH voltage (in millivolts) | |
#define | CONFIG_ST7735_VGL -10000 |
ST7735 VGL voltage (in millivolts) | |
#define | CONFIG_ST7789_CUSTOM_CONFIG 0 |
ST7789 Customized Configuration Enable. | |
#define | CONFIG_ST7789_AVDD 6800 |
ST7789 AVDD voltage (in millivolts) | |
#define | CONFIG_ST7789_AVCL -4800 |
ST7789 AVCL voltage (in millivolts) | |
#define | CONFIG_ST7789_VCOM 900 |
ST7789 VCOM voltage (in millivolts) | |
#define | CONFIG_ST7789_VCOM_OFFSET 0 |
ST7789 VCOM voltage offset (in millivolts) | |
#define | CONFIG_ST7789_VDV 0 |
ST7789 VDV voltage (in millivolts) | |
#define | CONFIG_ST7789_VRH 4100 |
ST7789 VRH voltage (in millivolts) | |
#define | CONFIG_ST7796_CUSTOM_CONFIG 0 |
ST7796 Customized Configuration Enable. | |
#define | CONFIG_ST7796_AVDD 6600 |
ST7796 AVDD voltage (in millivolts) | |
#define | CONFIG_ST7796_AVCL -4400 |
ST7796 AVCL voltage (in millivolts) | |
#define | CONFIG_ST7796_VCOM 1000 |
ST7796 VCOM voltage (in millivolts) | |
#define | CONFIG_ST7796_VCOM_OFFSET 0 |
ST7796 VCOM voltage offset (in millivolts) | |
#define | CONFIG_ST7796_VRH 4100 |
ST7796 VRH voltage (in millivolts) | |
Enumerations | |
enum | { ST77XX_CNTRL_ST7735 , ST77XX_CNTRL_ST7789 , ST77XX_CNTRL_ST7796 } |
ST77xx display controller variants. More... | |
Variables | |
const lcd_driver_t | lcd_st77xx_driver |
LCD device operations table. | |
ST77xx display rotation modes | |
Usually the dimension of an LCD is defined by W x H (width x height) in pixels, where width is the smaller dimension than height, e.g. 240 x 320 (W x H). The height is then used as parameter ST77XX_PARAM_NUM_LINES and the width as parameter ST77XX_PARAM_RGB_CHANNELS. So vertical orientation means no rotation. Vertical orientation is given when the connector is shown at the bottom of the display. For example, the ST7789 controller supports 320 gate outputs and 240 source outputs (RGB channels). A display with a size of 240 x 320 (W x H) pixels can be used by setting However, if the ST7789 is used with a display of 240 x 240 (W x H) pixels and a rotation is used, an offset must be defined for X or Y because the origin of the image will change. For example, in the case of ST77XX_ROTATION_90 an offset for X would have to be defined by Using the correct offset on rotation can be even more difficult if the display size in both dimensions is smaller than the size supported by the controller. In this case, the origin can deviate from 0, 0 even without rotation. | |
#define | ST77XX_ROTATION_VERT 0 |
Vertical mode. | |
#define | ST77XX_ROTATION_VERT_FLIP |
Flipped vertical. | |
#define | ST77XX_ROTATION_HORZ |
Horizontal mode. | |
#define | ST77XX_ROTATION_HORZ_FLIP |
Horizontal flipped. | |
#define | ST77XX_ROTATION_0 0 |
0 deg counterclockwise | |
#define | ST77XX_ROTATION_90 |
90 deg counterclockwise | |
#define | ST77XX_ROTATION_180 |
180 deg counterclockwise | |
#define | ST77XX_ROTATION_270 |
270 deg counterclockwise | |
#define CONFIG_ST7735_AVDD 4900 |
#define CONFIG_ST7735_CUSTOM_CONFIG 0 |
#define CONFIG_ST7735_GVCL -4600 |
#define CONFIG_ST7735_GVDD 4600 |
#define CONFIG_ST7735_VCOM -775 |
ST7735 VCOM voltage (in millivolts)
A default voltage of -0.425V is used for VCOM. VCOM needs to be adjusted to match the capacitance and performance specifications of the TFT panel to maximize contrast and minimize flickering. Valid values must be in the range of -2000 (-2.0V) to -425 (-0.425V) in steps of 25.
#define CONFIG_ST7735_VGH 14700 |
#define CONFIG_ST7735_VGL -10000 |
#define CONFIG_ST7789_AVCL -4800 |
#define CONFIG_ST7789_AVDD 6800 |
#define CONFIG_ST7789_CUSTOM_CONFIG 0 |
#define CONFIG_ST7789_VCOM 900 |
ST7789 VCOM voltage (in millivolts)
A default voltage of 0.9V is used for VCOM. VCOM needs to be adjusted to match the capacitance and performance specifications of the TFT panel to maximize contrast and minimize flickering. VCOM is used to derive the GVDD (gamma reference positive voltage) and the GVCL (gamma reference negative voltage) as follows:
GDDV = +VRH + VCOM + VCOM_OFFSET + (0.5 * VDV) GVCL = -VRH + VCOM + VCOM_OFFSET - (0.5 * VDV)
Valid values must be in the range of 100 (0.1V) to 1675 (1.675V) in steps of 25.
#define CONFIG_ST7789_VCOM_OFFSET 0 |
ST7789 VCOM voltage offset (in millivolts)
A default voltage of 0V is used for VCOM voltage offset (VCOM_OFFSET). VCOM_OFFSET is used to derive the GVDD (gamma reference positive voltage) and the GVCL (gamma reference negative voltage) as follows:
GDDV = +VRH + VCOM + VCOM_OFFSET + (0.5 * VDV) GVCL = -VRH + VCOM + VCOM_OFFSET - (0.5 * VDV)
Valid values must be in the range of -800 (-0.8V) to 775 (0.775V) in steps of 25.
#define CONFIG_ST7789_VDV 0 |
ST7789 VDV voltage (in millivolts)
A default voltage of 0V is used for VDV. VDV is used to derive the GVDD (gamma reference positive voltage) and the GVCL (gamma reference negative voltage) as follows:
GDDV = +VRH + VCOM + VCOM_OFFSET + (0.5 * VDV) GVCL = -VRH + VCOM + VCOM_OFFSET - (0.5 * VDV)
Valid values must be in the range of -800 (-0.8V) to 775 (0.775V) in steps of 25.
#define CONFIG_ST7789_VRH 4100 |
ST7789 VRH voltage (in millivolts)
A default voltage of 4.1V is used for VRH. VRH is used to derive the GVDD (gamma reference positive voltage) and the GVCL (gamma reference negative voltage) as follows:
GDDV = +VRH + VCOM + VCOM_OFFSET + (0.5 * VDV) GVCL = -VRH + VCOM + VCOM_OFFSET - (0.5 * VDV)
Valid values must be in the range of 3350 (3.35V) to 5500 (5.5V) in steps of 50.
#define CONFIG_ST7796_AVCL -4400 |
#define CONFIG_ST7796_AVDD 6600 |
#define CONFIG_ST7796_CUSTOM_CONFIG 0 |
#define CONFIG_ST7796_VCOM 1000 |
ST7796 VCOM voltage (in millivolts)
A default voltage of 1.0V is used for VCOM. VCOM needs to be adjusted to match the capacitance and performance specifications of the TFT panel to maximize contrast and minimize flickering. VCOM is used to derive the GVDD (gamma reference positive voltage) and the GVCL (gamma reference negative voltage) as follows:
GDDV = +VRH + VCOM + VCOM_OFFSET GVCL = -VRH + VCOM + VCOM_OFFSET
Valid values must be in the range of 100 (0.1V) to 1875 (1.875V) in steps of 25.
#define CONFIG_ST7796_VCOM_OFFSET 0 |
ST7796 VCOM voltage offset (in millivolts)
A default voltage of 0V is used for VCOM voltage offset (VCOM_OFFSET). VCOM_OFFSET is used to derive the GVDD (gamma reference positive voltage) and the GVCL (gamma reference negative voltage) as follows:
GDDV = +VRH + VCOM + VCOM_OFFSET GVCL = -VRH + VCOM + VCOM_OFFSET
Valid values must be in the range of -800 (-0.8V) to 775 (0.775V) in steps of 25.
#define CONFIG_ST7796_VRH 4100 |
ST7796 VRH voltage (in millivolts)
A default voltage of 4.1V is used for VRH. VRH is used to derive the GVDD (gamma reference positive voltage) and the GVCL (gamma reference negative voltage) as follows:
GDDV = +VRH + VCOM + VCOM_OFFSET GVCL = -VRH + VCOM + VCOM_OFFSET
Valid values must be in the range of 3350 (3.35V) to 5500 (5.5V) in steps of 50.
#define ST77XX_ROTATION_180 |
180 deg counterclockwise
#define ST77XX_ROTATION_270 |
270 deg counterclockwise
#define ST77XX_ROTATION_90 |
90 deg counterclockwise
#define ST77XX_ROTATION_HORZ |
#define ST77XX_ROTATION_HORZ_FLIP |
#define ST77XX_ROTATION_VERT_FLIP |