modm API documentation
modm::platform::fsmc::NorSram Class Reference

#include <modm/platform/fsmc/fsmc.hpp>

Classes

struct  AsynchronousTiming
 
struct  SynchronousTiming
 

Public Types

enum  Region { CHIP_SELECT_1 = 0, CHIP_SELECT_2 = 1, CHIP_SELECT_3 = 2, CHIP_SELECT_4 = 3 }
 
enum  WaitPolarity { WAIT_HIGH_ACTIVE, WAIT_LOW_ACTIVE }
 
enum  BusType { NO_MULTIPLEX_8BIT = 0, NO_MULTIPLEX_16BIT = FSMC_BCR1_MWID_0, ADDRESS_DATA_MULIPLEX_8BIT = FSMC_BCR1_MUXEN, ADDRESS_DATA_MULIPLEX_16BIT = FSMC_BCR1_MUXEN | FSMC_BCR1_MWID_0 }
 
enum  MemoryType { SRAM_ROM = 0, PSRAM = FSMC_BCR1_MTYP_0, NOR = FSMC_BCR1_MTYP_1 }
 
enum  AccessMode { MODE_A = 0, MODE_B = FSMC_BTR1_ACCMOD_0, MODE_C = FSMC_BTR1_ACCMOD_1, MODE_D = FSMC_BTR1_ACCMOD_0 | FSMC_BTR1_ACCMOD_1 }
 
enum  ExtendedMode : uint32_t { Disable = 0, Enable = FSMC_BCR1_EXTMOD }
 

Static Public Member Functions

static void resetRegion (Region region)
 
static void enableRegion (Region region, bool enable=true)
 
static void configureSynchronousRegion (Region region, BusType multiplex, MemoryType memoryType, SynchronousTiming timing)
 
static void configureAsynchronousRegion (Region region, BusType multiplex, MemoryType memoryType, AccessMode accessMode, AsynchronousTiming timing, ExtendedMode extended=ExtendedMode::Enable)
 
static void enableAsynchronousWait (Region region, WaitPolarity polarity=WAIT_LOW_ACTIVE)
 
template<typename T >
static constexpr T * getRegionPointer (Region region)
 

Detailed Description

Configure NOR-Flash or (P)SRAM

NOR non-multiplexed

  • CLK
  • A[25:0]
  • D[15:0]
  • NE[x]
  • NOE
  • NWE
  • NL(=NADV)
  • NWAIT

NOR multiplexed

  • A[25:16]
  • AD[15:0]

(P)SRAM

  • NBL[1] - Upper byte enable (NUB)
  • NBL[0] - Lower byte enable (NLB)

Options:

  • multiplexed, non-multiplexed
  • asynchronous, synchronous

Mode 1 (SRAM/CRAM)

  • NOE directly low
  • NWE after address setup
  • Timings: address setup, data phase

Mode A (CRAM)

  • NOE, NWE low after address setup
  • Timings: address setup, data phase

Mode 2/B (NOR Flash)

  • NADV low during address setup
  • NOE directly low
  • Mode 2: NWE low after address setup
  • Mode B: NWE directly low

Mode C (NOR Flash)

  • NADV low during address setup
  • NOE, NWE low after address setup

Mode D

  • Mode C with additional address hold step (NADV, NOE, NWE high)
  • Timings: address setup, address hold, data phase

Mode muxed

  • Mode D with lower address bits on data lanes during address setup step

Async wait: only data phase stage is prolonged, address setup and address hold are not affected.

Memory Type (MTYP):

  • 00 SRAM/ROM (asynchronous, non-multiplexed)
  • 01 PSRAM/Cellular RAM: CRAM ((a)synchronous read/write, (non-)multiplexed)
  • 10 NOR Flash/One NAND Flash ((a)synchronous read, (non-)multiplexed)

Multiplexed mode only valid for NOR and PSRAM

Synchronous => burst mode? NOR Flash and burst write?

Member Enumeration Documentation

Enum ValuesDocumentation
MODE_A 

access mode A

MODE_B 

access mode B

MODE_C 

access mode C

MODE_D 

access mode D

Enum ValuesDocumentation
PSRAM 

PSRAM (CRAM)

NOR 

NOR Flash/OneNAND Flash.

Corresponds to NE1..4.

Member Function Documentation

void modm::platform::fsmc::NorSram::configureSynchronousRegion ( Region  region,
BusType  multiplex,
MemoryType  memoryType,
SynchronousTiming  timing 
)
static

Configure a region of Bank 1 for synchronous access.

The region is disabled afterwards and has to be enabled via enableRegion().

template<typename T >
static constexpr T* modm::platform::fsmc::NorSram::getRegionPointer ( Region  region)
inlinestaticconstexpr

Get mapped memory address of a region.

Each region is 64 MB in size.


The documentation for this class was generated from the following files: