Skip to content

Commit 2ee204e

Browse files
committed
feature: Release 0.1.0 version
1. Added vertical scrolling. 2. Optimize sample code. 3. Add some interesting examples. 4. Uniform file encoding style Signed-off-by: lbuque <[email protected]>
1 parent 3b23248 commit 2ee204e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1605
-1117
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.vscode
1+
.vscode
2+
lcd_binding_micropython.code-workspace

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ Supported boards:
3636

3737
| Driver IC | Hardware SPI | Software SPI | Hardware QSPI | I8080 | DPI(RGB) |
3838
| --------- | ---------------- | ---------------- | ---------------- | ---------------- | ---------------- |
39-
| ESP32 | ![alt text][1] | ![alt text][4] | ![alt text][1] | ![alt text][1] | ![alt text][2] |
40-
| ESP32-C3 | ![alt text][3] | ![alt text][4] | ![alt text][3] | ![alt text][2] | ![alt text][2] |
41-
| ESP32-S2 | ![alt text][3] | ![alt text][4] | ![alt text][3] | ![alt text][3] | ![alt text][2] |
42-
| ESP32-S3 | ![alt text][1] | ![alt text][4] | ![alt text][1] | ![alt text][1] | ![alt text][1] |
39+
| ESP32 | ![alt text][1] | ![alt text][1] | ![alt text][1] | ![alt text][1] | ![alt text][2] |
40+
| ESP32-C3 | ![alt text][4] | ![alt text][4] | ![alt text][4] | ![alt text][2] | ![alt text][2] |
41+
| ESP32-S2 | ![alt text][4] | ![alt text][4] | ![alt text][4] | ![alt text][4] | ![alt text][2] |
42+
| ESP32-S3 | ![alt text][1] | ![alt text][1] | ![alt text][1] | ![alt text][1] | ![alt text][1] |
4343

4444
[1]: https://camo.githubusercontent.com/bd5f5f82b920744ff961517942e99a46699fee58737cd9b31bf56e5ca41b781b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d737570706f727465642d677265656e
4545
[2]: https://img.shields.io/badge/-not%20support-lightgrey
File renamed without changes.

docs/en/api-reference/lcd.I8080.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ The I8080 class implements the general control and access interface of the I8080
66
Constructors
77
------------
88

9-
.. class:: I8080(data: tuple=None, command: Pin=None, write: Pin=None, read: Pin=None, cs: Pin=None, pclk: int= 10000000, width: int=240, height: int=240, swap_color_bytes: bool=False, cmd_bits: int=8, param_bits: int=8)
9+
.. class:: I8080(data: tuple=None, dc: Pin=None, write: Pin=None, read: Pin=None, cs: Pin=None, pclk: int= 10000000, width: int=240, height: int=240, swap_color_bytes: bool=False, cmd_bits: int=8, param_bits: int=8)
1010

1111
Create an Intel 8080 object.
1212

1313
These parameters are:
1414

1515
- ``data``: Pins used for data lines
16-
- ``command``: Pin used for D/C line
16+
- ``dc``: Pin used for D/C line
1717
- ``write``: Pin used for WR line
1818
- ``read``: Pin used for RD line, set to None if it’s not used
1919
- ``cs``: Pin used for CS line, set to None if it’s not used

docs/en/api-reference/lcd.ILI9488.rst

+18-17
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ Methods
104104

105105
turn off the backlight.
106106

107-
.. method:: ILI9488.color565(red: int, green: int, blue: int)
108-
109-
Convert RGB888 color data to RGB565.
110-
111107
.. method:: ILI9488.deint()
112108

