STM32L4xx_HAL_Driver  1.14.0
Initialization and de-initialization functions

Initialization and Configuration functions. More...

Functions

HAL_StatusTypeDef HAL_NOR_Init (NOR_HandleTypeDef *hnor, FMC_NORSRAM_TimingTypeDef *Timing, FMC_NORSRAM_TimingTypeDef *ExtTiming)
 Perform the NOR memory Initialization sequence. More...
 
HAL_StatusTypeDef HAL_NOR_DeInit (NOR_HandleTypeDef *hnor)
 Perform NOR memory De-Initialization sequence. More...
 
void HAL_NOR_MspInit (NOR_HandleTypeDef *hnor)
 Initialize the NOR MSP. More...
 
void HAL_NOR_MspDeInit (NOR_HandleTypeDef *hnor)
 DeInitialize the NOR MSP. More...
 
void HAL_NOR_MspWait (NOR_HandleTypeDef *hnor, uint32_t Timeout)
 NOR MSP Wait for Ready/Busy signal. More...
 

Detailed Description

Initialization and Configuration functions.

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

Function Documentation

◆ HAL_NOR_DeInit()

HAL_StatusTypeDef HAL_NOR_DeInit ( NOR_HandleTypeDef hnor)

Perform NOR memory De-Initialization sequence.

Parameters
hnorpointer to a NOR_HandleTypeDef structure that contains the configuration information for NOR module.
Return values
HALstatus

Definition at line 214 of file stm32l4xx_hal_nor.c.

215 {
216  /* De-Initialize the low level hardware (MSP) */
217  HAL_NOR_MspDeInit(hnor);
218 
219  /* Configure the NOR registers with their reset values */
220  FMC_NORSRAM_DeInit(hnor->Instance, hnor->Extended, hnor->Init.NSBank);
221 
222  /* Update the NOR controller state */
223  hnor->State = HAL_NOR_STATE_RESET;
224 
225  /* Release Lock */
226  __HAL_UNLOCK(hnor);
227 
228  return HAL_OK;
229 }
FMC_NORSRAM_TypeDef * Instance
__HAL_UNLOCK(hrtc)
HAL_StatusTypeDef FMC_NORSRAM_DeInit(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank)
DeInitialize the FMC_NORSRAM peripheral.
FMC_NORSRAM_EXTENDED_TypeDef * Extended
return HAL_OK
FMC_NORSRAM_InitTypeDef Init
void HAL_NOR_MspDeInit(NOR_HandleTypeDef *hnor)
DeInitialize the NOR MSP.
__IO HAL_NOR_StateTypeDef State

◆ HAL_NOR_Init()

HAL_StatusTypeDef HAL_NOR_Init ( NOR_HandleTypeDef hnor,
FMC_NORSRAM_TimingTypeDef Timing,
FMC_NORSRAM_TimingTypeDef ExtTiming 
)

Perform the NOR memory Initialization sequence.

Parameters
hnorpointer to a NOR_HandleTypeDef structure that contains the configuration information for NOR module.
Timingpointer to NOR control timing structure
ExtTimingpointer to NOR extended mode timing structure
Return values
HALstatus

Definition at line 164 of file stm32l4xx_hal_nor.c.

165 {
166  /* Check the NOR handle parameter */
167  if(hnor == NULL)
168  {
169  return HAL_ERROR;
170  }
171 
172  if(hnor->State == HAL_NOR_STATE_RESET)
173  {
174  /* Allocate lock resource and initialize it */
175  hnor->Lock = HAL_UNLOCKED;
176  /* Initialize the low level hardware (MSP) */
177  HAL_NOR_MspInit(hnor);
178  }
179 
180  /* Initialize NOR control Interface */
181  FMC_NORSRAM_Init(hnor->Instance, &(hnor->Init));
182 
183  /* Initialize NOR timing Interface */
184  FMC_NORSRAM_Timing_Init(hnor->Instance, Timing, hnor->Init.NSBank);
185 
186  /* Initialize NOR extended mode timing Interface */
187  FMC_NORSRAM_Extended_Timing_Init(hnor->Extended, ExtTiming, hnor->Init.NSBank, hnor->Init.ExtendedMode);
188 
189  /* Enable the NORSRAM device */
190  __FMC_NORSRAM_ENABLE(hnor->Instance, hnor->Init.NSBank);
191 
192  /* Initialize NOR Memory Data Width*/
193  if (hnor->Init.MemoryDataWidth == FMC_NORSRAM_MEM_BUS_WIDTH_8)
194  {
195  uwNORMemoryDataWidth = NOR_MEMORY_8B;
196  }
197  else
198  {
199  uwNORMemoryDataWidth = NOR_MEMORY_16B;
200  }
201 
202  /* Check the NOR controller state */
203  hnor->State = HAL_NOR_STATE_READY;
204 
205  return HAL_OK;
206 }
FMC_NORSRAM_TypeDef * Instance
static uint32_t uwNORMemoryDataWidth
FMC_NORSRAM_EXTENDED_TypeDef * Extended
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...
FMC_NORSRAM_InitTypeDef Init
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...
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...
void HAL_NOR_MspInit(NOR_HandleTypeDef *hnor)
Initialize the NOR MSP.
__IO HAL_NOR_StateTypeDef State
HAL_LockTypeDef Lock

◆ HAL_NOR_MspDeInit()

__weak void HAL_NOR_MspDeInit ( NOR_HandleTypeDef hnor)

DeInitialize the NOR MSP.

Parameters
hnorpointer to a NOR_HandleTypeDef structure that contains the configuration information for NOR module.
Return values
None

Definition at line 253 of file stm32l4xx_hal_nor.c.

254 {
255  /* Prevent unused argument(s) compilation warning */
256  UNUSED(hnor);
257 
258  /* NOTE : This function should not be modified, when the callback is needed,
259  the HAL_NOR_MspDeInit could be implemented in the user file
260  */
261 }

◆ HAL_NOR_MspInit()

__weak void HAL_NOR_MspInit ( NOR_HandleTypeDef hnor)

Initialize the NOR MSP.

Parameters
hnorpointer to a NOR_HandleTypeDef structure that contains the configuration information for NOR module.
Return values
None

Definition at line 237 of file stm32l4xx_hal_nor.c.

238 {
239  /* Prevent unused argument(s) compilation warning */
240  UNUSED(hnor);
241 
242  /* NOTE : This function should not be modified, when the callback is needed,
243  the HAL_NOR_MspInit could be implemented in the user file
244  */
245 }

◆ HAL_NOR_MspWait()

__weak void HAL_NOR_MspWait ( NOR_HandleTypeDef hnor,
uint32_t  Timeout 
)

NOR MSP Wait for Ready/Busy signal.

Parameters
hnorpointer to a NOR_HandleTypeDef structure that contains the configuration information for NOR module.
TimeoutMaximum timeout value
Return values
None

Definition at line 270 of file stm32l4xx_hal_nor.c.

271 {
272  /* Prevent unused argument(s) compilation warning */
273  UNUSED(hnor);
274  UNUSED(Timeout);
275 
276  /* NOTE : This function should not be modified, when the callback is needed,
277  the HAL_NOR_MspWait could be implemented in the user file
278  */
279 }