[][src]Struct mcp4725::FastCommand

pub struct FastCommand { /* fields omitted */ }

A FastCommand to send to the MCP4725, using default() a default instance of the FastCommand can be created. Fast commands are special stripped down commands that can be used to send data to an MCP4725 in only 2 bytes instead of 3. It can only be used to set the DAC register, not to write the EEPROM that stores the default values. As with the normal Command the address(), power_mode() and data() builder methods can be used to set parameters. FastCommands can be sent using the send_fast method on the MCP4725 driver. A FastCommand can (and should) be re-used. data() can be used to re-set the data while keeping other parameters the same.

Methods

impl FastCommand[src]

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

pub fn address(self, address: u8) -> Self[src]

Set the 3 bit address TODO document where this address can be found for your chip.

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 power_mode(self, mode: PowerMode) -> Self[src]

Set the power mode

Trait Implementations

impl Default for FastCommand[src]

Auto Trait Implementations

impl Send for FastCommand

impl Sync for FastCommand

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

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