[−][src]Struct mcp4x::Mcp4x
MCP4x digital potentiometer driver
Methods
impl<DI, IC, E> Mcp4x<DI, IC> where
DI: WriteCommand<Error = E>,
IC: CheckChannel<E>,
[src]
DI: WriteCommand<Error = E>,
IC: CheckChannel<E>,
pub fn set_position(
&mut self,
channel: Channel,
position: u8
) -> Result<(), Error<E>>
[src]
&mut self,
channel: Channel,
position: u8
) -> Result<(), Error<E>>
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,
DI: Send,
IC: Send,
impl<DI, IC> Sync for Mcp4x<DI, IC> where
DI: Sync,
IC: Sync,
DI: Sync,
IC: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,