[−][src]Struct ad5668::AD5668
AD5668 DAC driver. Wraps an I2C port to send commands to an AD5668
Implementations
impl<SPI, CS, E> AD5668<SPI, CS> where
SPI: Write<u8, Error = E>,
CS: OutputPin,
[src]
SPI: Write<u8, Error = E>,
CS: OutputPin,
pub fn new(spi: SPI, chip_select: CS) -> Self
[src]
Construct a new AD5668 driver
pub fn write_input_register(
&mut self,
address: Address,
value: u16
) -> Result<(), E>
[src]
&mut self,
address: Address,
value: u16
) -> Result<(), E>
Write input register for the dac at address with the value, does not update dac register yet
pub fn update_dac_register(
&mut self,
address: Address,
value: u16
) -> Result<(), E>
[src]
&mut self,
address: Address,
value: u16
) -> Result<(), E>
Update dac register for the dac at address TODO: Check if the data is written too or if this just updates data written earlier to the dac
pub fn write_input_register_update_all(
&mut self,
address: Address,
value: u16
) -> Result<(), E>
[src]
&mut self,
address: Address,
value: u16
) -> Result<(), E>
Write to a single input register, then update all dac channels. This can be used as the last command when updating multiple DACs. First stage values for all DACs then update them simultaniously by performing the last write using this command
pub fn write_and_update_dac_channel(
&mut self,
address: Address,
value: u16
) -> Result<(), E>
[src]
&mut self,
address: Address,
value: u16
) -> Result<(), E>
Write to input register and then update the dac register in one command.
pub fn enable_internal_ref(&mut self) -> Result<(), E>
[src]
Enable the internal reference
pub fn disable_internal_ref(&mut self) -> Result<(), E>
[src]
Disable the internal reference
pub fn reset(&mut self) -> Result<(), E>
[src]
Reset the DAC
pub fn destroy(self) -> (SPI, CS)
[src]
Destroy the driver and return the wrapped SPI driver to be re-used
Auto Trait Implementations
impl<SPI, CS> Send for AD5668<SPI, CS> where
CS: Send,
SPI: Send,
CS: Send,
SPI: Send,
impl<SPI, CS> Sync for AD5668<SPI, CS> where
CS: Sync,
SPI: Sync,
CS: Sync,
SPI: Sync,
impl<SPI, CS> Unpin for AD5668<SPI, CS> where
CS: Unpin,
SPI: Unpin,
CS: Unpin,
SPI: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,