30 lines
726 B
Rust
30 lines
726 B
Rust
use atsamd_hal::{delay::Delay, pac::Peripherals, prelude::*, sercom::spi::EightBit};
|
|
use embedded_sdmmc::{Controller, SdMmcSpi, VolumeIdx};
|
|
|
|
pub struct Fs {
|
|
controller: Controller<SdMmcSpi<maduino_zero_4g::SdSpi, maduino_zero_4g::SdCs>, ClockMock>,
|
|
}
|
|
|
|
impl Fs {
|
|
pub fn new(spi: maduino_zero_4g::SdSpi, cs: maduino_zero_4g::SdCs) -> Self {
|
|
let controller = Controller::new(SdMmcSpi::new(spi, cs), ClockMock);
|
|
Self { controller }
|
|
}
|
|
}
|
|
|
|
struct ClockMock;
|
|
|
|
// TODO
|
|
impl embedded_sdmmc::TimeSource for ClockMock {
|
|
fn get_timestamp(&self) -> embedded_sdmmc::Timestamp {
|
|
embedded_sdmmc::Timestamp {
|
|
year_since_1970: 0,
|
|
zero_indexed_month: 0,
|
|
zero_indexed_day: 0,
|
|
hours: 0,
|
|
minutes: 0,
|
|
seconds: 0,
|
|
}
|
|
}
|
|
}
|