[][src]Struct mcp49xx::Mcp49xx

pub struct Mcp49xx<DI, RES, CH, BUF> { /* fields omitted */ }

MCP49xx digital potentiometer driver

Methods

impl<SPI, CS, RES, CH, BUF> Mcp49xx<SpiInterface<SPI, CS>, RES, CH, BUF>[src]

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

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

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution8Bit, SingleChannel, Unbuffered>[src]

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

Create a new instance of a MCP4801 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution8Bit, DualChannel, Unbuffered>[src]

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

Create a new instance of a MCP4802 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution10Bit, SingleChannel, Unbuffered>[src]

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

Create a new instance of a MCP4811 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution10Bit, DualChannel, Unbuffered>[src]

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

Create a new instance of a MCP4812 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution12Bit, SingleChannel, Unbuffered>[src]

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

Create a new instance of a MCP4821 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution12Bit, DualChannel, Unbuffered>[src]

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

Create a new instance of a MCP4822 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution8Bit, SingleChannel, Buffered>[src]

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

Create a new instance of a MCP4901 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution8Bit, DualChannel, Buffered>[src]

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

Create a new instance of a MCP4902 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution10Bit, SingleChannel, Buffered>[src]

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

Create a new instance of a MCP4911 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution10Bit, DualChannel, Buffered>[src]

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

Create a new instance of a MCP4912 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution12Bit, SingleChannel, Buffered>[src]

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

Create a new instance of a MCP4921 device.

impl<SPI, CS> Mcp49xx<SpiInterface<SPI, CS>, Resolution12Bit, DualChannel, Buffered>[src]

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

Create a new instance of a MCP4922 device.

impl<DI, RES, CH, BUF, E> Mcp49xx<DI, RES, CH, BUF> where
    DI: WriteCommand<Error = E>,
    RES: ResolutionSupport<E>,
    CH: ChannelSupport<E>,
    BUF: BufferingSupport<E>, 
[src]

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

Send command to device.

This will return an error if the command is not appropriate for the current device:

  • If the channel is not available it will return Error::InvalidChannel.
  • If the value is too big it will return Error::InvalidValue.
  • If buffering is not supported it will return Error::BufferingNotSupported.

Otherwise if a communication error happened it will return Error::Comm.

Trait Implementations

impl<DI: Debug, RES: Debug, CH: Debug, BUF: Debug> Debug for Mcp49xx<DI, RES, CH, BUF>[src]

impl<DI: Default, RES: Default, CH: Default, BUF: Default> Default for Mcp49xx<DI, RES, CH, BUF>[src]

Auto Trait Implementations

impl<DI, RES, CH, BUF> Send for Mcp49xx<DI, RES, CH, BUF> where
    BUF: Send,
    CH: Send,
    DI: Send,
    RES: Send

impl<DI, RES, CH, BUF> Sync for Mcp49xx<DI, RES, CH, BUF> where
    BUF: Sync,
    CH: Sync,
    DI: Sync,
    RES: 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]