Martin Johnson / STM32F3-Discovery

Dependents:   Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more

Embed: (wiki syntax)

« Back to documentation index

NOR/SRAM Controller functions

NOR/SRAM Controller functions
[FMC_Private_Functions]

NOR/SRAM Controller functions. More...

Functions

void FMC_NORSRAMDeInit (uint32_t FMC_Bank)
 De-initializes the FMC NOR/SRAM Banks registers to their default reset values.
void FMC_NORSRAMInit (FMC_NORSRAMInitTypeDef *FMC_NORSRAMInitStruct)
 Initializes the FMC NOR/SRAM Banks according to the specified parameters in the FMC_NORSRAMInitStruct.
void FMC_NORSRAMStructInit (FMC_NORSRAMInitTypeDef *FMC_NORSRAMInitStruct)
 Fills each FMC_NORSRAMInitStruct member with its default value.
void FMC_NORSRAMCmd (uint32_t FMC_Bank, FunctionalState NewState)
 Enables or disables the specified NOR/SRAM Memory Bank.

Detailed Description

NOR/SRAM Controller functions.

 ===============================================================================
                    ##### NOR and SRAM Controller functions #####
 ===============================================================================  

 [..] The following sequence should be followed to configure the FMC to interface
      with SRAM, PSRAM, NOR or OneNAND memory connected to the NOR/SRAM Bank:
 
   (#) Enable the clock for the FMC and associated GPIOs using the following functions:
          RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FMC, ENABLE);
          RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOx, ENABLE);

   (#) FMC pins configuration 
       (++) Connect the involved FMC pins to AF12 using the following function 
            GPIO_PinAFConfig(GPIOx, GPIO_PinSourcex, GPIO_AF_FMC); 
       (++) Configure these FMC pins in alternate function mode by calling the function
            GPIO_Init();    
       
   (#) Declare a FMC_NORSRAMInitTypeDef structure, for example:
          FMC_NORSRAMInitTypeDef  FMC_NORSRAMInitStructure;
      and fill the FMC_NORSRAMInitStructure variable with the allowed values of
      the structure member.
      
   (#) Initialize the NOR/SRAM Controller by calling the function
          FMC_NORSRAMInit(&FMC_NORSRAMInitStructure); 

   (#) Then enable the NOR/SRAM Bank, for example:
          FMC_NORSRAMCmd(FMC_Bank1_NORSRAM2, ENABLE);  

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

Function Documentation

void FMC_NORSRAMCmd ( uint32_t  FMC_Bank,
FunctionalState  NewState 
)

Enables or disables the specified NOR/SRAM Memory Bank.

Parameters:
FMC_Bank,:specifies the FMC Bank to be used This parameter can be one of the following values:

  • FMC_Bank1_NORSRAM1: FMC Bank1 NOR/SRAM1
  • FMC_Bank1_NORSRAM2: FMC Bank1 NOR/SRAM2
  • FMC_Bank1_NORSRAM3: FMC Bank1 NOR/SRAM3
  • FMC_Bank1_NORSRAM4: FMC Bank1 NOR/SRAM4
NewState,:new state of the FMC_Bank. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 278 of file stm32f30x_fmc.c.

void FMC_NORSRAMDeInit ( uint32_t  FMC_Bank )

De-initializes the FMC NOR/SRAM Banks registers to their default reset values.

Parameters:
FMC_Bank,:specifies the FMC Bank to be used This parameter can be one of the following values:

  • FMC_Bank1_NORSRAM1: FMC Bank1 NOR/SRAM1
  • FMC_Bank1_NORSRAM2: FMC Bank1 NOR/SRAM2
  • FMC_Bank1_NORSRAM3: FMC Bank1 NOR/SRAM3
  • FMC_Bank1_NORSRAM4: FMC Bank1 NOR/SRAM4
Return values:
None

Definition at line 121 of file stm32f30x_fmc.c.

void FMC_NORSRAMInit ( FMC_NORSRAMInitTypeDef *  FMC_NORSRAMInitStruct )

Initializes the FMC NOR/SRAM Banks according to the specified parameters in the FMC_NORSRAMInitStruct.

Parameters:
FMC_NORSRAMInitStruct: pointer to a FMC_NORSRAMInitTypeDef structure that contains the configuration information for the FMC NOR/SRAM specified Banks.
Return values:
None

Definition at line 148 of file stm32f30x_fmc.c.

void FMC_NORSRAMStructInit ( FMC_NORSRAMInitTypeDef *  FMC_NORSRAMInitStruct )

Fills each FMC_NORSRAMInitStruct member with its default value.

Parameters:
FMC_NORSRAMInitStruct,:pointer to a FMC_NORSRAMInitTypeDef structure which will be initialized.
Return values:
None

Definition at line 234 of file stm32f30x_fmc.c.