finish
This commit is contained in:
@@ -298,11 +298,11 @@ class ST77xx:
|
||||
|
||||
|
||||
class ST7789(ST77xx):
|
||||
def init(self, *, color_mode=ColorMode_65K | ColorMode_16bit):
|
||||
def init(self, *, color_mode=ColorMode_65K | ColorMode_16bit, is_bgr=False):
|
||||
super().init()
|
||||
self._set_color_mode(color_mode)
|
||||
delay_ms(50)
|
||||
self._set_mem_access_mode(4, True, True, False)
|
||||
self._set_mem_access_mode(4, True, True, is_bgr)
|
||||
self.inversion_mode(True)
|
||||
delay_ms(10)
|
||||
self.write(ST77XX_NORON)
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -684,9 +684,9 @@ def generate_image(prompt, progress_callback=None, retry_count=0, max_retries=2)
|
||||
b5 = (b >> 3) & 0x1F
|
||||
|
||||
# Pack as Big Endian (>H) which is standard for SPI displays
|
||||
# BGR565: Blue(5) Green(6) Red(5)
|
||||
bgr565 = (b5 << 11) | (g6 << 5) | r5
|
||||
rgb565_data.extend(struct.pack('>H', bgr565))
|
||||
# RGB565: Red(5) Green(6) Blue(5)
|
||||
rgb565 = (r5 << 11) | (g6 << 5) | b5
|
||||
rgb565_data.extend(struct.pack('>H', rgb565))
|
||||
|
||||
# 保存为.bin文件
|
||||
with open(GENERATED_THUMB_FILE, 'wb') as f:
|
||||
|
||||
Reference in New Issue
Block a user