diff options
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_EVALKITST7580_1/board.h')
-rw-r--r-- | lib/chibios/os/hal/boards/ST_EVALKITST7580_1/board.h | 221 |
1 files changed, 221 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_EVALKITST7580_1/board.h b/lib/chibios/os/hal/boards/ST_EVALKITST7580_1/board.h new file mode 100644 index 000000000..aaef4a4e5 --- /dev/null +++ b/lib/chibios/os/hal/boards/ST_EVALKITST7580_1/board.h | |||
@@ -0,0 +1,221 @@ | |||
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 | /* | ||
18 | Concepts and parts of this file have been contributed by Rocco Marco | ||
19 | Guglielmi. | ||
20 | */ | ||
21 | #ifndef _BOARD_H_ | ||
22 | #define _BOARD_H_ | ||
23 | |||
24 | /* | ||
25 | * Setup for the ST7580 Evaluation kit board. | ||
26 | */ | ||
27 | |||
28 | /* | ||
29 | * Board identifier. | ||
30 | */ | ||
31 | #define BOARD_ST_EVALKIT_ST7580_1 | ||
32 | #define BOARD_NAME "STMicroelectronics EVALKITST7580_1" | ||
33 | |||
34 | /* | ||
35 | * Board frequencies. | ||
36 | */ | ||
37 | #define STM32_LSECLK 0 | ||
38 | #define STM32_HSECLK 8000000 | ||
39 | |||
40 | /* | ||
41 | * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. | ||
42 | */ | ||
43 | #define STM32F103xB | ||
44 | |||
45 | /* | ||
46 | * IO pins assignments. | ||
47 | */ | ||
48 | #define GPIOA_CL_ADC 0 | ||
49 | #define GPIOA_PLC_T_REQ 1 | ||
50 | #define GPIOA_PLC_TXD 2 | ||
51 | #define GPIOA_PLC_RXD 3 | ||
52 | #define GPIOA_SD_NSS 4 | ||
53 | #define GPIOA_SD_SCLK 5 | ||
54 | #define GPIOA_SD_MISO 6 | ||
55 | #define GPIOA_SD_MOSI 7 | ||
56 | #define GPIOA_8MHZ_MCO 8 | ||
57 | #define GPIOA_UART1_TXD 9 | ||
58 | #define GPIOA_UART1_RXD 10 | ||
59 | #define GPIOA_USBDM 11 | ||
60 | #define GPIOA_USBDP 12 | ||
61 | #define GPIOA_JTMS 13 | ||
62 | #define GPIOA_JTCK 14 | ||
63 | #define GPIOA_JTDI 15 | ||
64 | |||
65 | #define GPIOB_SD_CD 0 | ||
66 | #define GPIOB_PA_ADC 1 | ||
67 | #define GPIOB_BOOT1 2 | ||
68 | #define GPIOB_J_TDO 3 | ||
69 | #define GPIOB_J_TRSTN 4 | ||
70 | #define GPIOB_LED_RED 5 | ||
71 | #define GPIOB_LED_YELLOW 6 | ||
72 | #define GPIOB_LED_GREEN 7 | ||
73 | #define GPIOB_I2C1_SCL 8 | ||
74 | #define GPIOB_I2C1_SDA 9 | ||
75 | #define GPIOB_SW4 10 | ||
76 | #define GPIOB_SW3 11 | ||
77 | #define GPIOB_DIP_SW4 12 | ||
78 | #define GPIOB_DIP_SW3 13 | ||
79 | #define GPIOB_DIP_SW2 14 | ||
80 | #define GPIOB_DIP_SW1 15 | ||
81 | |||
82 | #define GPIOC_PC0 0 | ||
83 | #define GPIOC_PC1 1 | ||
84 | #define GPIOC_PC2 2 | ||
85 | #define GPIOC_PC3 3 | ||
86 | #define GPIOC_PC4 4 | ||
87 | #define GPIOC_PC5 5 | ||
88 | #define GPIOC_PC6 6 | ||
89 | #define GPIOC_PC7 7 | ||
90 | #define GPIOC_PC8 8 | ||
91 | #define GPIOC_PC9 9 | ||
92 | #define GPIOC_PC10 10 | ||
93 | #define GPIOC_PC11 11 | ||
94 | #define GPIOC_PC12 12 | ||
95 | #define GPIOC_PL_RX_ON 13 | ||
96 | #define GPIOC_PL_TX_ON 14 | ||
97 | #define GPIOC_PLC_RESETN 15 | ||
98 | |||
99 | #define GPIOD_OSC_IN 0 | ||
100 | #define GPIOD_OSC_OUT 1 | ||
101 | |||
102 | /* | ||
103 | * I/O ports initial setup, this configuration is established soon after reset | ||
104 | * in the initialization code. | ||
105 | * | ||
106 | * The digits have the following meaning: | ||
107 | * 0 - Analog input. | ||
108 | * 1 - Push Pull output 10MHz. | ||
109 | * 2 - Push Pull output 2MHz. | ||
110 | * 3 - Push Pull output 50MHz. | ||
111 | * 4 - Digital input. | ||
112 | * 5 - Open Drain output 10MHz. | ||
113 | * 6 - Open Drain output 2MHz. | ||
114 | * 7 - Open Drain output 50MHz. | ||
115 | * 8 - Digital input with PullUp or PullDown resistor depending on ODR. | ||
116 | * 9 - Alternate Push Pull output 10MHz. | ||
117 | * A - Alternate Push Pull output 2MHz. | ||
118 | * B - Alternate Push Pull output 50MHz. | ||
119 | * C - Reserved. | ||
120 | * D - Alternate Open Drain output 10MHz. | ||
121 | * E - Alternate Open Drain output 2MHz. | ||
122 | * F - Alternate Open Drain output 50MHz. | ||
123 | * Please refer to the STM32 Reference Manual for details. | ||
124 | */ | ||
125 | |||
126 | /* | ||
127 | * Port A setup. | ||
128 | * PA0 - Analog input (GPIOA_CL_ADC) | ||
129 | * PA1 - Push Pull output (GPIOA_PLC_T_REQ). | ||
130 | * PA2 - Alternate output (GPIOA_PLC_TXD). | ||
131 | * PA3 - Pull-up input (GPIOA_PLC_RXD). | ||
132 | * PA4 - Push Pull output (GPIOA_SD_NSS). | ||
133 | * PA5 - Alternate output (GPIOA_SD_SCLK). | ||
134 | * PA6 - Alternate output (GPIOA_SD_MISO). | ||
135 | * PA7 - Alternate output (GPIOA_SD_MOSI). | ||
136 | * PA8 - Alternate output (GPIOA_8MHZ_MCO). | ||
137 | * PA9 - Alternate output (GPIOA_UART1_TXD). | ||
138 | * PA10 - Normal input (GPIOA_UART1_RXD). | ||
139 | * PA11 - Alternate output (GPIOA_USBDM). | ||
140 | * PA12 - Alternate output (GPIOA_USBDP). | ||
141 | * PA13 - Pull-up input (GPIOA_JTMS). | ||
142 | * PA14 - Pull-down input (GPIOA_JTCK). | ||
143 | * PA15 - Pull-up input (GPIOA_JTDI). | ||
144 | */ | ||
145 | #define VAL_GPIOACRL 0xBBB38B30 /* PA7...PA0 */ | ||
146 | #define VAL_GPIOACRH 0x888BB4BB /* PA15...PA8 */ | ||
147 | #define VAL_GPIOAODR 0xFFFFBFFF | ||
148 | |||
149 | /* | ||
150 | * Port B setup. | ||
151 | * PB0 - Pull-up input (GPIOB_SD_CD) | ||
152 | * PB1 - Analog input (GPIOB_PA_ADC). | ||
153 | * PB2 - Normal input (GPIOB_BOOT1). | ||
154 | * PB3 - Pull-up input (GPIOB_J_TDO). | ||
155 | * PB4 - Pull-up input (GPIOB_J_TRSTN). | ||
156 | * PB5 - Push Pull output (GPIOB_LED_RED). | ||
157 | * PB6 - Push Pull output (GPIOB_LED_YELLOW). | ||
158 | * PB7 - Push Pull output (GPIOB_LED_GREEN). | ||
159 | * PB8 - Alternate output (GPIOB_I2C1_SCL). | ||
160 | * PB9 - Alternate output (GPIOB_I2C1_SDA). | ||
161 | * PB10 - Normal input (GPIOB_SW4). | ||
162 | * PB11 - Normal input (GPIOB_SW3). | ||
163 | * PB12 - Normal input (GPIOB_DIP_SW4). | ||
164 | * PB13 - Normal input (GPIOB_DIP_SW3). | ||
165 | * PB14 - Normal input (GPIOB_DIP_SW2). | ||
166 | * PB15 - Normal input (GPIOB_DIP_SW1). | ||
167 | */ | ||
168 | #define VAL_GPIOBCRL 0x33388408 /* PB7...PB0 */ | ||
169 | #define VAL_GPIOBCRH 0x444444BB /* PB15...PB8 */ | ||
170 | #define VAL_GPIOBODR 0xFFFFFFFF | ||
171 | |||
172 | /* | ||
173 | * Port C setup. | ||
174 | * Everything input with pull-up except: | ||
175 | * PC13 - Normal input (GPIOC_PL_RX_ON). | ||
176 | * PC14 - Normal input (GPIOC_PL_TX_ON). | ||
177 | * PC15 - Push Pull output (GPIOC_PLC_RESETN). | ||
178 | */ | ||
179 | #define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ | ||
180 | #define VAL_GPIOCCRH 0x34488888 /* PC15...PC8 */ | ||
181 | #define VAL_GPIOCODR 0xFFFFFFFF | ||
182 | |||
183 | /* | ||
184 | * Port D setup. | ||
185 | * Everything input with pull-up except: | ||
186 | * PD0 - Normal input (GPIOD_OSC_IN). | ||
187 | * PD1 - Normal input (GPIOD_OSC_OUT). | ||
188 | */ | ||
189 | #define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ | ||
190 | #define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ | ||
191 | #define VAL_GPIODODR 0xFFFFFFFF | ||
192 | |||
193 | /* | ||
194 | * Port E setup. | ||
195 | * Everything input with pull-up except: | ||
196 | */ | ||
197 | #define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ | ||
198 | #define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ | ||
199 | #define VAL_GPIOEODR 0xFFFFFFFF | ||
200 | |||
201 | /* | ||
202 | * USB bus activation macro, required by the USB driver. | ||
203 | */ | ||
204 | #define usb_lld_connect_bus(usbp) | ||
205 | |||
206 | /* | ||
207 | * USB bus de-activation macro, required by the USB driver. | ||
208 | */ | ||
209 | #define usb_lld_disconnect_bus(usbp) | ||
210 | |||
211 | #if !defined(_FROM_ASM_) | ||
212 | #ifdef __cplusplus | ||
213 | extern "C" { | ||
214 | #endif | ||
215 | void boardInit(void); | ||
216 | #ifdef __cplusplus | ||
217 | } | ||
218 | #endif | ||
219 | #endif /* _FROM_ASM_ */ | ||
220 | |||
221 | #endif /* _BOARD_H_ */ | ||