[][src]Struct mcp4x::Mcp4x

pub struct Mcp4x<DI, IC> { /* fields omitted */ }

MCP4x digital potentiometer driver

Methods

impl<DI, IC, E> Mcp4x<DI, IC> where
    DI: WriteCommand<Error = E>,
    IC: CheckChannel<E>, 
[src]

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

Set a channel to a position.

Will return Error::WrongChannel if the channel provided is not available on the device.

pub fn shutdown(&mut self, channel: Channel) -> Result<(), Error<E>>[src]

Shutdown a channel.

Will return Error::WrongChannel if the channel provided is not available on the device.

impl<SPI, CS> Mcp4x<SpiInterface<SPI, CS>, Mcp41x>[src]

pub fn new_mcp41x(spi: SPI, chip_select: CS) -> Self[src]

Create new MCP41x device instance

pub fn destroy_mcp41x(self) -> (SPI, CS)[src]

Destroy driver instance, return SPI bus instance and CS output pin.

impl<SPI, CS> Mcp4x<SpiInterface<SPI, CS>, Mcp42x>[src]

pub fn new_mcp42x(spi: SPI, chip_select: CS) -> Self[src]

Create new MCP42x device instance

pub fn destroy_mcp42x(self) -> (SPI, CS)[src]

Destroy driver instance, return SPI bus instance and CS output pin.

Trait Implementations

impl<DI: Debug, IC: Debug> Debug for Mcp4x<DI, IC>[src]

impl<DI: Default, IC: Default> Default for Mcp4x<DI, IC>[src]

Auto Trait Implementations

impl<DI, IC> Send for Mcp4x<DI, IC> where
    DI: Send,
    IC: Send

impl<DI, IC> Sync for Mcp4x<DI, IC> where
    DI: Sync,
    IC: Sync

Blanket Implementations

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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