Struct AtsamdMci

Source
pub struct AtsamdMci { /* private fields */ }

Implementations§

Source§

impl AtsamdMci

Source

pub fn new(sdhc: SDHC0) -> AtsamdMci

Source

pub fn reset(&mut self)

Source

pub fn wait_busy(&mut self) -> Result<(), MciError>

Source

pub fn set_speed(&mut self, speed: u32, prog_clock_mode: u8)

Source

pub fn send_command_execute( &mut self, cmdr: u16, cmd: u32, arg: u32, ) -> Result<(), MciError>

Send a command

Source

pub fn eistr_err(&mut self) -> Result<(), MciError>

Source

pub fn loop_or_on_eistr_err<F: FnMut(&mut AtsamdMci) -> bool>( &mut self, f: F, ) -> Result<(), MciError>

Trait Implementations§

Source§

impl Mci for AtsamdMci

Source§

fn send_clock(&mut self) -> Result<(), MciError>

Send 74 clock cycles on the line. Note: It is required after card plug and before card install.

Source§

fn init(&mut self) -> Result<(), MciError>

Initialize MCI low level driver.
Source§

fn send_command(&mut self, cmd: u32, arg: u32) -> Result<(), MciError>

Source§

fn deinit(&mut self) -> Result<(), MciError>

Deinitialize MCI low level driver.
Source§

fn select_device( &mut self, _slot: u8, clock: u32, bus_width: &BusWidth, high_speed: bool, ) -> Result<(), MciError>

Select a device and initialize it
Source§

fn deselect_device(&mut self, _slot: u8) -> Result<(), MciError>

Deselect device
Source§

fn get_bus_width(&mut self, slot: u8) -> Result<BusWidth, MciError>

Get the maximum bus width for a device
Source§

fn is_high_speed_capable(&mut self) -> Result<bool, MciError>

Whether the device is high speed capable
Source§

fn get_response(&mut self) -> Result<u32, MciError>

Get 32 bits response of last command
Source§

fn get_response128(&mut self) -> Result<[u32; 4], MciError>

Get 128 bits response of last command
Source§

fn adtc_start( &mut self, command: u32, argument: u32, block_size: u16, block_amount: u16, _access_in_blocks: bool, ) -> Result<(), MciError>

ADTC command start An ADTC (Addressed Data Transfer Commands) is used for R/W access Read more
Source§

fn adtc_stop(&self, _command: u32, _argument: u32) -> Result<(), MciError>

ADTC command stop Send a command to stop an ADTC Read more
Source§

fn read_word(&mut self) -> Result<(u32, u8), MciError>

Read a word on the wire
Source§

fn write_word(&mut self, val: u32) -> Result<bool, MciError>

Write a word on the wire
Source§

fn read_blocks( &mut self, destination: &mut [u8], number_of_blocks: u16, ) -> Result<bool, MciError>

Start a read block transfer on the line Read more
Source§

fn write_blocks( &mut self, write_data: &[u8], number_of_blocks: u16, ) -> Result<bool, MciError>

Start a write block transfer on the line Read more
Source§

fn wait_until_read_finished(&self) -> Result<(), MciError>

Wait until the end of reading the blocks
Source§

fn wait_until_write_finished(&self) -> Result<(), MciError>

Wait until the end of writing blocks

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.