LDC3114
Driver crate for the TI LDC3114 Inductance-to-Digital Converter. Compatible with embedded-hal and embedded-hal-async traits.
Example usage
let mut inductance_sensor = new;
// Set the device in configuration mode
inductance_sensor.config_mode.await.unwrap;
// Wait until the registers are ready to write
loop
// Your setup
inductance_sensor.set_normal_scan_rate.await.unwrap;
inductance_sensor.set_low_power_scan_rate.await.unwrap;
inductance_sensor.enable_button_press_detection_algorithm.await.unwrap;
// Set the device in normal mode
inductance_sensor.normal_mode.await.unwrap;
// Wait until the chip is ready
loop
loop
Alternative setup
If you have many configurations to set, set up a const DeviceConfig:
const LDC3114_CONFIG: DeviceConfig = DeviceConfig ;
and then call
inductance_sensor.set_device_configuration.await.unwrap;
Resources
License
This work is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.