forked from cskau/Python_ST7735
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
I'm able to get the ST7735 display to be corrupted by doing simultaneous writes from multiple threads (I know this is bad).
What occurs is the color depth lookup tables are getting corrupted. According to the Sitronix datasheet, the LUTs are not defaulted on a SWRESET, only on power up or HWRESET. So app restart or even "sudo reboot" is not enough to correct it.
I was able to account for this by adding code to default the LUTs to the ST7735 module's _init() function.
ST7735_RGBSET = 0x2D
# update color depth lookup tables for 16-bit 565 color.
# these are only reset to defaults after a
# power on or HW reset (not a SW reset).
self.command(ST7735_RGBSET) # Set color LUT (0x2D)
# red (5-bit, 32 colors)
for color in range(0, 32, 2):
self.data(color)
for color in range(33, 64, 2):
self.data(color)
# green (6-bit, 64 colors)
for color in range(0, 64):
self.data(color)
# blue (5-bit, 32 colors)
for color in range(0, 32, 2):
self.data(color)
for color in range(33, 64, 2):
self.data(color)
Metadata
Metadata
Assignees
Labels
No labels