113109
Deinitialize the LCD panel.
@@ -130,17 +126,22 @@ Methods
130126
+---------+----------------------------------------------------------------------------------------------------------+
131127
| Display | Default Orientation Tables |
132128
+=========+==========================================================================================================+
133-
| 240x320 | ((0x00, 240, 320, 0, 0), (0x60, 320, 240, 0, 0), (0xc0, 240, 320, 0, 0), (0xa0, 320, 240, 0, 0)) |
134-
+---------+----------------------------------------------------------------------------------------------------------+
135-
| 170x320 | ((0x00, 170, 320, 35, 0), (0x60, 320, 170, 0, 35), (0xc0, 170, 320, 35, 0), (0xa0, 320, 170, 0, 35)) |
136-
+---------+----------------------------------------------------------------------------------------------------------+
137-
| 240x240 | ((0x00, 240, 240, 0, 0), (0x60, 240, 240, 0, 0), (0xc0, 240, 240, 0, 80), (0xa0, 240, 240, 80, 0)) |
138-
+---------+----------------------------------------------------------------------------------------------------------+
139-
| 135x240 | ((0x00, 135, 240, 52, 40), (0x60, 240, 135, 40, 53), (0xc0, 135, 240, 53, 40), (0xa0, 240, 135, 40, 52)) |
140-
+---------+----------------------------------------------------------------------------------------------------------+
141-
| 128x160 | ((0x00, 128, 160, 0, 0), (0x60, 160, 128, 0, 0), (0xc0, 128, 160, 0, 0), (0xa0, 160, 128, 0, 0)) |
142-
+---------+----------------------------------------------------------------------------------------------------------+
143-
| 128x128 | ((0x00, 128, 128, 2, 1), (0x60, 128, 128, 1, 2), (0xc0, 128, 128, 2, 3), (0xa0, 128, 128, 3, 2)) |
144-
+---------+----------------------------------------------------------------------------------------------------------+
145-
| other | ((0x00, 0, 0, 0, 0), (0x60, 0, 0, 0, 0), (0xc0, 0, 0, 0, 0), (0xa0, 0, 0, 0, 0)) |
129+
| other | ((0x40, 0, 0, 0, 0), (0x20, 0, 0, 0, 0), (0x80, 0, 0, 0, 0), (0xE0, 0, 0, 0, 0)) |
146130
+---------+----------------------------------------------------------------------------------------------------------+
131+
132+
.. method:: ILI9488.vscroll_area(tfa: int, height: int, bfa: int)
133+
134+
Set the vertical scrolling parameters.
135+
136+
- ``tfa`` is the top fixed area in pixels. The top fixed area is the upper portion of the display frame buffer that will not be scrolled.
137+
138+
- ``height`` is the total height in pixels of the area scrolled.
139+
140+
- ``bfa`` is the bottom fixed area in pixels. The bottom fixed area is the lower portion of the display frame buffer that will not be scrolled.
141+
142+
.. method:: ILI9488.vscroll_start(address: int, order: bool=False)
143+
144+
Set the vertical scroll address.
145+
146+
- ``address`` is the vertical scroll start address in pixels. The vertical scroll start address is the line in the frame buffer will be the first line shown after the TFA.
147+
- ``order`` is the Vertical Refresh Order. When ``order`` == ``False``, LCD vertical refresh Top to Bottom; When ``order`` == ``False``, LCD vertical refresh Bottom to Top.

docs/en/api-reference/lcd.QSPIPanel.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ The QSPIPanel class implements the general control and access interface of the S
66
Constructors
77
------------
88

9-
.. class:: QSPIPanel(spi: machine.SPI, data: tuple, command: Pin, cs: Pin=None, pclk: int=10000000, width: int=240, height: int=240, swap_color_bytes: bool=False, cmd_bits: int=8, param_bits: int=8)
9+
.. class:: QSPIPanel(spi: machine.SPI, data: tuple, dc: Pin, cs: Pin=None, pclk: int=10000000, width: int=240, height: int=240, cmd_bits: int=8, param_bits: int=8)
1010

1111
Create an QSPIPanel object.
1212

1313
These parameters are:
1414

1515
- ``spi``: SPI object
1616
- ``data``: Pins used for data lines
17-
- ``command``: Pins used for data lines
17+
- ``dc``: Pins used for data lines
1818
- ``cs``: Pin used for CS line, set to None if it’s not used
1919
- ``pclk``: Frequency of pixel clock
2020
- ``width``: Horizontal resolution, i.e. the number of pixels in a line
2121
- ``height``: Vertical resolution, i.e. the number of lines in the frame
22-
- ``swap_color_bytes``: Swap adjacent two color bytes
2322
- ``cmd_bits``: Bit-width of LCD command
2423
- ``param_bits``: Bit-width of LCD parameter
2524

docs/en/api-reference/lcd.RM67162.rst

+21-14
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ Methods
104104

105105
turn off the backlight.
106106

107-
.. method:: RM67162.color565(red: int, green: int, blue: int)
107+
.. method:: RM67162.backlight(brightness: int)
108108

109-
Convert RGB888 color data to RGB565.
109+
Adjust the brightness of the backlight.
110110

111111
.. method:: RM67162.deint()
112112

