Struct stm32_fmc::Sdram

source ·
pub struct Sdram<FMC, IC> { /* private fields */ }
Expand description

SDRAM Controller

Implementations§

source§

impl<IC: SdramChip, FMC: FmcPeripheral> Sdram<FMC, IC>

source

pub fn new<PINS, BANK, ADDR>(fmc: FMC, _pins: PINS, _chip: IC) -> Self
where PINS: PinsSdram<BANK, ADDR>, ADDR: AddressPinSet, BANK: SdramPinSet,

New SDRAM instance

_pins must be a set of pins connecting to an SDRAM on the FMC controller

§Panics
  • Panics if there are not enough address lines in PINS to access the whole SDRAM

  • Panics if there are not enough bank address lines in PINS to access the whole SDRAM

source

pub fn new_unchecked( fmc: FMC, bank: impl Into<SdramTargetBank>, _chip: IC, ) -> Self

New SDRAM instance

bank denotes which SDRAM bank to target. This can be either bank 1 or bank 2.

§Safety

The pins are not checked against the requirements for the SDRAM chip. So you may be able to initialise a SDRAM without enough pins to access the whole memory

source

pub fn init<D>(&mut self, delay: &mut D) -> *mut u32
where D: DelayUs<u8>,

Initialise SDRAM instance. Delay is used to wait the SDRAM powerup delay

Returns a raw pointer to the memory-mapped SDRAM block

§Panics
  • Panics if any setting in IC::CONFIG cannot be achieved

  • Panics if the FMC source clock is too fast for maximum SD clock in IC::TIMING

Auto Trait Implementations§

§

impl<FMC, IC> Freeze for Sdram<FMC, IC>
where FMC: Freeze,

§

impl<FMC, IC> RefUnwindSafe for Sdram<FMC, IC>
where FMC: RefUnwindSafe, IC: RefUnwindSafe,

§

impl<FMC, IC> Send for Sdram<FMC, IC>
where FMC: Send, IC: Send,

§

impl<FMC, IC> Sync for Sdram<FMC, IC>
where FMC: Sync, IC: Sync,

§

impl<FMC, IC> Unpin for Sdram<FMC, IC>
where FMC: Unpin, IC: Unpin,

§

impl<FMC, IC> UnwindSafe for Sdram<FMC, IC>
where FMC: UnwindSafe, IC: UnwindSafe,

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.