| Crates.io | at42qt1070 |
| lib.rs | at42qt1070 |
| version | 0.1.1 |
| created_at | 2020-07-19 15:34:42.063364+00 |
| updated_at | 2020-07-22 17:42:18.687667+00 |
| description | Embedded-hal implementation for the AT42QT1070 |
| homepage | |
| repository | https://github.com/Steav005/at42qt1070 |
| max_upload_size | |
| id | 266885 |
| size | 77,949 |
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
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();