2 ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
4 This file is part of ChibiOS/RT.
6 ChibiOS/RT 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 3 of the License, or
9 (at your option) any later version.
11 ChibiOS/RT 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.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 A special exception to the GPL can be applied should you wish to distribute
22 a combined work that includes ChibiOS/RT, without being obliged to provide
23 the source code for any proprietary components. See the file exception.txt
24 for full details of how and when the exception can be applied.
31 * Setup for the Olimex STM32-H103 proto board.
33 #define SET_USB_CONDITION(en) (!en) /* To connect USB, call palClearPad */
34 #define SET_LED_CONDITION(on) (!on) /* To emit light, call palClearPad */
35 #define GPIO_USB GPIOC_DISC
36 #define IOPORT_USB GPIOC
37 #define GPIO_LED GPIOC_LED
38 #define IOPORT_LED GPIOC
40 /* NeuG settings for ADC2. */
41 #define NEUG_ADC_SETTING2_SMPR1 ADC_SMPR1_SMP_AN10(ADC_SAMPLE_1P5) \
42 | ADC_SMPR1_SMP_AN11(ADC_SAMPLE_1P5)
43 #define NEUG_ADC_SETTING2_SMPR2 0
44 #define NEUG_ADC_SETTING2_SQR3 ADC_SQR3_SQ1_N(ADC_CHANNEL_IN10) \
45 | ADC_SQR3_SQ2_N(ADC_CHANNEL_IN11)
46 #define NEUG_ADC_SETTING2_NUM_CHANNELS 2
51 #define BOARD_OLIMEX_STM32_H103
52 #define BOARD_NAME "Olimex STM32-H103"
57 #define STM32_LSECLK 32768
58 #define STM32_HSECLK 8000000
61 * MCU type, this macro is used by both the ST library and the ChibiOS/RT
67 * IO pins assignments.
69 #define GPIOA_BUTTON 0
70 #define GPIOA_SPI1NSS 4
72 #define GPIOB_SPI2NSS 12
76 #define GPIOC_CANCNTL 10
81 * I/O ports initial setup, this configuration is established soon after reset
82 * in the initialization code.
84 * The digits have the following meaning:
86 * 1 - Push Pull output 10MHz.
87 * 2 - Push Pull output 2MHz.
88 * 3 - Push Pull output 50MHz.
90 * 5 - Open Drain output 10MHz.
91 * 6 - Open Drain output 2MHz.
92 * 7 - Open Drain output 50MHz.
93 * 8 - Digital input with PullUp or PullDown resistor depending on ODR.
94 * 9 - Alternate Push Pull output 10MHz.
95 * A - Alternate Push Pull output 2MHz.
96 * B - Alternate Push Pull output 50MHz.
98 * D - Alternate Open Drain output 10MHz.
99 * E - Alternate Open Drain output 2MHz.
100 * F - Alternate Open Drain output 50MHz.
101 * Please refer to the STM32 Reference Manual for details.
106 * Everything input with pull-up except:
107 * PA0 - Normal input (BUTTON).
108 * PA2 - Alternate output (USART2 TX).
109 * PA3 - Normal input (USART2 RX).
111 #define VAL_GPIOACRL 0x88884B84 /* PA7...PA0 */
112 #define VAL_GPIOACRH 0x88888888 /* PA15...PA8 */
113 #define VAL_GPIOAODR 0xFFFFFFFF
117 * Everything input with pull-up except:
118 * PB13 - Alternate output (MMC SPI2 SCK).
119 * PB14 - Normal input (MMC SPI2 MISO).
120 * PB15 - Alternate output (MMC SPI2 MOSI).
122 #define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
123 #define VAL_GPIOBCRH 0xB4B88888 /* PB15...PB8 */
124 #define VAL_GPIOBODR 0xFFFFFFFF
128 * PC0 - Digital input with PullUp. AN10
129 * PC1 - Digital input with PullUp. AN11
130 * Everything input with pull-up except:
131 * PC6 - Normal input because there is an external resistor.
132 * PC7 - Normal input because there is an external resistor.
133 * PC11 - Open Drain output (USB disconnect).
134 * PC12 - Push Pull output (LED).
136 #define VAL_GPIOCCRL 0x44888888 /* PC7...PC0 */
137 #define VAL_GPIOCCRH 0x88837888 /* PC15...PC8 */
138 #define VAL_GPIOCODR 0xFFFFFFFF
142 * Everything input with pull-up except:
143 * PD0 - Normal input (XTAL).
144 * PD1 - Normal input (XTAL).
146 #define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */
147 #define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */
148 #define VAL_GPIODODR 0xFFFFFFFF
152 * Everything input with pull-up except:
154 #define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */
155 #define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
156 #define VAL_GPIOEODR 0xFFFFFFFF
158 #if !defined(_FROM_ASM_)
162 void boardInit(void);
166 #endif /* _FROM_ASM_ */
168 #endif /* _BOARD_H_ */