diff options
Diffstat (limited to 'stm/lib/stm32f4xx_syscfg.c')
-rw-r--r-- | stm/lib/stm32f4xx_syscfg.c | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/stm/lib/stm32f4xx_syscfg.c b/stm/lib/stm32f4xx_syscfg.c index 6b3ada0537..638f76115a 100644 --- a/stm/lib/stm32f4xx_syscfg.c +++ b/stm/lib/stm32f4xx_syscfg.c @@ -2,8 +2,8 @@ ******************************************************************************
* @file stm32f4xx_syscfg.c
* @author MCD Application Team
- * @version V1.1.0
- * @date 11-January-2013
+ * @version V1.3.0
+ * @date 08-November-2013
* @brief This file provides firmware functions to manage the SYSCFG peripheral.
*
@verbatim
@@ -14,7 +14,10 @@ [..] This driver provides functions for:
(#) Remapping the memory accessible in the code area using SYSCFG_MemoryRemapConfig()
-
+
+ (#) Swapping the internal flash Bank1 and Bank2 this features is only visible for
+ STM32F42xxx/43xxx devices Devices.
+
(#) Manage the EXTI lines connection to the GPIOs using SYSCFG_EXTILineConfig()
(#) Select the ETHERNET media interface (RMII/RII) using SYSCFG_ETH_MediaInterfaceConfig()
@@ -44,7 +47,6 @@ */
/* Includes ------------------------------------------------------------------*/
-#include "stm32f4xx_conf.h"
#include "stm32f4xx_syscfg.h"
#include "stm32f4xx_rcc.h"
@@ -61,6 +63,12 @@ /* Private define ------------------------------------------------------------*/
/* ------------ RCC registers bit address in the alias region ----------- */
#define SYSCFG_OFFSET (SYSCFG_BASE - PERIPH_BASE)
+/* --- MEMRMP Register ---*/
+/* Alias word address of UFB_MODE bit */
+#define MEMRMP_OFFSET SYSCFG_OFFSET
+#define UFB_MODE_BitNumber ((uint8_t)0x8)
+#define UFB_MODE_BB (PERIPH_BB_BASE + (MEMRMP_OFFSET * 32) + (UFB_MODE_BitNumber * 4))
+
/* --- PMC Register ---*/
/* Alias word address of MII_RMII_SEL bit */
@@ -101,8 +109,10 @@ void SYSCFG_DeInit(void) * This parameter can be one of the following values:
* @arg SYSCFG_MemoryRemap_Flash: Main Flash memory mapped at 0x00000000
* @arg SYSCFG_MemoryRemap_SystemFlash: System Flash memory mapped at 0x00000000
- * @arg SYSCFG_MemoryRemap_FSMC: FSMC (Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000
- * @arg SYSCFG_MemoryRemap_SRAM: Embedded SRAM (112kB) mapped at 0x00000000
+ * @arg SYSCFG_MemoryRemap_FSMC: FSMC (Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000 for STM32F405xx/407xx and STM32F415xx/417xx devices.
+ * @arg SYSCFG_MemoryRemap_FMC: FMC (Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000 for STM32F42xxx/43xxx devices.
+ * @arg SYSCFG_MemoryRemap_SRAM: Embedded SRAM (112kB) mapped at 0x00000000
+ * @arg SYSCFG_MemoryRemap_SDRAM: FMC (External SDRAM) mapped at 0x00000000 for STM32F42xxx/43xxx devices.
* @retval None
*/
void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap)
@@ -114,15 +124,38 @@ void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap) }
/**
+ * @brief Enables or disables the Interal FLASH Bank Swapping.
+ *
+ * @note This function can be used only for STM32F42xxx/43xxx devices.
+ *
+ * @param NewState: new state of Interal FLASH Bank swapping.
+ * This parameter can be one of the following values:
+ * @arg ENABLE: Flash Bank2 mapped at 0x08000000 (and aliased @0x00000000)
+ * and Flash Bank1 mapped at 0x08100000 (and aliased at 0x00100000)
+ * @arg DISABLE:(the default state) Flash Bank1 mapped at 0x08000000 (and aliased @0x0000 0000)
+ and Flash Bank2 mapped at 0x08100000 (and aliased at 0x00100000)
+ * @retval None
+ */
+void SYSCFG_MemorySwappingBank(FunctionalState NewState)
+{
+ /* Check the parameters */
+ assert_param(IS_FUNCTIONAL_STATE(NewState));
+
+ *(__IO uint32_t *) UFB_MODE_BB = (uint32_t)NewState;
+}
+
+/**
* @brief Selects the GPIO pin used as EXTI Line.
* @param EXTI_PortSourceGPIOx : selects the GPIO port to be used as source for
- * EXTI lines where x can be (A..I) for STM32F40xx/STM32F41xx
- * and STM32F427x/STM32F437x devices.
+ * EXTI lines where x can be (A..K) for STM32F42xxx/43xxx devices, (A..I)
+ * for STM32F405xx/407xx and STM32F415xx/417xx devices or (A, B, C, D and H)
+ * for STM32401xx devices.
*
* @param EXTI_PinSourcex: specifies the EXTI line to be configured.
* This parameter can be EXTI_PinSourcex where x can be (0..15, except
- * for EXTI_PortSourceGPIOI x can be (0..11) for STM32F40xx/STM32F41xx
- * and STM32F427x/STM32F437x devices.
+ * for EXTI_PortSourceGPIOI x can be (0..11) for STM32F405xx/407xx
+ * and STM32F405xx/407xx devices and for EXTI_PortSourceGPIOK x can
+ * be (0..7) for STM32F42xxx/43xxx devices.
*
* @retval None
*/
|