Module imxrt_boot_gen::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§

  • FlexSPI lookup table instruction opcodes

Structs§

Enums§

Constants§