Skip to content

chmanie/dac5578

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Rust TI DAC5578 driver based on the embedded HAL

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages