diff --git a/src/board.rs b/src/board.rs index 83d4caa..da96d87 100644 --- a/src/board.rs +++ b/src/board.rs @@ -53,7 +53,7 @@ impl Board { gpioc: hal::gpio::gpioc::Parts, gpiod: hal::gpio::gpiod::Parts, gpioe: hal::gpio::gpioe::Parts, - _gpiof: hal::gpio::gpiof::Parts, + gpiof: hal::gpio::gpiof::Parts, gpiog: hal::gpio::gpiog::Parts) -> Pins { Pins { SEED_PIN_0: gpiob.pb12, @@ -96,7 +96,14 @@ impl Board { SD_A: gpioe.pe6, // SAI1 SD_A SD_B: gpioe.pe3, // SAI1 SD_B }, - FMC: (), + FMC: FMCPins { + IO0: gpiof.pf8, + IO1: gpiof.pf9, + IO2: gpiof.pf7, + IO3: gpiof.pf6, + SCK: gpiof.pf10, + CS: gpiog.pg6, + }, SDRAM: (), USB2: USB2Pins { DN: gpioa.pa11, // USB2 D- diff --git a/src/pins.rs b/src/pins.rs index c9b4339..b682da1 100644 --- a/src/pins.rs +++ b/src/pins.rs @@ -52,6 +52,17 @@ pub struct USB2Pins { pub DP: hal::gpio::gpioa::PA12, // USB2 D+ } +#[allow(non_snake_case)] +pub struct FMCPins { + // https://github.com/electro-smith/libDaisy/blob/3dda55e9ed55a2f8b6bc4fa6aa2c7ae134c317ab/src/per/qspi.c#L695 + pub IO0: hal::gpio::gpiof::PF8, // (SI) + pub IO1: hal::gpio::gpiof::PF9, // (SO) + pub IO2: hal::gpio::gpiof::PF7, + pub IO3: hal::gpio::gpiof::PF6, + pub SCK: hal::gpio::gpiof::PF10, + pub CS: hal::gpio::gpiog::PG6, +} + // - Pins --------------------------------------------------------------------- @@ -93,7 +104,7 @@ pub struct Pins { // board peripherals pub LED_USER: LedUserPin, pub AK4556: AK4556Pins, - pub FMC: (), // TODO + pub FMC: FMCPins, pub SDRAM: (), // TODO pub USB2: USB2Pins, }