STM32F4 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
NAND Controller functions

NAND Controller functions. More...

Functions

void FSMC_NANDDeInit (uint32_t FSMC_Bank)
 Deinitializes the FSMC NAND Banks registers to their default reset values. More...
 
void FSMC_NANDInit (FSMC_NANDInitTypeDef *FSMC_NANDInitStruct)
 Initializes the FSMC NAND Banks according to the specified parameters in the FSMC_NANDInitStruct. More...
 
void FSMC_NANDStructInit (FSMC_NANDInitTypeDef *FSMC_NANDInitStruct)
 Fills each FSMC_NANDInitStruct member with its default value. More...
 
void FSMC_NANDCmd (uint32_t FSMC_Bank, FunctionalState NewState)
 Enables or disables the specified NAND Memory Bank. More...
 
void FSMC_NANDECCCmd (uint32_t FSMC_Bank, FunctionalState NewState)
 Enables or disables the FSMC NAND ECC feature. More...
 
uint32_t FSMC_GetECC (uint32_t FSMC_Bank)
 Returns the error correction code register value. More...
 

Detailed Description

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:
 
   1. 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);

   2. 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();    
       
   3. 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.
      
   4. Initialize the NAND Controller by calling the function
          FSMC_NANDInit(&FSMC_NANDInitStructure); 

   5. Then enable the NAND Bank, for example:
          FSMC_NANDCmd(FSMC_Bank3_NAND, ENABLE);  

   6. At this stage you can read/write from/to the memory connected to the NAND Bank. 
   
@note 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); 

Function Documentation

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
TheError Correction Code (ECC) value.
void FSMC_NANDCmd ( uint32_t  FSMC_Bank,
FunctionalState  NewState 
)

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
None
void FSMC_NANDDeInit ( uint32_t  FSMC_Bank)

Deinitializes 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
None
void FSMC_NANDECCCmd ( uint32_t  FSMC_Bank,
FunctionalState  NewState 
)

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
None
void FSMC_NANDInit ( FSMC_NANDInitTypeDef FSMC_NANDInitStruct)

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
None
void FSMC_NANDStructInit ( FSMC_NANDInitTypeDef FSMC_NANDInitStruct)

Fills each FSMC_NANDInitStruct member with its default value.

Parameters
FSMC_NANDInitStruct,:pointer to a FSMC_NANDInitTypeDef structure which will be initialized.
Return values
None