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
NOR/SRAM Controller functions

NOR/SRAM Controller functions. More...

Functions

void FSMC_NORSRAMDeInit (uint32_t FSMC_Bank)
 Deinitializes the FSMC NOR/SRAM Banks registers to their default reset values. More...
 
void FSMC_NORSRAMInit (FSMC_NORSRAMInitTypeDef *FSMC_NORSRAMInitStruct)
 Initializes the FSMC NOR/SRAM Banks according to the specified parameters in the FSMC_NORSRAMInitStruct. More...
 
void FSMC_NORSRAMStructInit (FSMC_NORSRAMInitTypeDef *FSMC_NORSRAMInitStruct)
 Fills each FSMC_NORSRAMInitStruct member with its default value. More...
 
void FSMC_NORSRAMCmd (uint32_t FSMC_Bank, FunctionalState NewState)
 Enables or disables the specified NOR/SRAM Memory Bank. More...
 

Detailed Description

NOR/SRAM Controller functions.

 ===============================================================================
                    NOR/SRAM Controller functions
 ===============================================================================  

 The following sequence should be followed to configure the FSMC to interface with
 SRAM, PSRAM, NOR or OneNAND memory connected to the NOR/SRAM 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_NORSRAMInitTypeDef structure, for example:
          FSMC_NORSRAMInitTypeDef  FSMC_NORSRAMInitStructure;
      and fill the FSMC_NORSRAMInitStructure variable with the allowed values of
      the structure member.
      
   4. Initialize the NOR/SRAM Controller by calling the function
          FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure); 

   5. Then enable the NOR/SRAM Bank, for example:
          FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM2, ENABLE);  

   6. At this stage you can read/write from/to the memory connected to the NOR/SRAM Bank. 

Function Documentation

void FSMC_NORSRAMCmd ( uint32_t  FSMC_Bank,
FunctionalState  NewState 
)

Enables or disables the specified NOR/SRAM Memory Bank.

Parameters
FSMC_Bank,:specifies the FSMC Bank to be used This parameter can be one of the following values:
  • FSMC_Bank1_NORSRAM1: FSMC Bank1 NOR/SRAM1
  • FSMC_Bank1_NORSRAM2: FSMC Bank1 NOR/SRAM2
  • FSMC_Bank1_NORSRAM3: FSMC Bank1 NOR/SRAM3
  • FSMC_Bank1_NORSRAM4: FSMC Bank1 NOR/SRAM4
NewState,:new state of the FSMC_Bank. This parameter can be: ENABLE or DISABLE.
Return values
None
void FSMC_NORSRAMDeInit ( uint32_t  FSMC_Bank)

Deinitializes the FSMC NOR/SRAM 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_Bank1_NORSRAM1: FSMC Bank1 NOR/SRAM1
  • FSMC_Bank1_NORSRAM2: FSMC Bank1 NOR/SRAM2
  • FSMC_Bank1_NORSRAM3: FSMC Bank1 NOR/SRAM3
  • FSMC_Bank1_NORSRAM4: FSMC Bank1 NOR/SRAM4
Return values
None
void FSMC_NORSRAMInit ( FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStruct)

Initializes the FSMC NOR/SRAM Banks according to the specified parameters in the FSMC_NORSRAMInitStruct.

Parameters
FSMC_NORSRAMInitStruct: pointer to a FSMC_NORSRAMInitTypeDef structure that contains the configuration information for the FSMC NOR/SRAM specified Banks.
Return values
None
void FSMC_NORSRAMStructInit ( FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStruct)

Fills each FSMC_NORSRAMInitStruct member with its default value.

Parameters
FSMC_NORSRAMInitStruct,:pointer to a FSMC_NORSRAMInitTypeDef structure which will be initialized.
Return values
None