#driver #hal #oscillator #programmable #serial #i2c #frequency

no-std ltc690x

driver crate for LTC690x serial programmable oscillator

5 releases

0.2.1 Aug 5, 2021
0.2.0 Aug 5, 2021
0.1.2 May 6, 2021
0.1.1 Feb 23, 2021
0.1.0 Feb 19, 2021

#783 in Embedded development

MIT/Apache

14KB
187 lines

LTC6903/6904 embedded-hal I2C driver crate

Rust HAL implementation (using I2C traits from embedded-hal) for Linear Technologies LTC6903/6904 programmable 1kHz to 68MHz oscillator.

Datasheet

Usage

Include library as a dependency in your Cargo.toml

[dependencies.ltc690x]
version = "*"

And use embedded-hal implementations for I2C to connect

        // create config with address pin low I2C address
        let ltc = ltc690x::LTC6904::new(i2c, Address::AddressLow);
        // configure output to use positive and negative edge
        ltc.set_output_conf(OutputSettings::ClkBoth);
        // set a frequency
        ltc.set_frequency(1_000_000).ok().unwrap();
        // write the current configuration
        ltc.write_out().unwrap();


lib.rs:

This is a platform agnostic Rust driver for the LTC6904 I2C programmable Oscillator base on the embedded-hal traits.

The LTC6903 uses SPI as interface which is not yet implemented, but should be straightforward

This driver allows you to

  • configure output to posive, negative, both or none of the edges
  • set the generated frequency
  • after setting up the configuration, write_out() needs to be called to write the configuration to the IC

The 'output enable' pin of the device needs to be pulled from the application independently of the driver

Dependencies

~1.5MB
~39K SLoC