pub struct Dac<SPI, SYNC> { /* private fields */ }
Expand description
DAC8568
Implementations
sourceimpl<SPI, SYNC> Dac<SPI, SYNC> where
SPI: Write<u8>,
SYNC: OutputPin,
impl<SPI, SYNC> Dac<SPI, SYNC> where
SPI: Write<u8>,
SYNC: OutputPin,
sourcepub fn release(self) -> (SPI, SYNC)
pub fn release(self) -> (SPI, SYNC)
Consume the dac and return the underlying SPI and GPIO pins used by it
sourcepub fn set_inverted_output(&mut self, state: bool)
pub fn set_inverted_output(&mut self, state: bool)
Sets the output signal of the DAC to be inverted or non-inverted (default) Useful if the hardware engineer has designed an inverting gain stage after the DAC output
sourcepub fn set_voltage(
&mut self,
channel: Channel,
voltage: u16
) -> Result<(), DacError>
pub fn set_voltage(
&mut self,
channel: Channel,
voltage: u16
) -> Result<(), DacError>
Set the specified value to the given channel. This will update the DAC to output the desired voltage
sourcepub fn use_internal_reference(&mut self) -> Result<(), DacError>
pub fn use_internal_reference(&mut self) -> Result<(), DacError>
Configure the DAC to use its internal reference mode of 2.5v rather than using an external voltage reference
sourcepub fn use_external_reference(&mut self) -> Result<(), DacError>
pub fn use_external_reference(&mut self) -> Result<(), DacError>
Configure the DAC to use its external reference mode rather than using the internal reference
sourcepub fn reset(&mut self) -> Result<(), DacError>
pub fn reset(&mut self) -> Result<(), DacError>
Perform a software reset, clearing out all registers 8.2.10 Software Reset Function The DAC7568, DAC8168, and DAC8568 contain a software reset feature. If the software reset feature is executed, all registers inside the device are reset to default settings; that is, all DAC channels are reset to the power-on reset code (power on reset to zero scale for grades A and C; power on reset to midscale for grades B and D).
Auto Trait Implementations
impl<SPI, SYNC> RefUnwindSafe for Dac<SPI, SYNC> where
SPI: RefUnwindSafe,
SYNC: RefUnwindSafe,
impl<SPI, SYNC> Send for Dac<SPI, SYNC> where
SPI: Send,
SYNC: Send,
impl<SPI, SYNC> Sync for Dac<SPI, SYNC> where
SPI: Sync,
SYNC: Sync,
impl<SPI, SYNC> Unpin for Dac<SPI, SYNC> where
SPI: Unpin,
SYNC: Unpin,
impl<SPI, SYNC> UnwindSafe for Dac<SPI, SYNC> where
SPI: UnwindSafe,
SYNC: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more