Struct dac5578::DAC5578[][src]

pub struct DAC5578<I2C> where
    I2C: Read + Write
{ /* fields omitted */ }
Expand description

DAC5578 driver. Wraps an I2C port to send commands to a DAC5578

Implementations

impl<I2C, E> DAC5578<I2C> where
    I2C: Read<Error = E> + Write<Error = E>, 
[src]

pub fn new(i2c: I2C, address: Address) -> Self[src]

Construct a new DAC5578 driver instance. i2c is the initialized i2c driver port to use, address depends on the state of the ADDR0 pin (see Address)

pub fn write(&mut self, channel: Channel, data: u8) -> Result<(), E>[src]

Write to the channel’s DAC input register

pub fn update(&mut self, channel: Channel, data: u8) -> Result<(), E>[src]

Selects DAC channel to be updated

pub fn write_and_update(&mut self, channel: Channel, data: u8) -> Result<(), E>[src]

Write to DAC input register for a channel and update channel DAC register

pub fn write_and_update_all(
    &mut self,
    channel: Channel,
    data: u8
) -> Result<(), E>
[src]

Write to Selected DAC Input Register and Update All DAC Registers (Global Software LDAC)

pub fn reset(&mut self, mode: ResetMode) -> Result<(), E>[src]

Perform a software reset using the selected mode

pub fn wake_up_all(&mut self) -> Result<(), E>[src]

Send a wake-up command over the I2C bus. WARNING: This is a general call command and can wake-up other devices on the bus as well.

pub fn reset_all(&mut self) -> Result<(), E>[src]

Send a reset command on the I2C bus. WARNING: This is a general call command and can reset other devices on the bus as well.

pub fn destroy(self) -> I2C[src]

Destroy the DAC5578 driver, return the wrapped I2C

Trait Implementations

impl<I2C: Debug> Debug for DAC5578<I2C> where
    I2C: Read + Write
[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<I2C> Send for DAC5578<I2C> where
    I2C: Send

impl<I2C> Sync for DAC5578<I2C> where
    I2C: Sync

impl<I2C> Unpin for DAC5578<I2C> where
    I2C: Unpin

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.