Module flexspi

Module flexspi 

Source
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 Sequences:

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§

ConfigurationBlock
FlexSPI configuration block
DeviceModeSequence
Sequence parameter for device mode configuration
Instr
A FlexSPI instruction
LookupTable
A sequence lookup table, part of the general FlexSPI configuration block
Sequence
A collection of FlexSPI instructions
SequenceBuilder
A Sequence builder
SerialClockFrequency
Serial clock frequency for flash read / write.
Version
A version identifier.
WaitTimeConfigurationCommands
Wait time for all configuration commands

Enums§

ColumnAddressWidth
columnAdressWidth
Command
The default sequence definition lookup indices
DeviceModeConfiguration
Describes both the deviceModeCfgEnable field, and the deviceModeArg field, which is only valid if the configuration is enabled.
FlashPadType
sFlashPad field
Pads
Number of pads to use to execute the instruction
ReadSampleClockSource
readSampleClkSrc of the general FCB
SerialClockOption
Options for the serial clock frequency.
SerialFlashRegion
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§

ConfigurationCommand
Configuration commands to augment LUT sequences.