Trailing whitespace
[bertos.git] / bertos / cpu / cortex-m3 / io / stm32_memmap.h
1 /**
2  * \file
3  * <!--
4  * This file is part of BeRTOS.
5  *
6  * Bertos is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  * As a special exception, you may use this file as part of a free software
21  * library without restriction.  Specifically, if other files instantiate
22  * templates or use macros or inline functions from this file, or you compile
23  * this file and link it with other files to produce an executable, this
24  * file does not by itself cause the resulting executable to be covered by
25  * the GNU General Public License.  This exception does not however
26  * invalidate any other reasons why the executable file might be covered by
27  * the GNU General Public License.
28  *
29  * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
30  *
31  * -->
32  *
33  * \brief STM32 memory map.
34  */
35
36 #ifndef STM32_MEMMAP_H
37 #define STM32_MEMMAP_H
38
39 /* Peripheral and SRAM base address in the alias region */
40 #define PERIPH_BB_BASE        (0x42000000)
41 #define SRAM_BB_BASE          (0x22000000)
42
43 /* Peripheral and SRAM base address in the bit-band region */
44 #define SRAM_BASE             (0x20000000)
45 #define PERIPH_BASE           (0x40000000)
46
47 /* Flash refisters base address */
48 #define FLASH_BASE            (0x40022000)
49 /* Flash Option Bytes base address */
50 #define OB_BASE               (0x1FFFF800)
51 /* Device ID register */
52 #define DEVICE_ID_BASE            (0x1FFFF7E8)
53
54 /* Peripheral memory map */
55 #define APB1PERIPH_BASE       (PERIPH_BASE)
56 #define APB2PERIPH_BASE       (PERIPH_BASE + 0x10000)
57 #define AHBPERIPH_BASE        (PERIPH_BASE + 0x20000)
58
59 #define TIM2_BASE             (APB1PERIPH_BASE + 0x0000)
60 #define TIM3_BASE             (APB1PERIPH_BASE + 0x0400)
61 #define TIM4_BASE             (APB1PERIPH_BASE + 0x0800)
62 #define TIM5_BASE             (APB1PERIPH_BASE + 0x0C00)
63 #define TIM6_BASE             (APB1PERIPH_BASE + 0x1000)
64 #define TIM7_BASE             (APB1PERIPH_BASE + 0x1400)
65 #define RTC_BASE              (APB1PERIPH_BASE + 0x2800)
66 #define WWDG_BASE             (APB1PERIPH_BASE + 0x2C00)
67 #define IWDG_BASE             (APB1PERIPH_BASE + 0x3000)
68 #define SPI2_BASE             (APB1PERIPH_BASE + 0x3800)
69 #define SPI3_BASE             (APB1PERIPH_BASE + 0x3C00)
70 #define USART2_BASE           (APB1PERIPH_BASE + 0x4400)
71 #define USART3_BASE           (APB1PERIPH_BASE + 0x4800)
72 #define UART4_BASE            (APB1PERIPH_BASE + 0x4C00)
73 #define UART5_BASE            (APB1PERIPH_BASE + 0x5000)
74 #define I2C1_BASE             (APB1PERIPH_BASE + 0x5400)
75 #define I2C2_BASE             (APB1PERIPH_BASE + 0x5800)
76 #define CAN1_BASE             (APB1PERIPH_BASE + 0x6400)
77 #define CAN2_BASE             (APB1PERIPH_BASE + 0x6800)
78 #define BKP_BASE              (APB1PERIPH_BASE + 0x6C00)
79 #define PWR_BASE              (APB1PERIPH_BASE + 0x7000)
80 #define DAC_BASE              (APB1PERIPH_BASE + 0x7400)
81 #define CEC_BASE              (APB1PERIPH_BASE + 0x7800)
82
83 #define AFIO_BASE             (APB2PERIPH_BASE + 0x0000)
84 #define EXTI_BASE             (APB2PERIPH_BASE + 0x0400)
85 #define GPIOA_BASE            (APB2PERIPH_BASE + 0x0800)
86 #define GPIOB_BASE            (APB2PERIPH_BASE + 0x0C00)
87 #define GPIOC_BASE            (APB2PERIPH_BASE + 0x1000)
88 #define GPIOD_BASE            (APB2PERIPH_BASE + 0x1400)
89 #define GPIOE_BASE            (APB2PERIPH_BASE + 0x1800)
90 #define GPIOF_BASE            (APB2PERIPH_BASE + 0x1C00)
91 #define GPIOG_BASE            (APB2PERIPH_BASE + 0x2000)
92 #define ADC1_BASE             (APB2PERIPH_BASE + 0x2400)
93 #define ADC2_BASE             (APB2PERIPH_BASE + 0x2800)
94 #define TIM1_BASE             (APB2PERIPH_BASE + 0x2C00)
95 #define SPI1_BASE             (APB2PERIPH_BASE + 0x3000)
96 #define TIM8_BASE             (APB2PERIPH_BASE + 0x3400)
97 #define USART1_BASE           (APB2PERIPH_BASE + 0x3800)
98 #define ADC3_BASE             (APB2PERIPH_BASE + 0x3C00)
99 #define TIM15_BASE            (APB2PERIPH_BASE + 0x4000)
100 #define TIM16_BASE            (APB2PERIPH_BASE + 0x4400)
101 #define TIM17_BASE            (APB2PERIPH_BASE + 0x4800)
102
103 #define SDIO_BASE             (PERIPH_BASE + 0x18000)
104
105
106 #define DMA1_BASE             (AHBPERIPH_BASE + 0X0000)
107 #define DMA1_CHANNEL1_BASE    (AHBPERIPH_BASE + 0X0008)
108 #define DMA1_CHANNEL2_BASE    (AHBPERIPH_BASE + 0X001C)
109 #define DMA1_CHANNEL3_BASE    (AHBPERIPH_BASE + 0X0030)
110 #define DMA1_CHANNEL4_BASE    (AHBPERIPH_BASE + 0X0044)
111 #define DMA1_CHANNEL5_BASE    (AHBPERIPH_BASE + 0X0058)
112 #define DMA1_CHANNEL6_BASE    (AHBPERIPH_BASE + 0X006C)
113 #define DMA1_CHANNEL7_BASE    (AHBPERIPH_BASE + 0X0080)
114 #define DMA2_BASE             (AHBPERIPH_BASE + 0X0400)
115 #define DMA2_CHANNEL1_BASE    (AHBPERIPH_BASE + 0X0408)
116 #define DMA2_CHANNEL2_BASE    (AHBPERIPH_BASE + 0X041C)
117 #define DMA2_CHANNEL3_BASE    (AHBPERIPH_BASE + 0X0430)
118 #define DMA2_CHANNEL4_BASE    (AHBPERIPH_BASE + 0X0444)
119 #define DMA2_CHANNEL5_BASE    (AHBPERIPH_BASE + 0X0458)
120 #define RCC_BASE              (AHBPERIPH_BASE + 0X1000)
121 #define CRC_BASE              (AHBPERIPH_BASE + 0X3000)
122
123 #define FLASH_R_BASE          (AHBPERIPH_BASE + 0x2000) ///< Flash registers base address
124
125 #define ETH_BASE              (AHBPERIPH_BASE + 0x8000)
126 #define ETH_MAC_BASE          (ETH_BASE)
127 #define ETH_MMC_BASE          (ETH_BASE + 0x0100)
128 #define ETH_PTP_BASE          (ETH_BASE + 0x0700)
129 #define ETH_DMA_BASE          (ETH_BASE + 0x1000)
130
131 #define FSMC_BANK1_R_BASE     (FSMC_R_BASE + 0x0000) ///< FSMC Bank1 registers base address
132 #define FSMC_BANK1E_R_BASE    (FSMC_R_BASE + 0x0104) ///< FSMC Bank1E registers base address
133 #define FSMC_BANK2_R_BASE     (FSMC_R_BASE + 0x0060) ///< FSMC Bank2 registers base address
134 #define FSMC_BANK3_R_BASE     (FSMC_R_BASE + 0x0080) ///< FSMC Bank3 registers base address
135 #define FSMC_BANK4_R_BASE     (FSMC_R_BASE + 0x00A0) ///< FSMC Bank4 registers base address
136
137 #define DBGMCU_BASE          ((uint32_t)0xE0042000) ///< Debug MCU registers base address
138
139 /* System Control Space memory map */
140 #define SCS_BASE              (0xE000E000)
141
142 #define SYSTICK_BASE          (SCS_BASE + 0x0010)
143 #define NVIC_BASE             (SCS_BASE + 0x0100)
144 #define SCB_BASE              (SCS_BASE + 0x0D00)
145
146 #endif /* STM32_MEMMAP_H */