@@ -130,17 +130,24 @@ Methods
130130
+---------+----------------------------------------------------------------------------------------------------------+
131131
| Display | Default Orientation Tables |
132132
+=========+==========================================================================================================+
133-
| 240x320 | ((0x00, 240, 320, 0, 0), (0x60, 320, 240, 0, 0), (0xc0, 240, 320, 0, 0), (0xa0, 320, 240, 0, 0)) |
133+
| 240x536 | ((0x00, 240, 536, 0, 0), (0x60, 536, 240, 0, 0), (0xC0, 240, 536, 0, 0), (0xA0, 536, 240, 0, 0)) |
134134
+---------+----------------------------------------------------------------------------------------------------------+
135-
| 170x320 | ((0x00, 170, 320, 35, 0), (0x60, 320, 170, 0, 35), (0xc0, 170, 320, 35, 0), (0xa0, 320, 170, 0, 35)) |
136-
+---------+----------------------------------------------------------------------------------------------------------+
137-
| 240x240 | ((0x00, 240, 240, 0, 0), (0x60, 240, 240, 0, 0), (0xc0, 240, 240, 0, 80), (0xa0, 240, 240, 80, 0)) |
138-
+---------+----------------------------------------------------------------------------------------------------------+
139-
| 135x240 | ((0x00, 135, 240, 52, 40), (0x60, 240, 135, 40, 53), (0xc0, 135, 240, 53, 40), (0xa0, 240, 135, 40, 52)) |
140-
+---------+----------------------------------------------------------------------------------------------------------+
141-
| 128x160 | ((0x00, 128, 160, 0, 0), (0x60, 160, 128, 0, 0), (0xc0, 128, 160, 0, 0), (0xa0, 160, 128, 0, 0)) |
142-
+---------+----------------------------------------------------------------------------------------------------------+
143-
| 128x128 | ((0x00, 128, 128, 2, 1), (0x60, 128, 128, 1, 2), (0xc0, 128, 128, 2, 3), (0xa0, 128, 128, 3, 2)) |
144-
+---------+----------------------------------------------------------------------------------------------------------+
145-
| other | ((0x00, 0, 0, 0, 0), (0x60, 0, 0, 0, 0), (0xc0, 0, 0, 0, 0), (0xa0, 0, 0, 0, 0)) |
135+
| other | ((0x00, 0, 0, 0, 0), (0x60, 0, 0, 0, 0), (0xC0, 0, 0, 0, 0), (0xA0, 0, 0, 0, 0)) |
146136
+---------+----------------------------------------------------------------------------------------------------------+
137+
138+
.. method:: RM67162.vscroll_area(tfa: int, height: int, bfa: int)
139+
140+
Set the vertical scrolling parameters.
141+
142+
- ``tfa`` is the top fixed area in pixels. The top fixed area is the upper portion of the display frame buffer that will not be scrolled.
143+
144+
- ``height`` is the total height in pixels of the area scrolled.
145+
146+
- ``bfa`` is the bottom fixed area in pixels. The bottom fixed area is the lower portion of the display frame buffer that will not be scrolled.
147+
148+
.. method:: RM67162.vscroll_start(address: int, order: bool=False)
149+
150+
Set the vertical scroll address.
151+
152+
- ``address`` is the vertical scroll start address in pixels. The vertical scroll start address is the line in the frame buffer will be the first line shown after the TFA.
153+
- ``order`` is the Vertical Refresh Order. When ``order`` == ``False``, LCD vertical refresh Top to Bottom; When ``order`` == ``False``, LCD vertical refresh Bottom to Top.

docs/en/api-reference/lcd.SPIPanel.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@ The SPIPanel class implements the general control and access interface of the SP
66
Constructors
77
------------
88

9-
.. class:: SPIPanel(spi: machine.SPI, command: Pin, cs: Pin=None, pclk: int=10000000, width: int=240, height: int=240, swap_color_bytes: bool=False, cmd_bits: int=8, param_bits: int=8)
9+
.. class:: SPIPanel(spi: machine.SPI, dc: Pin, cs: Pin=None, pclk: int=10000000, width: int=240, height: int=240, cmd_bits: int=8, param_bits: int=8)
1010

1111
Create an SPIPanel object.
1212

1313
These parameters are:
1414

1515
- ``spi``: SPI object
16-
- ``command``: Pins used for data lines
16+
- ``dc``: Pins used for data lines
1717
- ``cs``: Pin used for CS line, set to None if it’s not used
1818
- ``pclk``: Frequency of pixel clock
1919
- ``width``: Horizontal resolution, i.e. the number of pixels in a line
2020
- ``height``: Vertical resolution, i.e. the number of lines in the frame
21-
- ``swap_color_bytes``: Swap adjacent two color bytes
2221
- ``cmd_bits``: Bit-width of LCD command
2322
- ``param_bits``: Bit-width of LCD parameter
2423

docs/en/api-reference/lcd.ST7735.rst

+19-16
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ Methods
104104

105105
turn off the backlight.
106106

