Skip to content

embedded-drivers/ft6236

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft6236

Crates.io Documentation License

Platform-agnostic Rust driver for the FT6236, FT6206, and FT6236U capacitive touch screen controllers, built on top of embedded-hal traits.

Supported Devices

Chip Chip ID
FT6206 0x06
FT6236 0x36
FT6236U 0x64

Features

  • Multi-touch support (up to 2 simultaneous touch points)
  • Touch event detection (press down, lift up, contact)
  • Gesture recognition (swipe up/down/left/right, zoom in/out)
  • Configurable touch detection threshold
  • Hardware reset with proper timing sequence
  • Optional defmt support for logging

Usage

Add the dependency to your Cargo.toml:

[dependencies]
ft6236 = "0.1"

To enable defmt logging:

[dependencies]
ft6236 = { version = "0.1", features = ["defmt"] }

Example

use ft6236::{FT6236, Config};

// Initialize the touch controller
let mut touch = FT6236::new(i2c);

// Reset the controller (optional, requires a reset pin)
touch.reset(&mut rst_pin, &mut delay).unwrap();

// Initialize with default config (threshold = 0x40)
touch.init(Config::default()).unwrap();

// Read touch points in your main loop
loop {
    if let Some(point) = touch.get_point0().unwrap() {
        // point.x, point.y - touch coordinates
        // point.event - PressDown, LiftUp, or Contact
    }

    if let Some(gesture) = touch.get_gesture().unwrap() {
        // Handle gesture (MoveUp, MoveDown, MoveLeft, MoveRight, ZoomIn, ZoomOut)
    }
}

Note

  • INTn (interrupt output) is not managed by this driver. You need to configure the interrupt pin externally if you want interrupt-driven touch detection.
  • The I2C default address is 0x38.

Minimum Supported Rust Version (MSRV)

This crate requires Rust 1.75 or later (due to embedded-hal 1.0 requirements).

License

Licensed under either of

at your option.

About

embedded-hal driver for the FT6236/FT6206/FT6236U touch controller

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages