Skip to content

Commit 16b0245

Browse files
Suke0811ducky64
andauthored
Add: Circular display connector (bottom05flip) (#380)
- [x] This PR requires #378 (top contact 15pos) - [x] The screen to be tested --------- Co-authored-by: Richard Lin <[email protected]>
1 parent 561da36 commit 16b0245

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed

edg/parts/Lcd_Er_Tft1_28_3.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
from .PassiveConnector_Fpc import Fpc050Bottom
2+
from ..abstract_parts import *
3+
4+
5+
class Er_Tft_128_3_Outline(InternalSubcircuit, FootprintBlock):
6+
"""Footprint for TFT panel outline"""
7+
8+
def contents(self) -> None:
9+
super().contents()
10+
self.footprint('U', 'edg:Lcd_Er_Tft1_28_3_Outline', {},
11+
'EastRising', 'ER-TFT1.28-3',
12+
datasheet='https://www.buydisplay.com/download/manual/ER-TFT1.28-3_Datasheet.pdf')
13+
14+
15+
class Er_Tft_128_3_Device(InternalSubcircuit, Nonstrict3v3Compatible, Block):
16+
"""15-pin FPC connector for the ER-TFT1.28-3 device"""
17+
18+
def __init__(self) -> None:
19+
super().__init__()
20+
21+
self.conn = self.Block(Fpc050Bottom(length=15)) # Pin numbering in the doc is flipped in the footprint
22+
23+
# Power pins
24+
self.vdd = self.Export(self.conn.pins.request('12').adapt_to(VoltageSink(
25+
voltage_limits=self.nonstrict_3v3_compatible.then_else(
26+
(2.5, 3.6) * Volt, # abs max is 4.6v
27+
(2.5, 3.3) * Volt),
28+
)))
29+
30+
self.gnd = self.Export(self.conn.pins.request('15').adapt_to(Ground()))
31+
# Backlight control
32+
self.ledk = self.Export(self.conn.pins.request('14'))
33+
self.leda = self.Export(self.conn.pins.request('13'))
34+
35+
dio_model = DigitalBidir.from_supply(
36+
self.gnd, self.vdd,
37+
voltage_limit_tolerance=(-0.3, 0.3)*Volt,
38+
input_threshold_factor=(0.3, 0.7)
39+
)
40+
41+
self.rs = self.Export(self.conn.pins.request('11').adapt_to(DigitalSink.from_bidir(dio_model)))
42+
43+
# Control pins
44+
self.spi = self.Port(SpiPeripheral.empty())
45+
self.cs = self.Export(self.conn.pins.request('10').adapt_to(DigitalSink.from_bidir(dio_model)))
46+
self.connect(self.spi.sck, self.conn.pins.request('9').adapt_to(DigitalSink.from_bidir(dio_model)))
47+
self.connect(self.spi.mosi, self.conn.pins.request('8').adapt_to(DigitalSink.from_bidir(dio_model)))
48+
49+
self.miso_nc = self.Block(DigitalBidirNotConnected())
50+
self.connect(self.spi.miso, self.miso_nc.port)
51+
52+
self.rst = self.Export(self.conn.pins.request('7').adapt_to(DigitalSink.from_bidir(dio_model)))
53+
54+
# Capacitive Touch Panel (CTP)
55+
self.ctp_i2c = self.Port(I2cTarget(DigitalBidir.empty(), addresses=[0x15]),)
56+
57+
self.ctp_vdd = self.Export(self.conn.pins.request('6').adapt_to(VoltageSink(
58+
voltage_limits=(2.7, 3.6) * Volt,
59+
current_draw=(5 * uAmp, 2.5 * mAmp)
60+
)))
61+
62+
self.connect(self.gnd, self.conn.pins.request('5').adapt_to(Ground()))
63+
64+
self.ctp_rst = self.Export(self.conn.pins.request('4').adapt_to(DigitalSink.from_bidir(dio_model)))
65+
self.ctp_int = self.Export(self.conn.pins.request('3').adapt_to(DigitalSink.from_bidir(dio_model)))
66+
self.connect(self.ctp_i2c.sda, self.conn.pins.request('2').adapt_to(dio_model))
67+
self.connect(self.ctp_i2c.scl, self.conn.pins.request('1').adapt_to(DigitalSink.from_bidir(dio_model)))
68+
69+
70+
class Er_Tft_128_3(Lcd, Resettable, Block):
71+
"""GC9A01-based 1.28" 240x240 TFT, with optional CST816S-based capacitive touch panel."""
72+
73+
def __init__(self) -> None:
74+
super().__init__()
75+
self.ic = self.Block(Er_Tft_128_3_Device())
76+
self.gnd = self.Export(self.ic.gnd, [Common])
77+
self.pwr = self.Export(self.ic.vdd, [Power])
78+
self.spi = self.Export(self.ic.spi)
79+
self.cs = self.Export(self.ic.cs)
80+
self.dc = self.Export(self.ic.rs)
81+
# touch interface
82+
self.ctp_i2c = self.Export(self.ic.ctp_i2c, optional=True, doc='Touch panel interface i2c')
83+
self.ctp_rst = self.Export(self.ic.ctp_rst, optional=True, doc='Touch panel interface')
84+
self.ctp_int = self.Export(self.ic.ctp_int, optional=True, doc='Touch panel interface')
85+
86+
def contents(self):
87+
super().contents()
88+
self.connect(self.reset, self.ic.rst)
89+
self.require(self.reset.is_connected())
90+
91+
self.lcd = self.Block(Er_Tft_128_3_Outline()) # for ic outline
92+
93+
self.connect(self.ic.ledk.adapt_to(Ground()), self.gnd)
94+
forward_current = (24, 30)*mAmp
95+
forward_voltage = 2.9*Volt
96+
self.led_res = self.Block(Resistor(
97+
resistance=((self.pwr.link().voltage.upper() - forward_voltage) / forward_current.upper(),
98+
(self.pwr.link().voltage.lower() - forward_voltage) / forward_current.lower())))
99+
self.connect(self.led_res.a.adapt_to(VoltageSink(current_draw=forward_current)), self.pwr)
100+
self.connect(self.led_res.b, self.ic.leda)
101+
self.connect(self.pwr, self.ic.ctp_vdd)
102+
self.require(self.ctp_i2c.is_connected() == self.ctp_rst.is_connected())
103+
self.require(self.ctp_i2c.is_connected() == self.ctp_int.is_connected())
104+

edg/parts/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
from .Neopixel import Neopixel, Ws2812b, Sk6812Mini_E, Sk6805_Ec15, Sk6812_Side_A, NeopixelArray, NeopixelArrayCircular
115115
from .Lcd_Qt096t_if09 import Qt096t_if09
116116
from .Lcd_Ch280qv10_Ct import Ch280qv10_Ct
117+
from .Lcd_Er_Tft1_28_3 import Er_Tft_128_3
117118
from .Oled_Er_Oled_091_3 import Er_Oled_091_3
118119
from .Oled_Er_Oled_096_1_1 import Er_Oled_096_1_1
119120
from .Oled_Er_Oled_096_1c import Er_Oled_096_1c
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(footprint "Lcd_Er_Tft1_28_3_Outline"(version 20241229) (generator "pcbnew") (generator_version "9.0")(layer "F.Cu" )(descr "Outline for the 1.28 inch 240x240 IPS TFT LCD Round Circle Capacitive Touch Screen series LCDs. Connector dimensions (on User.Comments layer, with FPC folded over underneath the board, contact facing away from module) is from the Outline Drawing.")(property "Reference" "REF**"(at 0 -14 0)(layer "F.SilkS" )(uuid "f2e2f675-ba12-4850-bfa4-ec3fe8671742")(effects(font(size 1 1)(thickness 0.15))))(property "Value" "Lcd_Er_Tft1_28_3_Outline"(at 0 -0.5 0)(layer "F.Fab" )(uuid "9e0eb252-2082-4c15-95e3-15c23edf5f3c")(effects(font(size 1 1)(thickness 0.15))))(property "Datasheet" ""(at 0 0 0)(layer "F.Fab" )(hide yes)(uuid "950c88b4-3725-4208-8eb5-b28d527d3abf")(effects(font(size 1.27 1.27)(thickness 0.15))))(property "Description" ""(at 0 0 0)(layer "F.Fab" )(hide yes)(uuid "a58a56f1-def7-490f-891c-de667c9a6793")(effects(font(size 1.27 1.27)(thickness 0.15))))(attr exclude_from_pos_files)(fp_circle (center 0 0) (end 16.2 0)(stroke (width 0.1) (type default))(fill no)(layer "F.SilkS" )(uuid "2e62d766-e910-40f3-bede-596eff1d9e4f"))(fp_circle (center 0 0) (end 21.25 0)(stroke (width 0.1) (type default))(fill no)(layer "F.SilkS" )(uuid "d6945a76-c1fe-46e9-88b2-10abd193a137"))(fp_line (start -4.75 24.17) (end -4.75 21.25)(stroke (width 0.1) (type solid))(layer "Cmts.User" )(uuid "9c0bd3ba-bc94-41d1-99c3-cc918afd2a4b"))(fp_line (start 3 23.2) (end 3 23.2)(stroke (width 0.5) (type solid))(layer "Cmts.User" )(uuid "908769fe-c74a-4c9a-928e-cd06bc256925"))(fp_line (start 3.25 21.25) (end -4.75 21.25)(stroke (width 0.1) (type solid))(layer "Cmts.User" )(uuid "ed5bf26a-4179-492b-b841-d397daa25d3c"))(fp_line (start 3.25 21.25) (end 3.25 24.17)(stroke (width 0.1) (type solid))(layer "Cmts.User" )(uuid "7216ebb7-9bda-4856-9a65-8b5610d1ac42"))(fp_line (start 3.25 40.53) (end -4.75 40.53)(stroke (width 0.1) (type solid))(layer "Cmts.User" )(uuid "78d3199f-6925-4f54-a099-b006ead08d6c"))(embedded_fonts no))

0 commit comments

Comments
 (0)