Detect code for STM32F100RB CPU (cortex-m3 family) added.
[bertos.git] / bertos / cpu / cortex-m3 / io / stm32.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 STM32F10XX registers definition.
34  */
35
36 #ifndef STM32_H
37 #define STM32_H
38
39 #include <cfg/compiler.h>
40 #include <cfg/macros.h>
41
42 #include <cpu/types.h>
43
44 #include <io/stm32_memmap.h>
45
46 #include "stm32_nvic.h"
47 #include "stm32_ints.h"
48 #include "stm32_gpio.h"
49 #include "stm32_uart.h"
50 #include "stm32_adc.h"
51 #include "stm32_i2c.h"
52 #include "stm32_flash.h"
53
54 #if CPU_CM3_STM32F101C4
55         #define GPIO_USART1_TX_PIN      BV(9)
56         #define GPIO_USART1_RX_PIN      BV(10)
57         #define GPIO_USART2_TX_PIN      BV(2)
58         #define GPIO_USART2_RX_PIN      BV(3)
59 #elif CPU_CM3_STM32F103RB || CPU_CM3_STM32F103RE || CPU_CM3_STM32F100RB
60         #define GPIO_USART1_TX_PIN      BV(9)
61         #define GPIO_USART1_RX_PIN      BV(10)
62         #define GPIO_USART2_TX_PIN      BV(2)
63         #define GPIO_USART2_RX_PIN      BV(3)
64         #define GPIO_USART3_TX_PIN      BV(10)
65         #define GPIO_USART3_RX_PIN      BV(11)
66 #else
67         #error No USART pins are defined for select cpu
68 #endif
69
70 #if CPU_CM3_STM32F101C4
71         #define GPIO_I2C1_SCL_PIN       BV(6)
72         #define GPIO_I2C1_SDA_PIN       BV(7)
73 #elif CPU_CM3_STM32F103RB || CPU_CM3_STM32F103RE || CPU_CM3_STM32F100RB
74         #define GPIO_I2C1_SCL_PIN       BV(6)
75         #define GPIO_I2C1_SDA_PIN       BV(7)
76         #define GPIO_I2C2_SCL_PIN       BV(10)
77         #define GPIO_I2C2_SDA_PIN       BV(11)
78 #else
79         #error No i2c pins are defined for select cpu
80 #endif
81
82 #if CPU_CM3_STM32F101C4 || CPU_CM3_STM32F103RB || CPU_CM3_STM32F103RE || CPU_CM3_STM32F100RB
83         #define FLASH_PAGE_SIZE   1024
84 #else
85         #error No embedded definition for select cpu
86 #endif
87
88 #endif /* STM32_H */