Struct imxrt_boot_gen::flexspi::ConfigurationBlock
source · #[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
cs_hold_time
isRECOMMENDED_CS_HOLD_TIME
cs_setup_time
isRECOMMENDED_CS_SETUP_TIME
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
impl ConfigurationBlock
sourcepub const fn new(lookup_table: LookupTable) -> Self
pub const fn new(lookup_table: LookupTable) -> Self
Create a new configuration block that uses lookup_table
as the
FlexSPI LUT
sourcepub const fn version(self, version: Version) -> Self
pub const fn version(self, version: Version) -> Self
Override the version.
The default value is VERSION_DEFAULT
.
sourcepub const fn read_sample_clk_src(
self,
read_sample_clk_src: ReadSampleClockSource
) -> Self
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
.
sourcepub const fn cs_hold_time(self, cs_hold_time: u8) -> Self
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
.
sourcepub const fn cs_setup_time(self, cs_setup_time: u8) -> Self
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
.
sourcepub const fn column_address_width(
self,
column_address_width: ColumnAddressWidth
) -> Self
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
sourcepub const fn device_mode_configuration(
self,
device_mode_configuration: DeviceModeConfiguration
) -> Self
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
.
sourcepub const fn wait_time_cfg_commands(
self,
wait_time_cfg_commands: WaitTimeConfigurationCommands
) -> Self
pub const fn wait_time_cfg_commands( self, wait_time_cfg_commands: WaitTimeConfigurationCommands ) -> Self
Sets waitTimeCfgCommands
If not set, this defaults to WaitTimeConfigurationCommands::disable()
.
sourcepub const fn serial_flash_pad_type(
self,
serial_flash_pad_type: FlashPadType
) -> Self
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
.
sourcepub const fn serial_clk_freq(
self,
serial_clk_freq: SerialClockFrequency
) -> Self
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
.
sourcepub const fn flash_size(
self,
flash_region: SerialFlashRegion,
flash_size: u32
) -> Self
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
.
sourcepub const fn controller_misc_options(self, options: u32) -> Self
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
impl Clone for ConfigurationBlock
source§fn clone(&self) -> ConfigurationBlock
fn clone(&self) -> ConfigurationBlock
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more