From 7599ce7b0024e90eb9170b2dc013281cdcab47f3 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Fri, 14 Jul 2023 00:27:05 +0200 Subject: [PATCH] drivers/st77xx: expose configuration parameters in Kconfig --- drivers/st77xx/Kconfig.st7735 | 68 +++++++++++++++++++++++++ drivers/st77xx/Kconfig.st7789 | 94 +++++++++++++++++++++++++++++++++++ drivers/st77xx/Kconfig.st7796 | 79 +++++++++++++++++++++++++++++ 3 files changed, 241 insertions(+) diff --git a/drivers/st77xx/Kconfig.st7735 b/drivers/st77xx/Kconfig.st7735 index 62b6ad1e5240..ac2a80d6adea 100644 --- a/drivers/st77xx/Kconfig.st7735 +++ b/drivers/st77xx/Kconfig.st7735 @@ -13,4 +13,72 @@ config MODULE_ST7735 help ST7735 display controller is used +if MODULE_ST7735 + +menuconfig ST7735_CUSTOM_CONFIG + bool "ST7735 Custom Configuration" + help + Enable if customized configuration of voltages are needed. Otherwise + reset default values are used. + +if ST7735_CUSTOM_CONFIG + +config ST7735_AVDD + int "AVDD voltage (in millivolts)" + default 4900 + range 4500 5100 + help + Configure the AVDD voltage for analog circuits in millivolts. + Valid values must be in the range of 4500 (4.5V) to 5100 (5.1V) + in steps of 100. + +config ST7735_GVDD + int "GVDD voltage (in millivolts)" + default 4600 + range 3150 4700 + help + Configure the GVDD voltage, the gamma reference positive voltage. + Valid values must be in the range of 3150 (3.15V) to 4700 (4.7V) + in steps of 50. + +config ST7735_GVCL + int "GVCL voltage (in millivolts)" + default -4600 + range -4700 -3150 + help + Configure the GVCL voltage, the gamma reference negative voltage. + Valid values must be in the range of -4700 (-4.7V) to -3150 (-3.15V) + in steps of 50. + +config ST7735_VCOM + int "VCOM voltage (in millivolts)" + default -775 + range -2000 -425 + help + Configure the VCOM voltage. 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. + +config ST7735_VGH + int "VGH voltage (in millivolts)" + default 14700 + range 10000 15000 + help + Configure the high voltage for gate drivers in millivolts. + Valid values must be in the range of 10000 (10V) to 15000 (15V) and + in the range of (2 * AVDD + 2.1V) and (3 * AVDD + 2.4 V). + +config ST7735_VGL + int "VGL voltage (in millivolts)" + default -10000 + range -13000 -7500 + help + Configure the low voltage for gate drivers in millivolts. + Valid values must be in the range of -13000 (-13V) to -7500 (-7.5V) + in steps of 2500. + +endif # ST7735_CUSTOM_CONFIG +endif # MODULE_ST7735 endif # MODULE_ST77XX diff --git a/drivers/st77xx/Kconfig.st7789 b/drivers/st77xx/Kconfig.st7789 index 7acbfd58a6ab..ba1e4a72094d 100644 --- a/drivers/st77xx/Kconfig.st7789 +++ b/drivers/st77xx/Kconfig.st7789 @@ -13,4 +13,98 @@ config MODULE_ST7789 help ST7789 display controller is used +if MODULE_ST7789 + +menuconfig ST7789_CUSTOM_CONFIG + bool "ST7789 Custom Configuration" + help + Enable if customized configuration of voltages are needed. Otherwise + reset default values are used. + +if ST7789_CUSTOM_CONFIG + +config ST7789_AVDD + int "AVDD voltage (in millivolts)" + default 6600 + range 6400 6800 + help + Configure the AVDD voltage for analog circuits in millivolts. + Valid values must be in the range of 6400 (6.4V) to 6800 (6.8V) + in steps of 200. + +config ST7789_AVCL + int "AVDD voltage (in millivolts)" + default -4400 + range -5000 -4400 + help + Configure the AVCL voltage in millivolts. + Valid values must be in the range of -5000 (-5V) to -4400 (-4.4V) + in steps of 200. + +config ST7789_VCOM + int "VCOM voltage (in millivolts)" + default 900 + range 100 1675 + help + Configure the VCOM voltage level. 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. + +config ST7789_VCOM_OFFSET + int "VCOM voltage offset (in millivolts)" + default 0 + range -800 775 + help + Configure the 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. + +config ST7789_VDV + int "VDV voltage offset factor (in millivolts)" + default 0 + range -800 775 + help + Configure the VDV voltage offset factor. 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. + +config ST7789_VRH + int "VRH voltage range (in millivolts)" + default 4100 + range 3550 5500 + help + Configure the VRH voltage range. 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. + +# TODO ST7789_VGH and ST7789_VGL (non linear values) + +endif # ST7789_CUSTOM_CONFIG +endif # MODULE_ST7789 endif # MODULE_ST77XX diff --git a/drivers/st77xx/Kconfig.st7796 b/drivers/st77xx/Kconfig.st7796 index ce09399b1632..295f3ea2bf02 100644 --- a/drivers/st77xx/Kconfig.st7796 +++ b/drivers/st77xx/Kconfig.st7796 @@ -13,4 +13,83 @@ config MODULE_ST7796 help ST7796 display controller is used +if MODULE_ST7796 + +menuconfig ST7796_CUSTOM_CONFIG + bool "ST7796 Custom Configuration" + help + Enable if customized configuration of voltages are needed. Otherwise + reset default values are used. + +if ST7796_CUSTOM_CONFIG + +config ST7796_AVDD + int "AVDD voltage (in millivolts)" + default 6600 + range 6200 6800 + help + Configure the AVDD voltage for analog circuits in millivolts. + Valid values must be in the range of 6200 (6.2V) to 6800 (6.8V) + in steps of 200. + +config ST7796_AVCL + int "AVDD voltage (in millivolts)" + default -4400 + range -5000 -4400 + help + Configure the AVCL voltage in millivolts. + Valid values must be in the range of -5000 (-5V) to -4400 (-4.4V) + in steps of 200. + +config ST7796_VCOM + int "VCOM voltage (in millivolts)" + default 1000 + range 300 1875 + help + Configure the VCOM voltage level. 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 300 (0.3V) to 1875 (1.875V) + in steps of 25. + +config ST7796_VCOM_OFFSET + int "VCOM voltage offset (in millivolts)" + default 0 + range -800 775 + help + Configure the 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. + +config ST7796_VRH + int "VRH voltage range (in millivolts)" + default 4500 + range 3550 5500 + help + Configure the VRH voltage range. 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. + +# TODO ST7796_VGH and ST7796_VGL (non linear values) + +endif # ST7796_CUSTOM_CONFIG +endif # MODULE_ST7796 endif # MODULE_ST77XX