[][src]Struct ad5668::AD5668

pub struct AD5668<SPI, CS> { /* fields omitted */ }

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]

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]

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]

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]

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]

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

impl<SPI, CS> Sync for AD5668<SPI, CS> where
    CS: Sync,
    SPI: Sync

impl<SPI, CS> Unpin for AD5668<SPI, CS> where
    CS: Unpin,
    SPI: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.