[][src]Struct mcp3208::Mcp3208

pub struct Mcp3208 { /* fields omitted */ }

Implementations

impl Mcp3208[src]

Provides access to a MCP3208 A/D converter.

Example

extern crate mcp3208;

use mcp3208::Mcp3208;

fn main() {
    if let Ok(mut mcp3208) = Mcp3208::new("/dev/spidev0.0") {
        println!("{}", mcp3208.read_adc_single(0).unwrap());
    }
}

pub fn new(spi_dev_path: &str) -> Result<Mcp3208, Mcp3208Error>[src]

Constructs a new Mcp3208.

pub fn read_adc_single(&mut self, channel: Channel) -> Result<u16, Mcp3208Error>[src]

read a raw adc value from a selected channel in single-ended mode

pub fn read_adc_diff(&mut self, channel: Channel) -> Result<u16, Mcp3208Error>[src]

read a raw adc value from a selected channel in pseudo-differential mode

Auto Trait Implementations

impl RefUnwindSafe for Mcp3208

impl Send for Mcp3208

impl Sync for Mcp3208

impl Unpin for Mcp3208

impl UnwindSafe for Mcp3208

Blanket Implementations

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

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

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

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

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

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> 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.