107-
.. method:: ST7735.color565(red: int, green: int, blue: int)
108-
109-
Convert RGB888 color data to RGB565.
110-
111107
.. method:: ST7735.deint()
112108

113109
Deinitialize the LCD panel.
@@ -130,17 +126,24 @@ Methods
130126
+---------+----------------------------------------------------------------------------------------------------------+
131127
| Display | Default Orientation Tables |
132128
+=========+==========================================================================================================+
133-
| 240x320 | ((0x00, 240, 320, 0, 0), (0x60, 320, 240, 0, 0), (0xc0, 240, 320, 0, 0), (0xa0, 320, 240, 0, 0)) |
134-
+---------+----------------------------------------------------------------------------------------------------------+
135-
| 170x320 | ((0x00, 170, 320, 35, 0), (0x60, 320, 170, 0, 35), (0xc0, 170, 320, 35, 0), (0xa0, 320, 170, 0, 35)) |
136-
+---------+----------------------------------------------------------------------------------------------------------+
137-
| 240x240 | ((0x00, 240, 240, 0, 0), (0x60, 240, 240, 0, 0), (0xc0, 240, 240, 0, 80), (0xa0, 240, 240, 80, 0)) |
129+
| 160x80 | ((0x00, 80, 160, 26, 1), (0x60, 160, 80, 1, 26), (0xC0, 80, 160, 26, 1), (0xA0, 80, 160, 1, 26)) |
138130
+---------+----------------------------------------------------------------------------------------------------------+
139-
| 135x240 | ((0x00, 135, 240, 52, 40), (0x60, 240, 135, 40, 53), (0xc0, 135, 240, 53, 40), (0xa0, 240, 135, 40, 52)) |
140-
+---------+----------------------------------------------------------------------------------------------------------+
141-
| 128x160 | ((0x00, 128, 160, 0, 0), (0x60, 160, 128, 0, 0), (0xc0, 128, 160, 0, 0), (0xa0, 160, 128, 0, 0)) |
142-
+---------+----------------------------------------------------------------------------------------------------------+
143-
| 128x128 | ((0x00, 128, 128, 2, 1), (0x60, 128, 128, 1, 2), (0xc0, 128, 128, 2, 3), (0xa0, 128, 128, 3, 2)) |
144-
+---------+----------------------------------------------------------------------------------------------------------+
145-
| other | ((0x00, 0, 0, 0, 0), (0x60, 0, 0, 0, 0), (0xc0, 0, 0, 0, 0), (0xa0, 0, 0, 0, 0)) |
131+
| other | ((0x00, 0, 0, 0, 0), (0x60, 0, 0, 0, 0), (0xC0, 0, 0, 0, 0), (0xA0, 0, 0, 0, 0)) |
146132
+---------+----------------------------------------------------------------------------------------------------------+
133+
134+
.. method:: ST7735.vscroll_area(tfa: int, height: int, bfa: int)
135+
136+
Set the vertical scrolling parameters.
137+
138+
- ``tfa`` is the top fixed area in pixels. The top fixed area is the upper portion of the display frame buffer that will not be scrolled.
139+
140+
- ``height`` is the total height in pixels of the area scrolled.
141+
142+
- ``bfa`` is the bottom fixed area in pixels. The bottom fixed area is the lower portion of the display frame buffer that will not be scrolled.
143+
144+
.. method:: ST7735.vscroll_start(address: int, order: bool=False)
145+
146+
Set the vertical scroll address.
147+
148+
- ``address`` is the vertical scroll start address in pixels. The vertical scroll start address is the line in the frame buffer will be the first line shown after the TFA.
149+
- ``order`` is the Vertical Refresh Order. When ``order`` == ``False``, LCD vertical refresh Top to Bottom; When ``order`` == ``False``, LCD vertical refresh Bottom to Top.

docs/en/api-reference/lcd.ST7789.rst

+24-11
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ Methods
104104

105105
turn off the backlight.
106106

107-
.. method:: ST7789.color565(red: int, green: int, blue: int)
108-
109-
Convert RGB888 color data to RGB565.
110-
111107
.. method:: ST7789.deint()
112108

