Add touch_probe and touch_reset actions to the Elecrow for a diagnosis over the API (0.2.97, firmware 0.2.83)
This commit is contained in:
@@ -58,14 +58,19 @@ class BoardFile(unittest.TestCase):
|
||||
# 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 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)
|
||||
self.assertIn(' elecrow_touch_reset:\n id: 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)
|
||||
# Elecrow's own values at setup, and the sequence in that order.
|
||||
self.assertIn('this->reset(0x00, 0x00, 0x01, 20, 100, 0x02)', header)
|
||||
order = [header.index(step) for step in ("write_reg_(0x03, config)", "write_reg_(0x01, low)", "delay(hold_ms)",
|
||||
"write_reg_(0x01, high)", "delay(wait_ms)", "write_reg_(0x03, final_config)")]
|
||||
self.assertEqual(order, sorted(order))
|
||||
self.assertIn('return 700.0f', header)
|
||||
for action in ('touch_probe', 'touch_reset'):
|
||||
self.assertIn(f'- action: {action}', TEXT)
|
||||
self.assertIn('assertion_level: SILENT', TEXT)
|
||||
|
||||
def test_the_flash_fits_by_three_measures(self):
|
||||
|
||||
Reference in New Issue
Block a user