Initialization and Configuration functions.
More...
Initialization and Configuration functions.
==============================================================================
##### NAND Initialization and de-initialization functions #####
==============================================================================
[..]
This section provides functions allowing to initialize/de-initialize
the NAND memory
◆ HAL_NAND_ConfigDevice()
Configure the device: Enter the physical parameters of the device.
- Parameters
-
- Return values
-
Definition at line 406 of file stm32l4xx_hal_nand.c.
NAND_DeviceConfigTypeDef Config
FunctionalState ExtraCommandEnable
◆ HAL_NAND_DeInit()
Perform NAND memory De-Initialization sequence.
- Parameters
-
| hnand | pointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module. |
- Return values
-
Definition at line 160 of file stm32l4xx_hal_nand.c.
169 hnand->
State = HAL_NAND_STATE_RESET;
__IO HAL_NAND_StateTypeDef State
void HAL_NAND_MspDeInit(NAND_HandleTypeDef *hnand)
DeInitialize the NAND MSP.
FMC_NAND_InitTypeDef Init
FMC_NAND_TypeDef * Instance
HAL_StatusTypeDef FMC_NAND_DeInit(FMC_NAND_TypeDef *Device, uint32_t Bank)
DeInitializes the FMC_NAND device.
◆ HAL_NAND_Init()
Perform NAND memory Initialization sequence.
- Parameters
-
| hnand | pointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module. |
| ComSpace_Timing | pointer to Common space timing structure |
| AttSpace_Timing | pointer to Attribute space timing structure |
- Return values
-
Definition at line 120 of file stm32l4xx_hal_nand.c.
128 if(hnand->
State == HAL_NAND_STATE_RESET)
149 hnand->
State = HAL_NAND_STATE_READY;
__IO HAL_NAND_StateTypeDef State
void HAL_NAND_MspInit(NAND_HandleTypeDef *hnand)
Initialize the NAND MSP.
HAL_StatusTypeDef FMC_NAND_AttributeSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank)
Initializes the FMC_NAND Attribute space Timing according to the specified parameters in the FMC_NAND...
HAL_StatusTypeDef FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank)
Initializes the FMC_NAND Common space Timing according to the specified parameters in the FMC_NAND_PC...
HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef *Init)
Initializes the FMC_NAND device according to the specified control parameters in the FMC_NAND_HandleT...
FMC_NAND_InitTypeDef Init
FMC_NAND_TypeDef * Instance
◆ HAL_NAND_IRQHandler()
This function handles NAND device interrupt request.
- Parameters
-
| hnand | pointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module. |
- Return values
-
Definition at line 216 of file stm32l4xx_hal_nand.c.
225 __FMC_NAND_CLEAR_FLAG(hnand->
Instance, FMC_FLAG_RISING_EDGE);
235 __FMC_NAND_CLEAR_FLAG(hnand->
Instance, FMC_FLAG_LEVEL);
245 __FMC_NAND_CLEAR_FLAG(hnand->
Instance, FMC_FLAG_FALLING_EDGE);
255 __FMC_NAND_CLEAR_FLAG(hnand->
Instance, FMC_FLAG_FEMPT);
FMC_NAND_InitTypeDef Init
FMC_NAND_TypeDef * Instance
void HAL_NAND_ITCallback(NAND_HandleTypeDef *hnand)
NAND interrupt feature callback.
◆ HAL_NAND_ITCallback()
NAND interrupt feature callback.
- Parameters
-
| hnand | pointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module. |
- Return values
-
Definition at line 266 of file stm32l4xx_hal_nand.c.
◆ HAL_NAND_MspDeInit()
DeInitialize the NAND MSP.
- Parameters
-
| hnand | pointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module. |
- Return values
-
Definition at line 199 of file stm32l4xx_hal_nand.c.
◆ HAL_NAND_MspInit()
Initialize the NAND MSP.
- Parameters
-
| hnand | pointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module. |
- Return values
-
Definition at line 183 of file stm32l4xx_hal_nand.c.
◆ HAL_NAND_Read_ID()
Read the NAND memory electronic signature.
- Parameters
-
| hnand | pointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module. |
| pNAND_ID | NAND ID structure |
- Return values
-
Definition at line 302 of file stm32l4xx_hal_nand.c.
304 __IO uint32_t data = 0;
305 __IO uint32_t data1 = 0;
306 uint32_t deviceAddress = 0;
312 if(hnand->
State == HAL_NAND_STATE_BUSY)
318 deviceAddress = NAND_DEVICE;
321 hnand->
State = HAL_NAND_STATE_BUSY;
324 *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_READID;
326 *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = 0x00;
332 data = *(__IO uint32_t *)deviceAddress;
335 pNAND_ID->
Maker_Id = ADDR_1ST_CYCLE(data);
336 pNAND_ID->
Device_Id = ADDR_2ND_CYCLE(data);
337 pNAND_ID->
Third_Id = ADDR_3RD_CYCLE(data);
338 pNAND_ID->
Fourth_Id = ADDR_4TH_CYCLE(data);
342 data = *(__IO uint32_t *)deviceAddress;
343 data1 = *((__IO uint32_t *)deviceAddress + 4);
346 pNAND_ID->
Maker_Id = ADDR_1ST_CYCLE(data);
347 pNAND_ID->
Device_Id = ADDR_3RD_CYCLE(data);
348 pNAND_ID->
Third_Id = ADDR_1ST_CYCLE(data1);
349 pNAND_ID->
Fourth_Id = ADDR_3RD_CYCLE(data1);
353 hnand->
State = HAL_NAND_STATE_READY;
__IO HAL_NAND_StateTypeDef State
FMC_NAND_InitTypeDef Init