From 57dcd807f3a2ad1bf8a2225c8ecf8b612e373ae5 Mon Sep 17 00:00:00 2001 From: Shantanu Date: Fri, 30 Sep 2022 17:28:00 +0530 Subject: [PATCH] Added example/interface --- README.md | 27 +++++++++++++++++++++------ examples/interface.rs | 1 + target/.rustc_info.json | 2 +- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3eee24e..e1de093 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,29 @@ + # FT6x06 driver +## TouchPanel Controller FT6x06 is Self-Capacitive Touch Panel Controller used on many boards manufactured by ST. -The FT6x06 Series ICs are single-chip capacitive touch panel controller ICs with a built-in 8 bit enhanced Micro-controller unit -(MCU).They adopt the self-capacitance technology, which supports single point and gesture touch. In conjunction with a -self-capacitive touch panel. This is built on top of embedded-hal and implements blocking::I2C module. The examples are built using +The FT6x06 Series ICs are single-chip capacitive touch panel controller ICs with a built-in 8 bit enhanced Micro-controller unit (MCU). They adopt the self-capacitance technology, which supports single point and gesture touch. This is built on top of embedded-hal and implements blocking I2C module. The FT6x06 series ICs include FT6206 /FT6306. +## Description +This repository is a device driver for FT6x06 written in Rust which was reverse engineered from C code in ST's component driver. +This repository, that is built upon embedded-hal, provides tools to access the touchpanel controller in order to retrieve touch coordinate and gesture data via the microcontroller's I2C bus. This repo also contains examples for FT6206 IC built on top of abstraction layer for STM32F4 devices-stm32f4xx-hal for the boards -STM32F412 and STM32F413 boards. Documentation of touchscreen controllers on this boards is not well written. I initially forked ft5336 -repo written in rust and modified it to fit to ft6x06. -Other parts of this driver have been reverse-engineered from the code written in C by STMicroelectronics, +`STM32F412/413` boards. Documentation of touchscreen controllers on this boards is not well written. +This is mainly based on the STMicroelectronics github page- https://github.com/STMicroelectronics/stm32-ft6x06. + +Many boards manufactured by STMicroelectronics use the Touch Panel Controller, model number FT6x06. The single-chip FT6x06 Series ICs are capacitive touch panel controllers with an integrated 8 bit improved micro-controller unit. + + +## Example +More examples of how to use the touch panel component of the *STM32F412/13* boards are included. +`example/interface` demonstrates how the display and touch panel could be used to create a User Interface for an embedded board. +To run an example, + +- connect to an STM32F413 Discovery board via the ST_Link port (the USB- mini type B port) +- haves some Rust tools installed and switch to nightly channel, +- run the command: `cargo run --features stm32f413,fsmc_lcd --example interface` + diff --git a/examples/interface.rs b/examples/interface.rs index e94f2d7..100d939 100644 --- a/examples/interface.rs +++ b/examples/interface.rs @@ -115,6 +115,7 @@ fn main() -> ! { // Initialise the display and clear the screen disp.init(&mut delay).unwrap(); + disp.set_orientation(Orientation::Portrait).unwrap(); rprintln!("{}", disp.orientation() as u8); disp.clear(Rgb565::BLACK).unwrap(); diff --git a/target/.rustc_info.json b/target/.rustc_info.json index 0fe637b..ed9cea4 100644 --- a/target/.rustc_info.json +++ b/target/.rustc_info.json @@ -1 +1 @@ -{"rustc_fingerprint":16051656703701844919,"outputs":{"15697416045686424142":{"success":false,"status":"exit status: 1","code":1,"stdout":"","stderr":"error: `-Csplit-debuginfo` is unstable on this platform\n\n"},"7899727094903929947":{"success":false,"status":"exit status: 1","code":1,"stdout":"","stderr":"error: `-Csplit-debuginfo` is unstable on this platform\n\n"},"16664864658009119825":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.a\n/home/shantanu/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_abi=\"eabihf\"\ntarget_arch=\"arm\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_feature=\"dsp\"\ntarget_feature=\"llvm14-builtins-abi\"\ntarget_feature=\"mclass\"\ntarget_feature=\"thumb-mode\"\ntarget_feature=\"thumb2\"\ntarget_feature=\"v5te\"\ntarget_feature=\"v6\"\ntarget_feature=\"v6k\"\ntarget_feature=\"v6t2\"\ntarget_feature=\"v7\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"none\"\ntarget_pointer_width=\"32\"\ntarget_vendor=\"unknown\"\n","stderr":"warning: dropping unsupported crate type `dylib` for target `thumbv7em-none-eabihf`\n\nwarning: dropping unsupported crate type `cdylib` for target `thumbv7em-none-eabihf`\n\nwarning: dropping unsupported crate type `proc-macro` for target `thumbv7em-none-eabihf`\n\nwarning: 3 warnings emitted\n\n"},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.63.0-nightly (cacc75c82 2022-06-16)\nbinary: rustc\ncommit-hash: cacc75c82ebe15cf63d31034fcf7f1016cddf0e2\ncommit-date: 2022-06-16\nhost: x86_64-unknown-linux-gnu\nrelease: 1.63.0-nightly\nLLVM version: 14.0.5\n","stderr":""},"10376369925670944939":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/shantanu/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"llvm14-builtins-abi\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}} \ No newline at end of file +{"rustc_fingerprint":8663548477073902401,"outputs":{"16664864658009119825":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.a\n/home/shantanu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_arch=\"arm\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"none\"\ntarget_pointer_width=\"32\"\ntarget_vendor=\"unknown\"\n","stderr":"warning: dropping unsupported crate type `dylib` for target `thumbv7em-none-eabihf`\n\nwarning: dropping unsupported crate type `cdylib` for target `thumbv7em-none-eabihf`\n\nwarning: dropping unsupported crate type `proc-macro` for target `thumbv7em-none-eabihf`\n\nwarning: 3 warnings emitted\n\n"},"10376369925670944939":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/shantanu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"7899727094903929947":{"success":false,"status":"exit status: 1","code":1,"stdout":"","stderr":"error: `-Csplit-debuginfo` is unstable on this platform\n\n"},"15697416045686424142":{"success":false,"status":"exit status: 1","code":1,"stdout":"","stderr":"error: `-Csplit-debuginfo` is unstable on this platform\n\n"},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.62.0 (a8314ef7d 2022-06-27)\nbinary: rustc\ncommit-hash: a8314ef7d0ec7b75c336af2c9857bfaf43002bfc\ncommit-date: 2022-06-27\nhost: x86_64-unknown-linux-gnu\nrelease: 1.62.0\nLLVM version: 14.0.5\n","stderr":""}},"successes":{}} \ No newline at end of file