mirror of
https://github.com/YuzuZensai/MCUFRIEND_kbv.git
synced 2026-03-30 14:25:29 +00:00
Merge remote-tracking branch 'refs/remotes/origin/test_7793'
This commit is contained in:
@@ -358,7 +358,7 @@ int16_t MCUFRIEND_kbv::readGRAM(int16_t x, int16_t y, uint16_t * block, int16_t
|
|||||||
|
|
||||||
void MCUFRIEND_kbv::setRotation(uint8_t r)
|
void MCUFRIEND_kbv::setRotation(uint8_t r)
|
||||||
{
|
{
|
||||||
uint16_t GS, SS_v, ORG, REV = _lcd_rev;
|
uint16_t GS, SS_v, ORG, REV = _lcd_rev, NL;
|
||||||
uint8_t val, d[3];
|
uint8_t val, d[3];
|
||||||
rotation = r & 3; // just perform the operation ourselves on the protected variables
|
rotation = r & 3; // just perform the operation ourselves on the protected variables
|
||||||
_width = (rotation & 1) ? HEIGHT : WIDTH;
|
_width = (rotation & 1) ? HEIGHT : WIDTH;
|
||||||
@@ -472,9 +472,11 @@ void MCUFRIEND_kbv::setRotation(uint8_t r)
|
|||||||
case 0xB509:
|
case 0xB509:
|
||||||
_MC = 0x200, _MP = 0x201, _MW = 0x202, _SC = 0x210, _EC = 0x211, _SP = 0x212, _EP = 0x213;
|
_MC = 0x200, _MP = 0x201, _MW = 0x202, _SC = 0x210, _EC = 0x211, _SP = 0x212, _EP = 0x213;
|
||||||
GS = (val & 0x80) ? (1 << 15) : 0;
|
GS = (val & 0x80) ? (1 << 15) : 0;
|
||||||
uint16_t NL;
|
NL = ((400 / 8) - 1) << 9; // 400 rows
|
||||||
NL = ((432 / 8) - 1) << 9;
|
if (_lcd_ID == 0x9326 || _lcd_ID == 0x5420) { //NL and SCN are in diff position
|
||||||
if (_lcd_ID == 0x9326 || _lcd_ID == 0x5420) NL >>= 1;
|
if (GS) GS |= (4 << 0); //start SCN at row 32 PLEASE TEST ILI9326, SPFD5420
|
||||||
|
NL >>= 1;
|
||||||
|
}
|
||||||
WriteCmdData(0x400, GS | NL);
|
WriteCmdData(0x400, GS | NL);
|
||||||
goto common_SS;
|
goto common_SS;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -334,8 +334,8 @@ static __attribute((always_inline))
|
|||||||
#define RESET_PORT PORTD //n.c. on Open-Smart shields
|
#define RESET_PORT PORTD //n.c. on Open-Smart shields
|
||||||
#define RESET_PIN 2 // aliexpress.com/store/1199788
|
#define RESET_PIN 2 // aliexpress.com/store/1199788
|
||||||
|
|
||||||
#define BMASK B00101111
|
#define BMASK 0b00101111
|
||||||
#define DMASK B11010000
|
#define DMASK 0b11010000
|
||||||
|
|
||||||
#define write_8(x) { \
|
#define write_8(x) { \
|
||||||
PORTD = (PORTD & ~DMASK) | ((x) & DMASK); \
|
PORTD = (PORTD & ~DMASK) | ((x) & DMASK); \
|
||||||
@@ -368,7 +368,7 @@ static __attribute((always_inline))
|
|||||||
#define RESET_PORT PORTF
|
#define RESET_PORT PORTF
|
||||||
#define RESET_PIN 1 // n/a. so mimic WR_PIN
|
#define RESET_PIN 1 // n/a. so mimic WR_PIN
|
||||||
|
|
||||||
#define BMASK B10110000 //D13, D11, D10
|
#define BMASK 0b10110000 //D13, D11, D10
|
||||||
#define GMASK 0x20 //D4
|
#define GMASK 0x20 //D4
|
||||||
#define HMASK 0x78 //D6, D7, D8, D9
|
#define HMASK 0x78 //D6, D7, D8, D9
|
||||||
|
|
||||||
@@ -392,15 +392,15 @@ static __attribute((always_inline)) void write_8(uint8_t val)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define write_8(x) { \
|
#define write_8(x) { \
|
||||||
PORTH = (PORTH&~HMASK)|(((x)&B11000000)>>3)|(((x)&B00000011)<<5); \
|
PORTH = (PORTH&~HMASK)|(((x)& 0b11000000)>>3)|(((x)& 0b00000011)<<5); \
|
||||||
PORTB = (PORTB&~BMASK)|(((x)&B00101100)<<2); \
|
PORTB = (PORTB&~BMASK)|(((x)& 0b00101100)<<2); \
|
||||||
PORTG = (PORTG&~GMASK)|(((x)&B00010000)<<1); \
|
PORTG = (PORTG&~GMASK)|(((x)& 0b00010000)<<1); \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define read_8()(\
|
#define read_8()(\
|
||||||
((PINH & B00011000) << 3) | ((PINB & BMASK) >> 2) | \
|
((PINH & 0b00011000) << 3) | ((PINB & BMASK) >> 2) | \
|
||||||
((PING & GMASK) >> 1) | ((PINH & B01100000) >> 5) )
|
((PING & GMASK) >> 1) | ((PINH & 0b01100000) >> 5) )
|
||||||
#define setWriteDir() { DDRH |= HMASK; DDRB |= BMASK; DDRG |= GMASK; }
|
#define setWriteDir() { DDRH |= HMASK; DDRB |= BMASK; DDRG |= GMASK; }
|
||||||
#define setReadDir() { DDRH &= ~HMASK; DDRB &= ~BMASK; DDRG &= ~GMASK; }
|
#define setReadDir() { DDRH &= ~HMASK; DDRB &= ~BMASK; DDRG &= ~GMASK; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user