at42qt1070

Crates.ioat42qt1070
lib.rsat42qt1070
version0.1.1
sourcesrc
created_at2020-07-19 15:34:42.063364
updated_at2020-07-22 17:42:18.687667
descriptionEmbedded-hal implementation for the AT42QT1070
homepage
repositoryhttps://github.com/Steav005/at42qt1070
max_upload_size
id266885
size77,949
Sven Friedrich (sevenautumns)

documentation

README

AT42QT1070

This is an I2C implementation for the AT42QT1070 Touch Sensor IC.

The used I2C struct is required to implement embedded_hal::blocking::i2c::Write and embedded_hal::blocking::i2c::WriteRead

Example

let rcc = c.device.RCC.constrain();
let gpiob = c.device.GPIOB.split();
let clocks = rcc
    .cfgr
    .use_hse(25.mhz())
    .sysclk(84.mhz())
    .require_pll48clk()
    .freeze();
let scl = gpiob.pb8.into_alternate_af4().set_open_drain();
let sda = gpiob.pb9.into_alternate_af4().set_open_drain();
let i2c = I2c::i2c1(c.device.I2C1, (scl, sda), 400.khz(), clocks);
let mut sensor = At42qt1070::new(i2c);
sensor.sync_all().unwrap();
Commit count: 13

cargo fmt