Re: [PATCH v3 3/3] drm/tinydrm: add driver for ST7735R panels

From: Noralf TrÃnnes
Date: Sun Dec 31 2017 - 11:19:16 EST



Den 21.12.2017 20.35, skrev David Lechner:
On 12/21/2017 01:23 PM, David Lechner wrote:
This adds a new driver for Sitronix ST7735R display panels.

This has been tested using an Adafruit 1.8" TFT.

Signed-off-by: David Lechner <david@xxxxxxxxxxxxxx>
---

<snip>

+ÂÂÂ mipi_dbi_command(mipi, ST7735R_GAMCTRP1, 0x0f, 0x1a, 0x0f, 0x18, 0x2f,
+ÂÂÂÂÂÂÂÂÂÂÂÂ 0x28, 0x20, 0x22, 0x1f, 0x1b, 0x23, 0x37, 0x00, 0x07,
+ÂÂÂÂÂÂÂÂÂÂÂÂ 0x02, 0x10);
+ÂÂÂ mipi_dbi_command(mipi, ST7735R_GAMCTRN1, 0x0f, 0x1b, 0x0f, 0x17, 0x33,
+ÂÂÂÂÂÂÂÂÂÂÂÂ 0x2c, 0x29, 0x2e, 0x30, 0x30, 0x39, 0x3f, 0x00, 0x07,
+ÂÂÂÂÂÂÂÂÂÂÂÂ 0x03, 0x10);
By the way, how do you know what is the "right" gamma curve? I think I copied this from the generic st7735r driver in fbtft, but I noticed that there is also a different curve for the Adafruit 1.8" display in fbtft. I'm wondering if I should have used that one instead. I can't really tell a difference looking at the display.

From what I can tell this is the curve used by the Arduino library:

https://github.com/adafruit/Adafruit-ST7735-Library/blob/master/Adafruit_ST7735.cpp

static const uint8_t PROGMEM
 Rcmd3[] = { // Init for 7735R, part 3 (red or green tab)
ÂÂÂ 4,ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ //Â 4 commands in list:
ÂÂÂ ST7735_GMCTRP1, 16ÂÂÂÂÂ , //Â 1: Magical unicorn dust, 16 args, no delay:
ÂÂÂÂÂ 0x02, 0x1c, 0x07, 0x12,
ÂÂÂÂÂ 0x37, 0x32, 0x29, 0x2d,
ÂÂÂÂÂ 0x29, 0x25, 0x2B, 0x39,
ÂÂÂÂÂ 0x00, 0x01, 0x03, 0x10,
ÂÂÂ ST7735_GMCTRN1, 16ÂÂÂÂÂ , //Â 2: Sparkles and rainbows, 16 args, no delay:
ÂÂÂÂÂ 0x03, 0x1d, 0x07, 0x06,
ÂÂÂÂÂ 0x2E, 0x2C, 0x29, 0x2D,
ÂÂÂÂÂ 0x2E, 0x2E, 0x37, 0x3F,
ÂÂÂÂÂ 0x00, 0x00, 0x02, 0x10,

void Adafruit_ST7735::initR(uint8_t options) {
 commonInit(Rcmd1);
...
 commandList(Rcmd3);


Noralf.