An embedded-hal DAC Driver
This crate is an embedded-hal driver library implementation for the Texas Instruments 80501, 70501 and 60501 DACs. It relies on the embedded-hal 1.0.0-alpha.8 traits being implemented in the board hal.
The driver supports setting the output level, configuring the gain, internal reference, internal reference divider, output power state and reading the alarm status. There is also an option to set the output level without bounds checking.
The driver does not currently support reading the DEVID, reading or writing to the SYNC register or setting the TRIGGER register.
```rust let mut dacone = Dac80501::new(spione); let mut dactwo = Dac60501::new(spitwo);
// The dac one output will now be pulled to ground and have no output dacone.setpower_state(dacx0501::PowerState::Off).unwrap();
dactwo .setreferencedivider(dacx0501::RefDivState::Half) .unwrap(); dactwo.setoutputgain(dacx0501::GainState::TwoX).unwrap();
for val in sintable::SINETABLE.iter().cycle() { let mut daconeval = 4095; dactwo setoutputlevel(*val).unwrap(); dacone.setoutputlevel(daconeval).unwrap(); } ```
Issues and pull requests are welcome