[][src]Struct mcp4725::Command

pub struct Command { /* fields omitted */ }

A Command to send to the MCP4725. Using the address(), command_type(), power_mode() and data() builder methods the parameters for this command can be set. Commands can be sent using the send method on the MCP4725 driver. A command can (and should) be re-used. data() can be used to re-set the data while keeping other parameters the same.

Methods

impl Command[src]

pub fn bytes(&self) -> [u8; 3][src]

Format data bytes to send to the DAC. At the moment only sending one sample at a time is supported.

pub fn data(self, data: u16) -> Self[src]

Set the data to send with this command. This data will be truncated to a 12 bit int

pub fn command_type(self, command: CommandType) -> Self[src]

Write the supplied values to the EEPROM as well as to the DAC

pub fn power_mode(self, mode: PowerMode) -> Self[src]

Set the power mode

Trait Implementations

impl Debug for Command[src]

impl Default for Command[src]

fn default() -> Self[src]

Instantiate a command with sane defaults.

impl Eq for Command[src]

impl PartialEq<Command> for Command[src]

impl StructuralEq for Command[src]

impl StructuralPartialEq for Command[src]

Auto Trait Implementations

impl Send for Command

impl Sync for Command

impl Unpin for Command

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.