Skip to content

add FT5x06 multi-touch controller #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2022
Merged

Conversation

kmatch98
Copy link
Contributor

This generalizes the library to accommodate FT5x06 controller that can accept 10 point multitouch.

Note: In order to get proper scaling to the 800x480 display panel, I required adding a _SCALE_FACTOR parameter. As an extension, the scaling could be automated using a calibration routine.

I added type notations to resolve #21.

In the future, consider relaxing the vend_id parameter. From my reading of the register descriptions in the FT5x06 application note, I conclude that this is the vendor ID of the touch panel rather than the chip vendor.

Testing

  • FT6206: I verified on the Adafruit 2.8" Cap touch TFT.
  • FT5406: I verified on controller FT5406 from 7" touch controller (EP0700MLM0, suspected from EDTC) - images below.

FT5x06 Testing Details

Images of panel used to test the FT5x06 updates:
image

5554911644197506430

For reference, below is the register dump from FT5406 touch panel used in testing:

	$00 => 00 device mode
	$01 => 00 gesture ID
	$02 => 00 TD status, number of touch points
	$03 => 44 bit 7-6 1st event flag, 3-0 1st touch x-position 11-8 bit
	$04 => B1 1st touch x-position 7-0 bits
	$05 => 01 bit 7-4, 1st touch ID, 3-0 1st touch y-position  11-8 bit
	$06 => BC 1st touch y-position 7-0 bits
	$07 => 00
	$08 => 00
	$09 => FF 2nd
	$0A => FF
	$0B => FF
	$0C => FF
	$0D => 00
	$0E => 00
	$0F => FF 3rd
	$10 => FF
	$11 => FF
	$12 => FF
	$13 => 00
	$14 => 00
	$15 => FF 4th
	$16 => FF
	$17 => FF
	$18 => FF
	$19 => 00
	$1A => 00
	$1B => FF 5th
	$1C => FF
	$1D => FF
	$1E => FF
	$1F => 00
	$20 => 00
	$21 => FF 6th
	$22 => FF
	$23 => FF
	$24 => FF
	$25 => 00
	$26 => 00
	$27 => FF 7th
	$28 => FF
	$29 => FF
	$2A => FF
	$2B => 00
	$2C => 00
	$2D => FF 8th
	$2E => FF
	$2F => FF
	$30 => FF
	$31 => 00
	$32 => 00
	$33 => FF 9th
	$34 => FF
	$35 => FF
	$36 => FF
	$37 => 00
	$38 => 00
	$39 => FF 10th
	$3A => FF
	$3B => FF
	$3C => FF
	$3D => 00
	$3E => 00
	$3F => 00
	$40 => 00
	$41 => 00
	$42 => 00
	$43 => 00
	$44 => 00
	$45 => 00
	$46 => 00
	$47 => 00
	$48 => 00
	$49 => 00
	$4A => 00
	$4B => 00
	$4C => 00
	$4D => 00
	$4E => 00
	$4F => 00
	$50 => 00
	$51 => 00
	$52 => 00
	$53 => 00
	$54 => 00
	$55 => 00
	$56 => 00
	$57 => 00
	$58 => 00
	$59 => 00
	$5A => 00
	$5B => 00
	$5C => 00
	$5D => 00
	$5E => 00
	$5F => 00
	$60 => 00
	$61 => 00
	$62 => 00
	$63 => 00
	$64 => 00
	$65 => 00
	$66 => 00
	$67 => 00
	$68 => 00
	$69 => 00
	$6A => 00
	$6B => 00
	$6C => 00
	$6D => 00
	$6E => 00
	$6F => 00
	$70 => 00
	$71 => 00
	$72 => 00
	$73 => 00
	$74 => 00
	$75 => 00
	$76 => 00
	$77 => 00
	$78 => 00
	$79 => 00
	$7A => 00
	$7B => 00
	$7C => 00
	$7D => 00
	$7E => 00
	$7F => 00
	$80 => 19 start of touch detection parameters
	$81 => 3C
	$82 => 75
	$83 => 01
	$84 => 01
	$85 => A0
	$86 => 01
	$87 => C8
	$88 => 0A
	$89 => 28
	$8A => EB
	$8B => 50
	$8C => DB
	$8D => AE
	$8E => FD
	$8F => 7A
	$90 => F7
	$91 => FD
	$92 => AB
	$93 => E8
	$94 => C8
	$95 => EA
	$96 => AC
	$97 => 98
	$98 => 39
	$99 => 85
	$9A => B7
	$9B => AC
	$9C => 79
	$9D => B7
	$9E => 6B
	$9F => 9B
	$A0 => FF
	$A1 => 30 library version high byte
	$A2 => 03 library version low byte
	$A3 => 55 chip vendor ID
	$A4 => 01
	$A5 => 01
	$A6 => 01 firmware ID
	$A7 => 01
	$A8 => 42 Capacitive touch panel maker vendor ID
	$A9 => 00
	$AA => 00
	$AB => 7F
	$AC => 1A
	$AD => 0C
	$AE => 96
	$AF => 01
	$B0 => 08
	$B1 => 00
	$B2 => E6
	$B3 => 64
	$B4 => 32
	$B5 => F5
	$B6 => C8
	$B7 => EB
	$B8 => FB
	$B9 => 1D
	$BA => AB
	$BB => A7
	$BC => 8D
	$BD => F7
	$BE => AF
	$BF => 1B
	$C0 => 00
	$C1 => 00
	$C2 => 00
	$C3 => 00
	$C4 => 00
	$C5 => 00
	$C6 => 00
	$C7 => 00
	$C8 => 00
	$C9 => 00
	$CA => 00
	$CB => 00
	$CC => 00
	$CD => 00
	$CE => 00
	$CF => 00
	$D0 => 00
	$D1 => 00
	$D2 => 00
	$D3 => 00
	$D4 => 00
	$D5 => 00
	$D6 => 00
	$D7 => 00
	$D8 => 00
	$D9 => 00
	$DA => 00
	$DB => 00
	$DC => 00
	$DD => 00
	$DE => 00
	$DF => 00
	$E0 => 00
	$E1 => 00
	$E2 => 00
	$E3 => 00
	$E4 => 00
	$E5 => 00
	$E6 => 00
	$E7 => 00
	$E8 => 00
	$E9 => 00
	$EA => 00
	$EB => 00
	$EC => 00
	$ED => 00
	$EE => 00
	$EF => 00
	$F0 => 00
	$F1 => 00
	$F2 => 00
	$F3 => 00
	$F4 => 00
	$F5 => 00
	$F6 => 00
	$F7 => 00
	$F8 => 00
	$F9 => 00
	$FA => 00
	$FB => 00
	$FC => 01
	$FD => 00
	$FE => 00
	$FF => 00

