This commit is contained in:
Pascal Engélibert 2023-09-11 22:22:20 +02:00
commit d8865488e3
12 changed files with 328 additions and 166 deletions

29
src/fs.rs Normal file
View file

@ -0,0 +1,29 @@
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,
}
}
}