dac5578

Crates.iodac5578
lib.rsdac5578
version0.2.1
sourcesrc
created_at2021-05-18 19:47:16.677517
updated_at2021-05-24 18:45:00.569494
descriptionTexas Instruments DAC5578 Driver for Rust Embedded HAL
homepage
repositoryhttps://github.com/chmanie/dac5578
max_upload_size
id399110
size21,945
Christian Maniewski (chmanie)

documentation

README

dac5578  

Texas Instruments DAC5578 Driver for Rust Embedded HAL This is a driver crate for embedded Rust. It's built on top of the Rust embedded HAL It supports sending commands to a TI DAC5578 over I2C.

The driver can be initialized by calling create and passing it an I2C interface. The device address (set by ADDR0) also needs to be specified. It can be set by pulling the ADDR0 on the device high/low or floating.

# use embedded_hal_mock::i2c::Mock;
# use dac5578::*;
# let mut i2c = Mock::new(&[]);
let mut dac = DAC5578::new(i2c, Address::PinLow);

To set the dac output for channel A:

# use embedded_hal_mock::i2c::{Mock, Transaction};
# use dac5578::*;
# let mut i2c = Mock::new(&[Transaction::write(98, vec![0x40, 0xff, 0xf0]),]);
# let mut dac = DAC5578::new(i2c, Address::PinLow);
dac.write_channel(Channel::A, 128);

More information

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 5

cargo fmt