Expand description
FlexSPI configuration block definitions
The FlexSPI module includes
- instruction sequences
- instruction lookup table (LUT)
- the FlexSPI configuration block
The flexspi
types are used throughout the serial_flash
API, since the FlexSPI
configuration block is at the start of every serial NOR / NAND configuration block.
§Sequences and LUTs
A Sequence
is a collection of up to eight FlexSPI instructions (Instr
).
The FlexSPI controller sequentially executes instructions to perform reads, writes
and I/O with a connected FLASH device. The FlexSPI controller finds each sequence
in a LookupTable
.
Use a SequenceBuilder
to create Sequence
s:
use imxrt_boot_gen::flexspi::{Instr, Sequence, SequenceBuilder, Pads, opcodes::sdr::*};
const SEQ_READ: Sequence = SequenceBuilder::new()
.instr(Instr::new(CMD, Pads::One, FAST_READ_QUAD_IO))
.instr(Instr::new(RADDR, Pads::Four, 0x18))
.instr(Instr::new(DUMMY, Pads::Four, 0x06))
.instr(Instr::new(READ, Pads::Four, 0x04))
.build();
const SEQ_READ_STATUS: Sequence = SequenceBuilder::new()
.instr(Instr::new(CMD, Pads::One, READ_STATUS_REGISTER_1))
.instr(Instr::new(READ, Pads::One, 0x04))
.build();
Then, assign each sequence to a Command
in a LookupTable
:
use imxrt_boot_gen::flexspi::{Command, LookupTable};
const LUT: LookupTable = LookupTable::new()
.command(Command::Read, SEQ_READ)
.command(Command::ReadStatus, SEQ_READ_STATUS);
§FlexSPI Configuration Block
Once you’ve created your sequences and lookup table, use the lookup table to create
a ConfigurationBlock
. See the ConfigurationBlock
documentation
for more information.
Modules§
- opcodes
- FlexSPI lookup table instruction opcodes
Structs§
- Configuration
Block - FlexSPI configuration block
- Device
Mode Sequence - Sequence parameter for device mode configuration
- Instr
- A FlexSPI instruction
- Lookup
Table - A sequence lookup table, part of the general FlexSPI configuration block
- Sequence
- A collection of FlexSPI instructions
- Sequence
Builder - A
Sequence
builder - Serial
Clock Frequency - Serial clock frequency for flash read / write.
- Version
- A version identifier.
- Wait
Time Configuration Commands - Wait time for all configuration commands
Enums§
- Column
Address Width columnAdressWidth
- Command
- The default sequence definition lookup indices
- Device
Mode Configuration - Describes both the
deviceModeCfgEnable
field, and thedeviceModeArg
field, which is only valid if the configuration is enabled. - Flash
PadType sFlashPad
field- Pads
- Number of pads to use to execute the instruction
- Read
Sample Clock Source readSampleClkSrc
of the general FCB- Serial
Clock Option - Options for the serial clock frequency.
- Serial
Flash Region - A FlexSPI serial flash region
Constants§
- JUMP_
ON_ CS - JUMP_ON_CS FlexSPI instruction
- RECOMMENDED_
CS_ HOLD_ TIME - The recommended
csHoldTime
,0x03
. - RECOMMENDED_
CS_ SETUP_ TIME - The recommended
csSetupTime
,0x03
. - STOP
- STOP FlexSPI instruction
- VERSION_
DEFAULT - The default FCB version used by this library.
Type Aliases§
- Configuration
Command - Configuration commands to augment LUT sequences.