113109
Deinitialize the LCD panel.
@@ -130,17 +126,34 @@ Methods
130126
+---------+----------------------------------------------------------------------------------------------------------+
131127
| Display | Default Orientation Tables |
132128
+=========+==========================================================================================================+
133-
| 240x320 | ((0x00, 240, 320, 0, 0), (0x60, 320, 240, 0, 0), (0xc0, 240, 320, 0, 0), (0xa0, 320, 240, 0, 0)) |
129+
| 240x320 | ((0x00, 240, 320, 0, 0), (0x60, 320, 240, 0, 0), (0xC0, 240, 320, 0, 0), (0xA0, 320, 240, 0, 0)) |
134130
+---------+----------------------------------------------------------------------------------------------------------+
135-
| 170x320 | ((0x00, 170, 320, 35, 0), (0x60, 320, 170, 0, 35), (0xc0, 170, 320, 35, 0), (0xa0, 320, 170, 0, 35)) |
131+
| 170x320 | ((0x00, 170, 320, 35, 0), (0x60, 320, 170, 0, 35), (0xC0, 170, 320, 35, 0), (0xA0, 320, 170, 0, 35)) |
136132
+---------+----------------------------------------------------------------------------------------------------------+
137-
| 240x240 | ((0x00, 240, 240, 0, 0), (0x60, 240, 240, 0, 0), (0xc0, 240, 240, 0, 80), (0xa0, 240, 240, 80, 0)) |
133+
| 240x240 | ((0x00, 240, 240, 0, 0), (0x60, 240, 240, 0, 0), (0xC0, 240, 240, 0, 80), (0xA0, 240, 240, 80, 0)) |
138134
+---------+----------------------------------------------------------------------------------------------------------+
139-
| 135x240 | ((0x00, 135, 240, 52, 40), (0x60, 240, 135, 40, 53), (0xc0, 135, 240, 53, 40), (0xa0, 240, 135, 40, 52)) |
135+
| 135x240 | ((0x00, 135, 240, 52, 40), (0x60, 240, 135, 40, 53), (0xC0, 135, 240, 53, 40), (0xA0, 240, 135, 40, 52)) |
140136
+---------+----------------------------------------------------------------------------------------------------------+
141-
| 128x160 | ((0x00, 128, 160, 0, 0), (0x60, 160, 128, 0, 0), (0xc0, 128, 160, 0, 0), (0xa0, 160, 128, 0, 0)) |
137+
| 128x160 | ((0x00, 128, 160, 0, 0), (0x60, 160, 128, 0, 0), (0xC0, 128, 160, 0, 0), (0xA0, 160, 128, 0, 0)) |
142138
+---------+----------------------------------------------------------------------------------------------------------+
143-
| 128x128 | ((0x00, 128, 128, 2, 1), (0x60, 128, 128, 1, 2), (0xc0, 128, 128, 2, 3), (0xa0, 128, 128, 3, 2)) |
139+
| 128x128 | ((0x00, 128, 128, 2, 1), (0x60, 128, 128, 1, 2), (0xC0, 128, 128, 2, 3), (0xA0, 128, 128, 3, 2)) |
144140
+---------+----------------------------------------------------------------------------------------------------------+
145-
| other | ((0x00, 0, 0, 0, 0), (0x60, 0, 0, 0, 0), (0xc0, 0, 0, 0, 0), (0xa0, 0, 0, 0, 0)) |
141+
| other | ((0x00, 0, 0, 0, 0), (0x60, 0, 0, 0, 0), (0xC0, 0, 0, 0, 0), (0xA0, 0, 0, 0, 0)) |
146142
+---------+----------------------------------------------------------------------------------------------------------+
143+
144+
.. method:: ST7789.vscroll_area(tfa: int, height: int, bfa: int)
145+
146+
Set the vertical scrolling parameters.
147+
148+
- ``tfa`` is the top fixed area in pixels. The top fixed area is the upper portion of the display frame buffer that will not be scrolled.
149+
150+
- ``height`` is the total height in pixels of the area scrolled.
151+
152+
- ``bfa`` is the bottom fixed area in pixels. The bottom fixed area is the lower portion of the display frame buffer that will not be scrolled.
153+
154+
.. method:: ST7789.vscroll_start(address: int, order: bool=False)
155+
156+
Set the vertical scroll address.
157+
158+
- ``address`` is the vertical scroll start address in pixels. The vertical scroll start address is the line in the frame buffer will be the first line shown after the TFA.
159+
- ``order`` is the Vertical Refresh Order. When ``order`` == ``False``, LCD vertical refresh Top to Bottom; When ``order`` == ``False``, LCD vertical refresh Bottom to Top.

docs/en/api-reference/lcd.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Classes
1717
lcd.SPIPanel.rst
1818
lcd.QSPIPanel.rst
1919
lcd.I8080.rst
20-
lcd.RGB.rst
20+
lcd.DPI.rst
2121
lcd.ST7789.rst
2222
lcd.ST7735.rst
2323
lcd.ILI9488.rst

0 commit comments

Comments
 (0)