[−][src]Trait driver_cp2130::Device
Device trait provides methods directly on the CP2130
Required methods
fn spi_read(&self, buff: &mut [u8]) -> Result<usize, Error>
Read from the SPI device
fn spi_write(&self, buff: &[u8]) -> Result<(), Error>
Write to the SPI device
fn spi_write_read(
&self,
buff_out: &[u8],
buff_in: &mut [u8]
) -> Result<usize, Error>
&self,
buff_out: &[u8],
buff_in: &mut [u8]
) -> Result<usize, Error>
fn version(&self) -> Result<u16, Error>
Fetch the CP2130 chip version
fn set_gpio_mode_level(
&self,
pin: u8,
mode: GpioMode,
level: GpioLevel
) -> Result<(), Error>
&self,
pin: u8,
mode: GpioMode,
level: GpioLevel
) -> Result<(), Error>
Set the mode and level for a given GPIO pin
fn get_gpio_values(&self) -> Result<GpioLevels, Error>
Fetch the values for all GPIO pins
fn get_gpio_level(&self, pin: u8) -> Result<bool, Error>
Fetch the value for a given GPIO pin
Implementors
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>