Skip to content

Commit 241e161

Browse files
Update st7789py_parallel.py
1 parent 172d8bb commit 241e161

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

lib/st7789py_parallel.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# Extended Class to use TFT ST7789 in parallel bus
2+
#Example of use:
3+
4+
# import st7789py_parallel
5+
# s=st7789py_parallel.ST7789_PARALLEL(320,240,0,None,None,4,22,5,12)
6+
# s.fill(0xff)
7+
28

39
from micropython import const
410
from utime import sleep_ms, sleep_us
@@ -7,21 +13,21 @@
713
## Pins (wiring) example and description
814
#ST7789 STM32F407VGT6
915
#LCD_RST <---> 3.3V #LCD reset control pin, active low, used to force a hardware reset of the board, if unused need be plug on 3.3V
10-
#LCD_CS <---> GND #LCD chip select control pin, active low, if used only one LCD can be plug on GND
11-
#LCD_RS <---> PD13 #LCD register command / data selection control pin, comand active low, data active high
12-
#LCD_WR <---> PD5 #LCD write control pin, active low
13-
#LCD_RD <---> PD4 #LCD read control pin, active low
16+
#LCD_CS <---> GND #LCD chip select control pin, active low, if unused only one LCD can be used, plug on GND
17+
#LCD_RS <---> PD22 #LCD register command / data selection control pin, comand active low, data active high
18+
#LCD_WR <---> PD4 #LCD write control pin, active low
19+
#LCD_RD <---> PD5 #LCD read control pin, active low, if unused plug on 3.3V
1420
#GND <---> GND
1521
#5V <---> 5V
1622

17-
#LCD_D2 <---> PD0
18-
#LCD_D3 <---> PD1
19-
#LCD_D4 <---> PE7
20-
#LCD_D5 <---> PE8
21-
#LCD_D6 <---> PE9
22-
#LCD_D7 <---> PE10
23-
#LCD_D0 <---> PD14
24-
#LCD_D1 <---> PD15
23+
#LCD_D2 <---> pin-14
24+
#LCD_D3 <---> pin-15
25+
#LCD_D4 <---> pin-16
26+
#LCD_D5 <---> pin-17
27+
#LCD_D6 <---> pin-18
28+
#LCD_D7 <---> pin-19
29+
#LCD_D0 <---> pin-12
30+
#LCD_D1 <---> pin-13
2531

2632
## DEFINE PINS CONST
2733
_LCD_RST = const(None) #LCD reset control pin, active low
@@ -66,6 +72,8 @@ def _encode_pixel(color):
6672
"""Encode a pixel color into bytes."""
6773
return struct.pack(_ENCODE_PIXEL, color)
6874

75+
76+
6977
class ST7789_PARALLEL(ST7789):
7078
def __init__(self, width:(int) = 320, height:(int) = 240, rotation=0,
7179
rst_pin:(int,None) = _LCD_RST, # LCD reset control pin

0 commit comments

Comments
 (0)