#[repr(C, packed(1))]
pub struct ConfigurationBlock { /* private fields */ }
Expand description

FlexSPI configuration block

The FlexSPI configuration block consists of parameters that are for specific flash devices. The configuration block includes the FlexSPI LookupTable. The configuration block is shared between serial NOR and NAND configuration blocks.

§Default Values

All other configurable values are set to a bit pattern of 0.

§Examples

use imxrt_boot_gen::flexspi::*;

const FLEXSPI_CONFIGURATION_BLOCK: ConfigurationBlock =
    ConfigurationBlock::new(LUT)
        .read_sample_clk_src(ReadSampleClockSource::LoopbackFromDQSPad)
        .cs_hold_time(0x01)
        .cs_setup_time(0x02)
        .column_address_width(ColumnAddressWidth::OtherDevices)
        .device_mode_configuration(DeviceModeConfiguration::Disabled)
        .wait_time_cfg_commands(WaitTimeConfigurationCommands::new(40_000))
        .flash_size(SerialFlashRegion::A1, 0x0020_0000)
        .serial_clk_freq(SerialClockFrequency::MHz60)
        .serial_flash_pad_type(FlashPadType::Quad);

Implementations§

source§

impl ConfigurationBlock

source

pub const fn new(lookup_table: LookupTable) -> Self

Create a new configuration block that uses lookup_table as the FlexSPI LUT

source

pub const fn version(self, version: Version) -> Self

Override the version.

The default value is VERSION_DEFAULT.

source

pub const fn read_sample_clk_src( self, read_sample_clk_src: ReadSampleClockSource ) -> Self

readSampleClkSrc, the clock source for FlexSPI

If not set, this defaults to ReadSampleClockSource::InternalLoopback.

source

pub const fn cs_hold_time(self, cs_hold_time: u8) -> Self

Set the chip select hold time (csHoldTime)

If not set, this will be RECOMMENDED_CS_HOLD_TIME, which is 0x03.

source

pub const fn cs_setup_time(self, cs_setup_time: u8) -> Self

Set the chip select setup time (csSetupTime)

If not set, this will be RECOMMENDED_CS_SETUP_TIME, which is 0x03.

source

pub const fn column_address_width( self, column_address_width: ColumnAddressWidth ) -> Self

columnAddressWidth, the properties of the flash memory

If not set, this defaults to ColumnAddressWidth::OtherDevices

source

pub const fn device_mode_configuration( self, device_mode_configuration: DeviceModeConfiguration ) -> Self

Sets device configuration mode. The DeviceModeConfiguration::Disabled variant will set deviceModeCfgEnable to “disabled”. Otherwise, we will set deviceModeCfgEnable to “enabled,” and we use the sequence and argument parameters in the FCB.

If not set, this defaults to DeviceModeConfiguration::Disabled.

source

pub const fn wait_time_cfg_commands( self, wait_time_cfg_commands: WaitTimeConfigurationCommands ) -> Self

Sets waitTimeCfgCommands

If not set, this defaults to WaitTimeConfigurationCommands::disable().

source

pub const fn serial_flash_pad_type( self, serial_flash_pad_type: FlashPadType ) -> Self

Sets the serial flash pad type, sFlashPad.

If not set, this defaults to FlashPadType::Single.

source

pub const fn serial_clk_freq( self, serial_clk_freq: SerialClockFrequency ) -> Self

Sets the serial clock frequencey, serialClkFreq

If not set, this defaults to SerialClockFrequency::MHz30.

source

pub const fn flash_size( self, flash_region: SerialFlashRegion, flash_size: u32 ) -> Self

Set a flash size for the provided flash region

Any region that’s not set will default to 0.

source

pub const fn controller_misc_options(self, options: u32) -> Self

Set miscellaneous controller options.

See your chip’s reference manual for more information on valid values. This method performs no checking on the input.

Trait Implementations§

source§

impl Clone for ConfigurationBlock

source§

fn clone(&self) -> ConfigurationBlock

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConfigurationBlock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for ConfigurationBlock

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