PioGSpi

Struct PioGSpi 

Source
pub struct PioGSpi<'a> { /* private fields */ }
Expand description

The gSPI PIO peripheral driver

Implementations§

Source§

impl<'a> PioGSpi<'a>

Source

pub fn new( pio: &'a Pio, dma: DmaChannel<'a>, clock_pin: u32, dio_pin: u32, cs_pin: &'a RPGpioPin<'a>, sm_number: SMNumber, ) -> Self

Create a new PioCyw43Spi instance

Source

pub fn sm_number(&self) -> SMNumber

Return SM number

Source

pub fn set_irq_client(&self, client: &'a dyn Client)

Source

pub fn init(&self)

Configure the PIO peripheral as an SPI device to communicate with the CYW43439 chip

Trait Implementations§

Source§

impl DmaChannelClient for PioGSpi<'_>

Source§

impl PioSmClient for PioGSpi<'_>

Source§

fn on_irq(&self)

Source§

impl<'a> SpiMasterDevice<'a> for PioGSpi<'a>

Source§

fn set_client(&self, client: &'a dyn SpiMasterClient)

Set the callback for read_write operations.
Source§

fn read_write_bytes( &self, write_buffer: SubSliceMut<'static, u8>, read_buffer: Option<SubSliceMut<'static, u8>>, ) -> Result<(), (ErrorCode, SubSliceMut<'static, u8>, Option<SubSliceMut<'static, u8>>)>

Source§

fn set_rate(&self, _: u32) -> Result<(), ErrorCode>

Source§

fn set_polarity(&self, _: ClockPolarity) -> Result<(), ErrorCode>

Source§

fn set_phase(&self, _: ClockPhase) -> Result<(), ErrorCode>

Source§

fn configure( &self, _: ClockPolarity, _: ClockPhase, _: u32, ) -> Result<(), ErrorCode>

Configure the bus for this chip select.
Source§

fn get_polarity(&self) -> ClockPolarity

Return the current bus polarity.
Source§

fn get_phase(&self) -> ClockPhase

Get the current bus phase for the current chip select.
Source§

fn get_rate(&self) -> u32

Return the current chip select’s clock rate.

Auto Trait Implementations§

§

impl<'a> !Freeze for PioGSpi<'a>

§

impl<'a> !RefUnwindSafe for PioGSpi<'a>

§

impl<'a> !Send for PioGSpi<'a>

§

impl<'a> !Sync for PioGSpi<'a>

§

impl<'a> Unpin for PioGSpi<'a>

§

impl<'a> !UnwindSafe for PioGSpi<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.