Optimize ST7796 driver: Use bulk SPI transfers and blocking DMA for higher framerate

This commit is contained in:
Adolfo Reyna
2026-02-11 11:40:26 -05:00
parent 47fc02f05c
commit b59d716965
4 changed files with 69 additions and 2 deletions

View File

@@ -61,7 +61,11 @@ void LowLevelDisplayST7796::draw_buffer(const uint8_t* bit_buffer) {
}
// Draw entire buffer at once
st7796_set_cursor(0, 0);
st7796_write(rgb_buffer, width * height);
// Use raw write for speed.
// Since we only use 0x0000 (Black) and 0xFFFF (White), endianness doesn't matter.
// 0x0000 -> 0x00, 0x00 (LE) -> Display sees 0x00, 0x00 (0x0000 correct)
// 0xFFFF -> 0xFF, 0xFF (LE) -> Display sees 0xFF, 0xFF (0xFFFF correct)
st7796_write_raw((const uint8_t*)rgb_buffer, width * height * 2);
}
void LowLevelDisplayST7796::refresh() {