cyw43

Crates

git

Versions

default

Flavors

SdioBusCyw43

Trait SdioBusCyw43 

Source
pub trait SdioBusCyw43<const SIZE: usize> {
    type Error: Debug;

    // Required methods
    fn set_bus_to_high_speed(
        &mut self,
        frequency: u32,
    ) -> Result<(), Self::Error>;
    async fn cmd52(&mut self, arg: u32) -> Result<u16, Self::Error>;
    async fn cmd53_block_read(
        &mut self,
        arg: u32,
        blocks: &mut [Aligned<A4, [u8; SIZE]>],
    ) -> Result<(), Self::Error>;
    async fn cmd53_byte_read(
        &mut self,
        arg: u32,
        buffer: &mut Aligned<A4, [u8]>,
    ) -> Result<(), Self::Error>;
    async fn cmd53_block_write(
        &mut self,
        arg: u32,
        blocks: &[Aligned<A4, [u8; SIZE]>],
    ) -> Result<(), Self::Error>;
    async fn cmd53_byte_write(
        &mut self,
        arg: u32,
        buffer: &Aligned<A4, [u8]>,
    ) -> Result<(), Self::Error>;

    // Provided method
    async fn wait_for_event(&mut self) { ... }
}
Expand description

Custom Spi Trait that only supports the bus operation of the cyw43 Implementors are expected to hold the CS pin low during an operation.

Required Associated Types§

Source

type Error: Debug

The error type for the BlockDevice implementation.

Required Methods§

Source

fn set_bus_to_high_speed(&mut self, frequency: u32) -> Result<(), Self::Error>

Set the bus to high speed 4-bit frequency

Source

async fn cmd52(&mut self, arg: u32) -> Result<u16, Self::Error>

Issue CMD52

Source

async fn cmd53_block_read( &mut self, arg: u32, blocks: &mut [Aligned<A4, [u8; SIZE]>], ) -> Result<(), Self::Error>

Issue CMD53 in block read mode

Source

async fn cmd53_byte_read( &mut self, arg: u32, buffer: &mut Aligned<A4, [u8]>, ) -> Result<(), Self::Error>

Issue CMD53 in byte read mode

Source

async fn cmd53_block_write( &mut self, arg: u32, blocks: &[Aligned<A4, [u8; SIZE]>], ) -> Result<(), Self::Error>

Issue CMD53 in block write mode

Source

async fn cmd53_byte_write( &mut self, arg: u32, buffer: &Aligned<A4, [u8]>, ) -> Result<(), Self::Error>

Issue CMD53 in byte write mode

Provided Methods§

Source

async fn wait_for_event(&mut self)

Wait for events from the Device. A typical implementation would wait for the IRQ pin to be high. The default implementation always reports ready, resulting in active polling of the device.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<const SIZE: usize, T: SdioBusCyw43<SIZE>> SdioBusCyw43<SIZE> for &mut T

Source§

type Error = <T as SdioBusCyw43<SIZE>>::Error

Source§

fn set_bus_to_high_speed(&mut self, frequency: u32) -> Result<(), Self::Error>

Source§

async fn cmd52(&mut self, arg: u32) -> Result<u16, Self::Error>

Source§

async fn cmd53_block_read( &mut self, arg: u32, blocks: &mut [Aligned<A4, [u8; SIZE]>], ) -> Result<(), Self::Error>

Source§

async fn cmd53_byte_read( &mut self, arg: u32, buffer: &mut Aligned<A4, [u8]>, ) -> Result<(), Self::Error>

Source§

async fn cmd53_block_write( &mut self, arg: u32, blocks: &[Aligned<A4, [u8; SIZE]>], ) -> Result<(), Self::Error>

Source§

async fn cmd53_byte_write( &mut self, arg: u32, buffer: &Aligned<A4, [u8]>, ) -> Result<(), Self::Error>

Source§

async fn wait_for_event(&mut self)

Implementors§