STM32L4xx_HAL_Driver  1.14.0
stm32l4xx_hal_sram.c File Reference

SRAM HAL module driver. This file provides a generic firmware to drive SRAM memories mounted as external device. More...

Go to the source code of this file.

Functions

HAL_StatusTypeDef HAL_SRAM_Init (SRAM_HandleTypeDef *hsram, FMC_NORSRAM_TimingTypeDef *Timing, FMC_NORSRAM_TimingTypeDef *ExtTiming)
 Perform the SRAM device initialization sequence. More...
 
HAL_StatusTypeDef HAL_SRAM_DeInit (SRAM_HandleTypeDef *hsram)
 Perform the SRAM device de-initialization sequence. More...
 
void HAL_SRAM_MspInit (SRAM_HandleTypeDef *hsram)
 Initialize the SRAM MSP. More...
 
void HAL_SRAM_MspDeInit (SRAM_HandleTypeDef *hsram)
 DeInitialize the SRAM MSP. More...
 
__weak void HAL_SRAM_DMA_XferCpltCallback (DMA_HandleTypeDef *hdma)
 DMA transfer complete callback. More...
 
__weak void HAL_SRAM_DMA_XferErrorCallback (DMA_HandleTypeDef *hdma)
 DMA transfer complete error callback. More...
 
HAL_StatusTypeDef HAL_SRAM_Read_8b (SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint8_t *pDstBuffer, uint32_t BufferSize)
 Read 8-bit buffer from SRAM memory. More...
 
HAL_StatusTypeDef HAL_SRAM_Write_8b (SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint8_t *pSrcBuffer, uint32_t BufferSize)
 Write 8-bit buffer to SRAM memory. More...
 
HAL_StatusTypeDef HAL_SRAM_Read_16b (SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint16_t *pDstBuffer, uint32_t BufferSize)
 Read 16-bit buffer from SRAM memory. More...
 
HAL_StatusTypeDef HAL_SRAM_Write_16b (SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint16_t *pSrcBuffer, uint32_t BufferSize)
 Write 16-bit buffer to SRAM memory. More...
 
HAL_StatusTypeDef HAL_SRAM_Read_32b (SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pDstBuffer, uint32_t BufferSize)
 Read 32-bit buffer from SRAM memory. More...
 
HAL_StatusTypeDef HAL_SRAM_Write_32b (SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize)
 Write 32-bit buffer to SRAM memory. More...
 
HAL_StatusTypeDef HAL_SRAM_Read_DMA (SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pDstBuffer, uint32_t BufferSize)
 Read a Word data buffer from the SRAM memory using DMA transfer. More...
 
HAL_StatusTypeDef HAL_SRAM_Write_DMA (SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize)
 Write a Word data buffer to SRAM memory using DMA transfer. More...
 
HAL_StatusTypeDef HAL_SRAM_WriteOperation_Enable (SRAM_HandleTypeDef *hsram)
 Enable dynamically SRAM write operation. More...
 
HAL_StatusTypeDef HAL_SRAM_WriteOperation_Disable (SRAM_HandleTypeDef *hsram)
 Disable dynamically SRAM write operation. More...
 
HAL_SRAM_StateTypeDef HAL_SRAM_GetState (SRAM_HandleTypeDef *hsram)
 Return the SRAM controller state. More...
 

Detailed Description

SRAM HAL module driver. This file provides a generic firmware to drive SRAM memories mounted as external device.

Author
MCD Application Team
==============================================================================
                        ##### 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 FMC layer functions to interface 
  with SRAM devices.  
  The following sequence should be followed to configure the FMC to interface
  with SRAM/PSRAM memories: 
    
 (#) 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 
           
 (#) Declare two FMC_NORSRAM_TimingTypeDef structures, for both normal and extended 
     mode timings; for example:
        FMC_NORSRAM_TimingTypeDef  Timing and FMC_NORSRAM_TimingTypeDef  ExTiming;
    and fill its fields with the allowed values of the structure member.
    
 (#) Initialize the SRAM Controller by calling the function HAL_SRAM_Init(). This function
     performs the following sequence:
        
     (##) MSP hardware layer configuration using the function HAL_SRAM_MspInit()
     (##) Control register configuration using the FMC NORSRAM interface function 
          FMC_NORSRAM_Init()
     (##) Timing register configuration using the FMC NORSRAM interface function 
          FMC_NORSRAM_Timing_Init()
     (##) Extended mode Timing register configuration using the FMC NORSRAM interface function 
          FMC_NORSRAM_Extended_Timing_Init()
     (##) Enable the SRAM device using the macro __FMC_NORSRAM_ENABLE()    

 (#) At this stage you can perform read/write accesses from/to the memory connected 
     to the NOR/SRAM Bank. You can perform either polling or DMA transfer using the
     following APIs:
     (++) HAL_SRAM_Read()/HAL_SRAM_Write() for polling read/write access
     (++) HAL_SRAM_Read_DMA()/HAL_SRAM_Write_DMA() for DMA read/write transfer
     
 (#) You can also control the SRAM device by calling the control APIs HAL_SRAM_WriteOperation_Enable()/
     HAL_SRAM_WriteOperation_Disable() to respectively enable/disable the SRAM write operation  
     
 (#) You can continuously monitor the SRAM device HAL state by calling the function
     HAL_SRAM_GetState()              
Attention

© Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32l4xx_hal_sram.c.