@kmatch98 kmatch98 requested a review from a team February 12, 2022 18:26
Copy link
Member

@ladyada ladyada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay thank you :)

@ladyada ladyada merged commit 53d46cd into adafruit:main Feb 12, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 16, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADT7410 to 1.3.2 from 1.3.1:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_ADT7410#20 from tammymakesthings/issue18-type-annotations
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_ADXL34x to 1.11.12 from 1.11.11:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_ADXL34x#33 from tammymakesthings/issue30-add-type-annotations
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_AS726x to 2.0.9 from 2.0.8:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_AS726x#19 from tammymakesthings/issue17-add-type-annotations
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_AS7341 to 1.2.4 from 1.2.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_AS7341#24 from tekktrik/doc/add-CV-classes
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_AS7341#23 from tammymakesthings/issue20-add-type-annotations

Updating https://github.com/adafruit/Adafruit_CircuitPython_BME280 to 2.6.10 from 2.6.9:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_BME280#60 from tekktrik/doc/add-typing
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_FocalTouch to 1.3.0 from 1.2.10:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_FocalTouch#24 from kmatch98/master
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9600 to 1.2.3 from 1.2.2:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_MCP9600#18 from angerer/Issue-17_TypeAnnotations
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_PN532 to 2.3.7 from 2.3.6:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_PN532#53 from jerryneedell/jerryn_none
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7789 to 1.5.5 from 1.5.4:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_ST7789#29 from mlashley/main
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLA202X to 1.0.5 from 1.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLA202x#4 from tekktrik/doc/add-usage-example
  > Merge pull request adafruit/Adafruit_CircuitPython_TLA202x#5 from tekktrik/doc/add-typing
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL6180X to 1.4.0 from 1.3.1:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_VL6180X#23 from JonasSchatz/main
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.2.1 from 8.2.0:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#158 from tannewt/packet_buffer_test
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#156 from tekktrik/doc/consolidate-readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_BroadcastNet to 0.12.1 from 0.12.0:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_BroadcastNet#28 from tannewt/cp_native_bridge
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_BroadcastNet#26 from tekktrik/doc/consolidate-readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_Radio to 0.5.0 from 0.4.2:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_Radio#21 from tekktrik/feature/use-ble-consts-2
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_BusDevice to 5.1.5 from 5.1.4:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_BusDevice#80 from dhalbert/prune-mock-imports

Updating https://github.com/adafruit/Adafruit_CircuitPython_Debouncer to 1.5.0 from 1.4.1:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_Debouncer#35 from d-a-v/multi
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.5.14 from 2.5.13:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#94 from tekktrik/doc/add-pause-example
  > Post-patch cleanup

Updating https://github.com/adafruit/Adafruit_CircuitPython_NeoKey to 1.0.5 from 1.0.4:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_NeoKey#6 from mattgoff/typeAnnotations
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.10.7 from 1.10.6:
  > Fixed readthedocs build
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#100 from FoamyGuy/gzip_error
  > Consolidate Documentation sections of README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Type Annotations
2 participants