Skip to content

Commit 8d4a04d

Browse files
committed
first naive implementation of dac trait
1 parent 9e6ab5a commit 8d4a04d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/blocking/dac.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//! Trait for digital to analog conversion
2+
3+
/// Represents a single DAC channel.
4+
pub trait DAC<WORD> {
5+
/// Error type returned by DAC methods
6+
type Error;
7+
8+
/// Set the output of the DAC
9+
fn try_set_output(&mut self, value: WORD) -> Result<(), Self::Error>;
10+
}

src/blocking/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//! traits. To save boilerplate when that's the case a `Default` marker trait may be provided.
55
//! Implementing that marker trait will opt in your type into a blanket implementation.
66
7+
pub mod dac;
78
pub mod delay;
89
pub mod i2c;
910
pub mod rng;

0 commit comments

Comments
 (0)