STM32L4xx_HAL_Driver  1.14.0
Initialization and de-initialization functions

Initialization and Configuration functions. More...

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...
 

Detailed Description

Initialization and Configuration functions.

  ==============================================================================
           ##### SRAM Initialization and de-initialization functions #####
  ==============================================================================
    [..]  This section provides functions allowing to initialize/de-initialize
          the SRAM memory.

Function Documentation

◆ HAL_SRAM_DeInit()

HAL_StatusTypeDef HAL_SRAM_DeInit ( SRAM_HandleTypeDef hsram)

Perform the SRAM device de-initialization sequence.

Parameters
hsrampointer to a SRAM_HandleTypeDef structure that contains the configuration information for SRAM module.
Return values
HALstatus

Definition at line 162 of file stm32l4xx_hal_sram.c.

163 {
164  /* De-Initialize the low level hardware (MSP) */
165  HAL_SRAM_MspDeInit(hsram);
166 
167  /* Configure the SRAM registers with their reset values */
168  FMC_NORSRAM_DeInit(hsram->Instance, hsram->Extended, hsram->Init.NSBank);
169 
170  hsram->State = HAL_SRAM_STATE_RESET;
171 
172  /* Release Lock */
173  __HAL_UNLOCK(hsram);
174 
175  return HAL_OK;
176 }
__HAL_UNLOCK(hrtc)
FMC_NORSRAM_TypeDef * Instance
HAL_StatusTypeDef FMC_NORSRAM_DeInit(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank)
DeInitialize the FMC_NORSRAM peripheral.
return HAL_OK
FMC_NORSRAM_EXTENDED_TypeDef * Extended
void HAL_SRAM_MspDeInit(SRAM_HandleTypeDef *hsram)
DeInitialize the SRAM MSP.
FMC_NORSRAM_InitTypeDef Init
__IO HAL_SRAM_StateTypeDef State

◆ HAL_SRAM_DMA_XferCpltCallback()

__weak void HAL_SRAM_DMA_XferCpltCallback ( DMA_HandleTypeDef hdma)

DMA transfer complete callback.

Parameters
hdmapointer to a SRAM_HandleTypeDef structure that contains the configuration information for SRAM module.
Return values
None

Definition at line 216 of file stm32l4xx_hal_sram.c.

217 {
218  /* Prevent unused argument(s) compilation warning */
219  UNUSED(hdma);
220 
221  /* NOTE : This function should not be modified, when the callback is needed,
222  the HAL_SRAM_DMA_XferCpltCallback could be implemented in the user file
223  */
224 }

◆ HAL_SRAM_DMA_XferErrorCallback()

__weak void HAL_SRAM_DMA_XferErrorCallback ( DMA_HandleTypeDef hdma)

DMA transfer complete error callback.

Parameters
hdmapointer to a SRAM_HandleTypeDef structure that contains the configuration information for SRAM module.
Return values
None

Definition at line 232 of file stm32l4xx_hal_sram.c.

233 {
234  /* Prevent unused argument(s) compilation warning */
235  UNUSED(hdma);
236 
237  /* NOTE : This function should not be modified, when the callback is needed,
238  the HAL_SRAM_DMA_XferErrorCallback could be implemented in the user file
239  */
240 }

◆ HAL_SRAM_Init()

HAL_StatusTypeDef HAL_SRAM_Init ( SRAM_HandleTypeDef hsram,
FMC_NORSRAM_TimingTypeDef Timing,
FMC_NORSRAM_TimingTypeDef ExtTiming 
)

Perform the SRAM device initialization sequence.

Parameters
hsrampointer to a SRAM_HandleTypeDef structure that contains the configuration information for SRAM module.
TimingPointer to SRAM control timing structure
ExtTimingPointer to SRAM extended mode timing structure
Return values
HALstatus

Definition at line 125 of file stm32l4xx_hal_sram.c.

126 {
127  /* Check the SRAM handle parameter */
128  if(hsram == NULL)
129  {
130  return HAL_ERROR;
131  }
132 
133  if(hsram->State == HAL_SRAM_STATE_RESET)
134  {
135  /* Allocate lock resource and initialize it */
136  hsram->Lock = HAL_UNLOCKED;
137  /* Initialize the low level hardware (MSP) */
138  HAL_SRAM_MspInit(hsram);
139  }
140 
141  /* Initialize SRAM control Interface */
142  FMC_NORSRAM_Init(hsram->Instance, &(hsram->Init));
143 
144  /* Initialize SRAM timing Interface */
145  FMC_NORSRAM_Timing_Init(hsram->Instance, Timing, hsram->Init.NSBank);
146 
147  /* Initialize SRAM extended mode timing Interface */
148  FMC_NORSRAM_Extended_Timing_Init(hsram->Extended, ExtTiming, hsram->Init.NSBank, hsram->Init.ExtendedMode);
149 
150  /* Enable the NORSRAM device */
151  __FMC_NORSRAM_ENABLE(hsram->Instance, hsram->Init.NSBank);
152 
153  return HAL_OK;
154 }
void HAL_SRAM_MspInit(SRAM_HandleTypeDef *hsram)
Initialize the SRAM MSP.
HAL_LockTypeDef Lock
FMC_NORSRAM_TypeDef * Instance
return HAL_OK
HAL_StatusTypeDef FMC_NORSRAM_Extended_Timing_Init(FMC_NORSRAM_EXTENDED_TypeDef *Device, FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode)
Initialize the FMC_NORSRAM Extended mode Timing according to the specified parameters in the FMC_NORS...
HAL_StatusTypeDef FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_InitTypeDef *Init)
Initialize the FMC_NORSRAM device according to the specified control parameters in the FMC_NORSRAM_In...
FMC_NORSRAM_EXTENDED_TypeDef * Extended
FMC_NORSRAM_InitTypeDef Init
HAL_StatusTypeDef FMC_NORSRAM_Timing_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank)
Initialize the FMC_NORSRAM Timing according to the specified parameters in the FMC_NORSRAM_TimingType...
__IO HAL_SRAM_StateTypeDef State

◆ HAL_SRAM_MspDeInit()

__weak void HAL_SRAM_MspDeInit ( SRAM_HandleTypeDef hsram)

DeInitialize the SRAM MSP.

Parameters
hsrampointer to a SRAM_HandleTypeDef structure that contains the configuration information for SRAM module.
Return values
None

Definition at line 200 of file stm32l4xx_hal_sram.c.

201 {
202  /* Prevent unused argument(s) compilation warning */
203  UNUSED(hsram);
204 
205  /* NOTE : This function should not be modified, when the callback is needed,
206  the HAL_SRAM_MspDeInit could be implemented in the user file
207  */
208 }

◆ HAL_SRAM_MspInit()

__weak void HAL_SRAM_MspInit ( SRAM_HandleTypeDef hsram)

Initialize the SRAM MSP.

Parameters
hsrampointer to a SRAM_HandleTypeDef structure that contains the configuration information for SRAM module.
Return values
None

Definition at line 184 of file stm32l4xx_hal_sram.c.

185 {
186  /* Prevent unused argument(s) compilation warning */
187  UNUSED(hsram);
188 
189  /* NOTE : This function should not be modified, when the callback is needed,
190  the HAL_SRAM_MspInit could be implemented in the user file
191  */
192 }