[][src]Struct mcp4725::MCP4725

pub struct MCP4725<I2C: Write> where
    I2C: Write
{ /* fields omitted */ }

MCP4725 DAC driver. Wraps an I2C port to send commands to an MCP4725

Methods

impl<I2C, E> MCP4725<I2C> where
    I2C: Write<Error = E>, 
[src]

pub fn new(i2c: I2C, user_address: u8) -> Self[src]

Construct a new MCP4725 driver instance. i2c is the initialized i2c driver port to use, user_address is the three bit user-part of the i2c address where the MCP4725 can be reached

  • The least significant bit of this address can be set externally by pulling the A0 leg of the chip low (0) or high (1) The two most significant bits are set in the factory. There are four variants of the chip with different addresses.

pub fn send(&mut self, command: &Command) -> Result<(), E>[src]

Send a command to the MCP4725

pub fn send_fast(&mut self, command: &FastCommand) -> Result<(), E>[src]

Send a fast command to the MCP4725

pub fn wake_up(&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(&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 MCP4725 driver, return the wrapped I2C

Auto Trait Implementations

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

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

impl<I2C> Unpin for MCP4725<I2C> where
    I2C: 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.