aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/OLIMEX_STM32_H103/board.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/OLIMEX_STM32_H103/board.h')
-rw-r--r--lib/chibios/os/hal/boards/OLIMEX_STM32_H103/board.h132
1 files changed, 132 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/OLIMEX_STM32_H103/board.h b/lib/chibios/os/hal/boards/OLIMEX_STM32_H103/board.h
new file mode 100644
index 000000000..83ac4ec95
--- /dev/null
+++ b/lib/chibios/os/hal/boards/OLIMEX_STM32_H103/board.h
@@ -0,0 +1,132 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef _BOARD_H_
18#define _BOARD_H_
19
20/*
21 * Setup for the Olimex STM33-H103 proto board.
22 */
23
24/*
25 * Board identifier.
26 */
27#define BOARD_OLIMEX_STM32_H103
28#define BOARD_NAME "Olimex STM32-H103"
29
30/*
31 * Board frequencies.
32 */
33#define STM32_LSECLK 32768
34#define STM32_HSECLK 8000000
35
36/*
37 * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
38 */
39#define STM32F10X_MD
40
41/*
42 * IO pins assignments.
43 */
44#define GPIOA_BUTTON 0
45
46#define GPIOC_USB_DISC 11
47#define GPIOC_LED 12
48
49/*
50 * I/O ports initial setup, this configuration is established soon after reset
51 * in the initialization code.
52 *
53 * The digits have the following meaning:
54 * 0 - Analog input.
55 * 1 - Push Pull output 10MHz.
56 * 2 - Push Pull output 2MHz.
57 * 3 - Push Pull output 50MHz.
58 * 4 - Digital input.
59 * 5 - Open Drain output 10MHz.
60 * 6 - Open Drain output 2MHz.
61 * 7 - Open Drain output 50MHz.
62 * 8 - Digital input with PullUp or PullDown resistor depending on ODR.
63 * 9 - Alternate Push Pull output 10MHz.
64 * A - Alternate Push Pull output 2MHz.
65 * B - Alternate Push Pull output 50MHz.
66 * C - Reserved.
67 * D - Alternate Open Drain output 10MHz.
68 * E - Alternate Open Drain output 2MHz.
69 * F - Alternate Open Drain output 50MHz.
70 * Please refer to the STM32 Reference Manual for details.
71 */
72
73/*
74 * Port A setup.
75 * Everything input with pull-up except:
76 * PA0 - Normal input (BUTTON).
77 * PA2 - Alternate output (USART2 TX).
78 * PA3 - Normal input (USART2 RX).
79 */
80#define VAL_GPIOACRL 0x88884B84 /* PA7...PA0 */
81#define VAL_GPIOACRH 0x88888888 /* PA15...PA8 */
82#define VAL_GPIOAODR 0xFFFFFFFF
83
84/*
85 * Port B setup.
86 * Everything input with pull-up except:
87 */
88#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
89#define VAL_GPIOBCRH 0x88888888 /* PB15...PB8 */
90#define VAL_GPIOBODR 0xFFFFFFFF
91
92/*
93 * Port C setup.
94 * Everything input with pull-up except:
95 * PC6 - Normal input because there is an external resistor.
96 * PC7 - Normal input because there is an external resistor.
97 * PC11 - Open Drain output (USB disconnect).
98 * PC12 - Push Pull output (LED).
99 */
100#define VAL_GPIOCCRL 0x44888888 /* PC7...PC0 */
101#define VAL_GPIOCCRH 0x88837888 /* PC15...PC8 */
102#define VAL_GPIOCODR 0xFFFFFFFF
103
104/*
105 * Port D setup.
106 * Everything input with pull-up except:
107 * PD0 - Normal input (XTAL).
108 * PD1 - Normal input (XTAL).
109 */
110#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */
111#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */
112#define VAL_GPIODODR 0xFFFFFFFF
113
114/*
115 * Port E setup.
116 * Everything input with pull-up except:
117 */
118#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */
119#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
120#define VAL_GPIOEODR 0xFFFFFFFF
121
122#if !defined(_FROM_ASM_)
123#ifdef __cplusplus
124extern "C" {
125#endif
126 void boardInit(void);
127#ifdef __cplusplus
128}
129#endif
130#endif /* _FROM_ASM_ */
131
132#endif /* _BOARD_H_ */