Multi screen support, with dyn alignment (#2801)

This commit is contained in:
Totoo 2025-10-03 19:10:10 +02:00 committed by GitHub
parent 23cabb8b8a
commit 371b6b5079
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
161 changed files with 4042 additions and 4157 deletions

View file

@ -34,6 +34,42 @@ using namespace lpc43xx;
namespace portapack {
DeviceType device_type = DEV_PORTAPACK;
void IO::lcd_read_bytes(uint8_t* byte, size_t byte_count) {
if (portapack::device_type == portapack::DeviceType::DEV_PORTAPACK) {
size_t word_count = byte_count / 2;
while (word_count) {
const auto word = lcd_read_data();
*(byte++) = word >> 8;
*(byte++) = word >> 0;
word_count--;
}
if (byte_count & 1) {
const auto word = lcd_read_data();
*(byte++) = word >> 8;
}
return;
}
// prf
//--dummy read:
dir_read();
lcd_rd_assert();
halPolledDelay(71);
data_read();
lcd_rd_deassert();
size_t word_count = byte_count / 3;
for (size_t i = 0; i < word_count; i++) {
uint32_t word = lcd_read_data(); // reads 3 byte of data
uint8_t r = ((word >> 16) & 0xff);
uint8_t g = ((word >> 8) & 0xff);
uint8_t b = ((word >> 0) & 0xff);
*(byte++) = r;
*(byte++) = g << 2;
*(byte++) = b;
}
}
void IO::init() {
data_mask_set();
data_write_high(0);