44 HAL SRAM Generic Driver
44.1 SRAM Firmware driver registers structures
44.1.1 SRAM_HandleTypeDef
Data Fields
FSMC_NORSRAM_TypeDef * Instance
FSMC_NORSRAM_EXTENDED_TypeDef * Extended
FSMC_NORSRAM_InitTypeDef Init
HAL_LockTypeDef Lock
__IO HAL_SRAM_StateTypeDef State
DMA_HandleTypeDef * hdma
Field Documentation
FSMC_NORSRAM_TypeDef* SRAM_HandleTypeDef::Instance
Register base address
FSMC_NORSRAM_EXTENDED_TypeDef* SRAM_HandleTypeDef::Extended
Extended mode register base address
FSMC_NORSRAM_InitTypeDef SRAM_HandleTypeDef::Init
SRAM device control configuration parameters
HAL_LockTypeDef SRAM_HandleTypeDef::Lock
SRAM locking object
__IO HAL_SRAM_StateTypeDef SRAM_HandleTypeDef::State
SRAM device access state
DMA_HandleTypeDef* SRAM_HandleTypeDef::hdma
Pointer DMA handler
44.2 SRAM Firmware driver API description
44.2.1 How to use this driver
This driver is a generic layered driver which contains a set of APIs used to control SRAM
memories. It uses the FSMC layer functions to interface with SRAM devices. The following
sequence should be followed to configure the FSMC to interface with SRAM/PSRAM
memories:
1. Declare a SRAM_HandleTypeDef handle structure, for example:
SRAM_HandleTypeDef hsram; and:
Fill the SRAM_HandleTypeDef handle "Init" field with the allowed values of the
structure member.
Fill the SRAM_HandleTypeDef handle "Instance" field with a predefined base
register instance for NOR or SRAM device
Fill the SRAM_HandleTypeDef handle "Extended" field with a predefined base
register instance for NOR or SRAM extended mode
2. Declare two FSMC_NORSRAM_TimingTypeDef structures, for both normal and
extended mode timings; for example: FSMC_NORSRAM_TimingTypeDef Timing and
FSMC_NORSRAM_TimingTypeDef ExTiming; and fill its fields with the allowed values
of the structure member.
3. Initialize the SRAM Controller by calling the function HAL_SRAM_Init(). This function
performs the following sequence:
a. MSP hardware layer configuration using the function HAL_SRAM_MspInit()