Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 44 additions & 6 deletions src/HT_E0213A367.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,52 @@ class HT_E0213A367 : public ScreenDisplay

setPartialRamArea(0,0,128, 250);
sendCommand(0x24);
for(int x=0; x<250; x++)

if (rotate_angle == ANGLE_0_DEGREE)
{
for(int x=0; x<250; x++)
{
for (int y = 15; y >= 0; y--)
{
if (y == 0)
sendData(~(buffer[x + y * 256] << 6));
else
sendData(~((buffer[x + y * 256] << 6) | (buffer[x + (y - 1) * 256] >> 2)));
}
}
}
else if (rotate_angle == ANGLE_180_DEGREE)
{
for(int x = 249; x >= 0; x--)
{
for (int y = 0; y < 16; y++)
{
uint8_t byte_data;
if (y == 15)
byte_data = buffer[x + y * 256] >> 2;
else
byte_data = (buffer[x + y * 256] >> 2) | (buffer[x + (y + 1) * 256] << 6);

uint8_t reversed = 0;
for (int bit = 0; bit < 8; bit++) {
reversed |= ((byte_data >> bit) & 1) << (7 - bit);
}

sendData(~reversed);
}
}
}
else
{
for (int y = 15; y >= 0; y--)
for(int x=0; x<250; x++)
{
if (y == 0)
sendData(~(buffer[x + y * 256] << 6));
else
sendData(~((buffer[x + y * 256] << 6) | (buffer[x + (y - 1) * 256] >> 2)));
for (int y = 15; y >= 0; y--)
{
if (y == 0)
sendData(~(buffer[x + y * 256] << 6));
else
sendData(~((buffer[x + y * 256] << 6) | (buffer[x + (y - 1) * 256] >> 2)));
}
}
}
}
Expand Down
23 changes: 9 additions & 14 deletions src/HT_lCMEN2R13EFC1.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,27 +118,22 @@ class HT_ICMEN2R13EFC1 : public ScreenDisplay
}
else
{
fSPI.beginTransaction(SPISettings(6000000, MSBFIRST, SPI_MODE0));
fSPI.beginTransaction(SPISettings(6000000, LSBFIRST, SPI_MODE0));
for (int x = 250 - 1; x >= 0; x--)
{
for (int y = (ymax - 1); y >= 0; y--)
{
// if(addr==0x24)
if (addr == 0x13)

{
if (y == 0)
fSPI.transfer(~(buffer[x + y * xmax] << 6));
else
fSPI.transfer(~((buffer[x + y * xmax] << 6) | (buffer[x + (y - 1) * xmax] >> 2)));
uint8_t byte_data = buffer[x + y * xmax];
uint8_t reversed_byte = 0;
for (int bit = 0; bit < 8; bit++) {
reversed_byte |= ((byte_data >> bit) & 1) << (7 - bit);
}

if (addr == 0x13)
fSPI.transfer(~reversed_byte);
else
{
if (y == 0)
fSPI.transfer(buffer[x + y * xmax] << 6);
else
fSPI.transfer((buffer[x + y * xmax] << 6) | (buffer[x + (y - 1) * xmax] >> 2));
}
fSPI.transfer(reversed_byte);
}
}
}
Expand Down