Reset the Elecrow's GT911 the way Elecrow's own V3.0 example does (0.2.96, firmware 0.2.82)
CI / checks (push) Waiting to run
CI / firmware (add-on) (push) Blocked by required conditions
CI / firmware (min_version) (push) Blocked by required conditions

The 2 ms reset of ESPHome's expander support (0.2.81) left the chip silent: "Calibration error" with the PCA9557
answering at 0x18. A component of smart_display's (elecrow_touch_reset.h, setup priority 700: after the I2C bus,
before the GT911 driver) writes the expander as Elecrow's V3.0 ESPHome example does: every pin an output and low,
20 ms, the reset released, 100 ms, the interrupt line back to an input. The driver's reset and interrupt pins are gone.
This commit is contained in:
Xandrossian
2026-09-21 13:30:41 -07:00
parent da28d19961
commit 4ec8c7a935
9 changed files with 96 additions and 36 deletions
+9 -4
View File
@@ -57,10 +57,15 @@ class BoardFile(unittest.TestCase):
self.assertIn('pin: GPIO2', TEXT)
# The USB pins are the touch I2C: the header that frees them.
self.assertIn('<esphome/components/smart_display/elecrow_usb_phy.h>', TEXT)
# The V3.0's PCA9557 (as ESPHome's pca9554, the same registers) brings the GT911 out of reset (firmware 0.2.81).
self.assertIn('address: 0x18', TEXT)
for pin, number in (('reset_pin', 0), ('interrupt_pin', 1)):
self.assertIn(f' {pin}:\n pca9554: touch_expander\n number: {number}', TEXT)
# The V3.0's PCA9557 brings the GT911 out of reset before the driver runs (firmware 0.2.82).
self.assertIn(' elecrow_touch_reset:\n i2c_id: touch_bus\n address: 0x18', TEXT)
code = '\n'.join(line for line in TEXT.split('\n') if not line.lstrip().startswith('#'))
self.assertNotIn('reset_pin', code)
self.assertNotIn('interrupt_pin', code)
header = (ROOT / 'components/smart_display/elecrow_touch_reset.h').read_text()
for step in ('write(0x03, 0x00)', 'write(0x01, 0x00)', 'delay(20)', 'write(0x01, 0x01)', 'delay(100)', 'write(0x03, 0x02)'):
self.assertIn(step, header)
self.assertIn('return 700.0f', header)
self.assertIn('assertion_level: SILENT', TEXT)
def test_the_flash_fits_by_three_measures(self):