pub struct MCP3204Async<I> { /* private fields */ }
Expand description
The MCP3204 is a 12-bit ADC with on-board sample and hold circuitry. It is programmable to provide two pseudo-differential input pairs or four single-ended inputs.
For a full description and usage examples, refer to the module documentation.
Implementations§
Source§impl<I> MCP3204Async<I>where
I: SpiDevice,
impl<I> MCP3204Async<I>where
I: SpiDevice,
Sourcepub fn new_spi(interface: I, reference_voltage: ElectricPotential) -> Self
pub fn new_spi(interface: I, reference_voltage: ElectricPotential) -> Self
Initializes a new device from the specified SPI device.
This consumes the SPI device I
.
The device supports SPI modes 0 and 3.
Source§impl<I: SpiDevice> MCP3204Async<I>
impl<I: SpiDevice> MCP3204Async<I>
Sourcepub async fn convert_raw(
&mut self,
channel: InputChannel,
) -> Result<u16, I::Error>
pub async fn convert_raw( &mut self, channel: InputChannel, ) -> Result<u16, I::Error>
Performs a conversion of the given channel and returns the raw value
Sourcepub async fn convert(
&mut self,
channel: InputChannel,
) -> Result<ElectricPotential, I::Error>
pub async fn convert( &mut self, channel: InputChannel, ) -> Result<ElectricPotential, I::Error>
Performs a conversion of the given channel and returns the value in volts
Auto Trait Implementations§
impl<I> Freeze for MCP3204Async<I>where
I: Freeze,
impl<I> !RefUnwindSafe for MCP3204Async<I>
impl<I> Send for MCP3204Async<I>where
I: Send,
impl<I> Sync for MCP3204Async<I>where
I: Sync,
impl<I> Unpin for MCP3204Async<I>where
I: Unpin,
impl<I> !UnwindSafe for MCP3204Async<I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more