mirror of
https://github.com/YuzuZensai/MCUFRIEND_kbv.git
synced 2026-01-31 14:57:48 +00:00
change to readReg(reg, index). larger buffer for init_table()
This commit is contained in:
@@ -144,7 +144,7 @@ uint32_t readReg40(uint16_t reg)
|
|||||||
return ((uint32_t) h << 24) | (m << 8) | (l >> 8);
|
return ((uint32_t) h << 24) | (m << 8) | (l >> 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t MCUFRIEND_kbv::readReg(uint16_t reg)
|
uint16_t MCUFRIEND_kbv::readReg(uint16_t reg, int8_t index)
|
||||||
{
|
{
|
||||||
uint16_t ret;
|
uint16_t ret;
|
||||||
uint8_t lo;
|
uint8_t lo;
|
||||||
@@ -155,7 +155,7 @@ uint16_t MCUFRIEND_kbv::readReg(uint16_t reg)
|
|||||||
setReadDir();
|
setReadDir();
|
||||||
CD_DATA;
|
CD_DATA;
|
||||||
// READ_16(ret);
|
// READ_16(ret);
|
||||||
ret = read16bits();
|
do { ret = read16bits(); }while (--index >= 0); //need to test with SSD1963
|
||||||
RD_IDLE;
|
RD_IDLE;
|
||||||
CS_IDLE;
|
CS_IDLE;
|
||||||
setWriteDir();
|
setWriteDir();
|
||||||
@@ -228,6 +228,8 @@ uint16_t MCUFRIEND_kbv::readID(void)
|
|||||||
}
|
}
|
||||||
if (msb == 0xFF && ret == 0xFFFF) //R61526 [xx FF FF FF]
|
if (msb == 0xFF && ret == 0xFFFF) //R61526 [xx FF FF FF]
|
||||||
return 0x1526; //subsequent begin() enables Command Access
|
return 0x1526; //subsequent begin() enables Command Access
|
||||||
|
if (ret == 0x1526) //R61526 [xx 06 15 26] if I have written NVM
|
||||||
|
return 0x1526; //subsequent begin() enables Command Access
|
||||||
if (ret == 0x8552) //ST7789V: [xx 85 85 52]
|
if (ret == 0x8552) //ST7789V: [xx 85 85 52]
|
||||||
return 0x7789;
|
return 0x7789;
|
||||||
if (ret == 0xAC11) //?unknown [xx 61 AC 11]
|
if (ret == 0xAC11) //?unknown [xx 61 AC 11]
|
||||||
@@ -770,7 +772,7 @@ void MCUFRIEND_kbv::invertDisplay(boolean i)
|
|||||||
#define TFTLCD_DELAY8 0xFF
|
#define TFTLCD_DELAY8 0xFF
|
||||||
static void init_table(const void *table, int16_t size)
|
static void init_table(const void *table, int16_t size)
|
||||||
{
|
{
|
||||||
uint8_t *p = (uint8_t *) table, dat[16];
|
uint8_t *p = (uint8_t *) table, dat[24]; //R61526 has GAMMA[22]
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
uint8_t cmd = pgm_read_byte(p++);
|
uint8_t cmd = pgm_read_byte(p++);
|
||||||
uint8_t len = pgm_read_byte(p++);
|
uint8_t len = pgm_read_byte(p++);
|
||||||
@@ -1020,9 +1022,10 @@ void MCUFRIEND_kbv::begin(uint16_t ID)
|
|||||||
case 0x1526:
|
case 0x1526:
|
||||||
_lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS;
|
_lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS;
|
||||||
static const uint8_t R61526_regValues[] PROGMEM = {
|
static const uint8_t R61526_regValues[] PROGMEM = {
|
||||||
0xB0, 1, 0x03, //Command Access Protect
|
0xB0, 1, 0x03, //Command Access
|
||||||
0xE2, 1, 0x3F, //Command Write Access
|
0xE2, 1, 0x3F, //Command Write Access
|
||||||
0xC0, 1, 0x22, //REV=0, BGR=1, SS=0
|
0xC0, 1, 0x22, //REV=0, BGR=1, SS=0
|
||||||
|
0xE2, 1, 0x00, //Command Write Protect
|
||||||
};
|
};
|
||||||
table8_ads = R61526_regValues, table_size = sizeof(R61526_regValues);
|
table8_ads = R61526_regValues, table_size = sizeof(R61526_regValues);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class MCUFRIEND_kbv : public Adafruit_GFX {
|
|||||||
virtual void setRotation(uint8_t r);
|
virtual void setRotation(uint8_t r);
|
||||||
virtual void invertDisplay(boolean i);
|
virtual void invertDisplay(boolean i);
|
||||||
|
|
||||||
uint16_t readReg(uint16_t reg);
|
uint16_t readReg(uint16_t reg, int8_t index=0);
|
||||||
uint32_t readReg32(uint16_t reg);
|
uint32_t readReg32(uint16_t reg);
|
||||||
int16_t readGRAM(int16_t x, int16_t y, uint16_t *block, int16_t w, int16_t h);
|
int16_t readGRAM(int16_t x, int16_t y, uint16_t *block, int16_t w, int16_t h);
|
||||||
uint16_t readPixel(int16_t x, int16_t y) { uint16_t color; readGRAM(x, y, &color, 1, 1); return color; }
|
uint16_t readPixel(int16_t x, int16_t y) { uint16_t color; readGRAM(x, y, &color, 1, 1); return color; }
|
||||||
|
|||||||
Reference in New Issue
Block a user