NAND Controller functions.
More...
NAND Controller functions.
===============================================================================
##### NAND Controller functions #####
===============================================================================
[..] The following sequence should be followed to configure the FSMC to interface
with 8-bit or 16-bit NAND memory connected to the NAND Bank:
(#) Enable the clock for the FSMC and associated GPIOs using the following functions:
(++) RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE);
(++) RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOx, ENABLE);
(#) FSMC pins configuration
(++) Connect the involved FSMC pins to AF12 using the following function
GPIO_PinAFConfig(GPIOx, GPIO_PinSourcex, GPIO_AF_FSMC);
(++) Configure these FSMC pins in alternate function mode by calling the function
GPIO_Init();
(#) Declare a FSMC_NANDInitTypeDef structure, for example:
FSMC_NANDInitTypeDef FSMC_NANDInitStructure;
and fill the FSMC_NANDInitStructure variable with the allowed values of
the structure member.
(#) Initialize the NAND Controller by calling the function
FSMC_NANDInit(&FSMC_NANDInitStructure);
(#) Then enable the NAND Bank, for example:
FSMC_NANDCmd(FSMC_Bank3_NAND, ENABLE);
(#) At this stage you can read/write from/to the memory connected to the NAND Bank.
[..]
(@) To enable the Error Correction Code (ECC), you have to use the function
FSMC_NANDECCCmd(FSMC_Bank3_NAND, ENABLE);
[..]
(@) and to get the current ECC value you have to use the function
ECCval = FSMC_GetECC(FSMC_Bank3_NAND);
uint32_t FSMC_GetECC |
( |
uint32_t |
FSMC_Bank | ) |
|
Returns the error correction code register value.
- Parameters
-
FSMC_Bank | specifies the FSMC Bank to be used This parameter can be one of the following values:
- FSMC_Bank2_NAND: FSMC Bank2 NAND
- FSMC_Bank3_NAND: FSMC Bank3 NAND
|
- Return values
-
The | Error Correction Code (ECC) value. |
Definition at line 550 of file stm32f4xx_fsmc.c.
Enables or disables the specified NAND Memory Bank.
- Parameters
-
FSMC_Bank | specifies the FSMC Bank to be used This parameter can be one of the following values:
- FSMC_Bank2_NAND: FSMC Bank2 NAND
- FSMC_Bank3_NAND: FSMC Bank3 NAND
|
NewState | new state of the FSMC_Bank. This parameter can be: ENABLE or DISABLE. |
- Return values
-
Definition at line 471 of file stm32f4xx_fsmc.c.
void FSMC_NANDDeInit |
( |
uint32_t |
FSMC_Bank | ) |
|
De-initializes the FSMC NAND Banks registers to their default reset values.
- Parameters
-
FSMC_Bank | specifies the FSMC Bank to be used This parameter can be one of the following values:
- FSMC_Bank2_NAND: FSMC Bank2 NAND
- FSMC_Bank3_NAND: FSMC Bank3 NAND
|
- Return values
-
Definition at line 346 of file stm32f4xx_fsmc.c.
Enables or disables the FSMC NAND ECC feature.
- Parameters
-
FSMC_Bank | specifies the FSMC Bank to be used This parameter can be one of the following values:
- FSMC_Bank2_NAND: FSMC Bank2 NAND
- FSMC_Bank3_NAND: FSMC Bank3 NAND
|
NewState | new state of the FSMC NAND ECC feature. This parameter can be: ENABLE or DISABLE. |
- Return values
-
Definition at line 511 of file stm32f4xx_fsmc.c.
Initializes the FSMC NAND Banks according to the specified parameters in the FSMC_NANDInitStruct.
- Parameters
-
FSMC_NANDInitStruct | : pointer to a FSMC_NANDInitTypeDef structure that contains the configuration information for the FSMC NAND specified Banks. |
- Return values
-
Definition at line 377 of file stm32f4xx_fsmc.c.
Fills each FSMC_NANDInitStruct member with its default value.
- Parameters
-
- Return values
-
Definition at line 442 of file stm32f4xx_fsmc.c.