RP2
Generic display connected to a Raspberry Pi Pico.
Pico Pin |
Display |
---|---|
14 (GP10) |
BL |
15 (GP11) |
RST |
16 (GP12) |
DC |
17 (GP13) |
CS |
18 (GND) |
GND |
19 (GP14) |
CLK |
20 (GP15) |
DIN |
tft_configs/RP2/tft_config.py
1"""Generic 240x240 GC9A01
2
3Generic display connected to a Raspberry Pi Pico.
4
5.. list-table:: **Connections**
6 :header-rows: 1
7
8 * - Pico Pin
9 - Display
10 * - 14 (GP10)
11 - BL
12 * - 15 (GP11)
13 - RST
14 * - 16 (GP12)
15 - DC
16 * - 17 (GP13)
17 - CS
18 * - 18 (GND)
19 - GND
20 * - 19 (GP14)
21 - CLK
22 * - 20 (GP15)
23 - DIN
24
25"""
26
27from machine import Pin, SPI
28import gc9a01
29
30TFA = 0
31BFA = 0
32WIDE = 1
33TALL = 0
34
35
36def config(rotation=0, buffer_size=0, options=0):
37 """Configure the display and return an instance of gc9a01.GC9A01."""
38
39 spi = SPI(1, baudrate=60000000, sck=Pin(14), mosi=Pin(15))
40 return gc9a01.GC9A01(
41 spi,
42 240,
43 240,
44 reset=Pin(11, Pin.OUT),
45 cs=Pin(13, Pin.OUT),
46 dc=Pin(12, Pin.OUT),
47 backlight=Pin(10, Pin.OUT),
48 rotation=rotation,
49 options=options,
50 buffer_size=buffer_size,
51 )