#embedded-hal #touchscreen #embedded-hal-driver #ft5663

no-std ft5336

A platform agnostic driver for the FT5336 touch screen driver used on the STM32F746 Discovery board, built using the embedded-hal

2 unstable releases

0.2.0 May 16, 2023
0.1.0 Jan 6, 2022

#439 in Embedded development

Download history 1322/week @ 2024-03-17 1258/week @ 2024-03-24 1034/week @ 2024-03-31 1113/week @ 2024-04-07 1238/week @ 2024-04-14 1112/week @ 2024-04-21 1619/week @ 2024-04-28 1013/week @ 2024-05-05 987/week @ 2024-05-12 1045/week @ 2024-05-19 1186/week @ 2024-05-26 999/week @ 2024-06-02 1390/week @ 2024-06-09 999/week @ 2024-06-16 1043/week @ 2024-06-23 580/week @ 2024-06-30

4,135 downloads per month

MIT/Apache

31KB
336 lines

ft5336 Touchscreen controller

Platform agnostic driver for an FT5336 touch screen controller built using the embedded-hal.

The code is [no_main] and [no_std] compliant. The FT5336 is an I2C driven touch controller used in the STM32F746 DISCOVERY board. I cannot find a datasheet for it, so much of this comes from the STMicroelectronics Github pages: https://github.com/STMicroelectronics/stm32-ft5336 generated by the STM32Cube.

The FT5336 is a member of a family, but this code has only been tested on the single device, and only in a limited manner.

This device driver is based on the interface of the tsl256x device driver by Josh McGuigan (https://github.com/JoshMcguigan/tsl256x) and is largely in line with the thoughts expressed on his blog: https://www.joshmcguigan.com/blog/tsl256x-light-intensity-sensor-driver/ . It does not consume the I2C device, allowing for other devices to be on the same bus. That's not important on the STM32F7 Disco, but might be useful in other applications.

What works

Getting a basic x,y and touch value with weight works. The screen can detect multitouch. Getting postions for the other touches has not been tested.

TODO

Gestures etc

This turns out to be a hard problem. There is no good single source of documentation for this touchscreen driver. The FT5336 is apparently being deprecated by the manufacturers, and newer ST boards use a different touch controller. So I'm not going to go further than what is here. I fancied some gestures, but can live without them, or write my own implementations.

Example

The following example should work if you're

  • connected to an STM32F746 Discovery board, via the ST_Link port (the USB- mini type B port)
  • have embedded Rust dev tools installed, and
  • run the command: cargo embed example=touch --features=stm32f746

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~71KB