[−][src]Struct driver_cp2130::Cp2130
CP2130 provides methods to interact with the device, as well as create new spi and gpio connectors.
Methods
impl<'a> Cp2130<'a>
[src]
pub fn new(
device: UsbDevice<'a>,
descriptor: DeviceDescriptor
) -> Result<Self, Error>
[src]
device: UsbDevice<'a>,
descriptor: DeviceDescriptor
) -> Result<Self, Error>
Create a new CP2130 instance from a libusb device and descriptor
pub fn info(&self) -> Info
[src]
Fetch information for the connected device
pub fn reset(&self) -> Result<(), Error>
[src]
pub fn spi(&self, channel: u8, config: SpiConfig) -> Result<Spi<'a>, Error>
[src]
Create an SPI connector
pub fn gpio_out(
&self,
index: u8,
mode: GpioMode,
level: GpioLevel
) -> Result<OutputPin<'a>, Error>
[src]
&self,
index: u8,
mode: GpioMode,
level: GpioLevel
) -> Result<OutputPin<'a>, Error>
Create a GPIO OutputPin
pub fn gpio_in(&self, index: u8) -> Result<InputPin<'a>, Error>
[src]
Create a GPIO InputPin
Trait Implementations
impl<'a> Device for Cp2130<'a>
[src]
Underlying device functions
fn spi_read(&self, buff: &mut [u8]) -> Result<usize, Error>
[src]
fn spi_write(&self, buff: &[u8]) -> Result<(), Error>
[src]
fn spi_write_read(
&self,
buff_out: &[u8],
buff_in: &mut [u8]
) -> Result<usize, Error>
[src]
&self,
buff_out: &[u8],
buff_in: &mut [u8]
) -> Result<usize, Error>
fn version(&self) -> Result<u16, Error>
[src]
fn set_gpio_mode_level(
&self,
pin: u8,
mode: GpioMode,
level: GpioLevel
) -> Result<(), Error>
[src]
&self,
pin: u8,
mode: GpioMode,
level: GpioLevel
) -> Result<(), Error>
fn get_gpio_values(&self) -> Result<GpioLevels, Error>
[src]
fn get_gpio_level(&self, pin: u8) -> Result<bool, Error>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Cp2130<'a>
impl<'a> Send for Cp2130<'a>
impl<'a> Sync for Cp2130<'a>
impl<'a> Unpin for Cp2130<'a>
impl<'a> UnwindSafe for Cp2130<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,