diff options
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_STM8S_DISCOVERY/board.h')
-rw-r--r-- | lib/chibios/os/hal/boards/ST_STM8S_DISCOVERY/board.h | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_STM8S_DISCOVERY/board.h b/lib/chibios/os/hal/boards/ST_STM8S_DISCOVERY/board.h new file mode 100644 index 000000000..372af7509 --- /dev/null +++ b/lib/chibios/os/hal/boards/ST_STM8S_DISCOVERY/board.h | |||
@@ -0,0 +1,121 @@ | |||
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 STMicroelectronics STM8S-Discovery board. | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * Board identifiers. | ||
26 | */ | ||
27 | #define BOARD_ST_STM8S_DISCOVERY | ||
28 | #define BOARD_NAME "ST STM8S-Discovery" | ||
29 | |||
30 | /* | ||
31 | * Board frequencies. | ||
32 | */ | ||
33 | #define HSECLK 16000000 | ||
34 | |||
35 | /* | ||
36 | * MCU model used on the board. | ||
37 | */ | ||
38 | #define STM8S105 | ||
39 | |||
40 | /* | ||
41 | * Pin definitions. | ||
42 | */ | ||
43 | #define PA_OSCIN 1 | ||
44 | #define PA_OSCOUT 2 | ||
45 | |||
46 | #define PC_TS_KEY 1 | ||
47 | #define PC_TS_LOADREF 2 | ||
48 | #define PC_TS_SHIELD 3 | ||
49 | |||
50 | #define PD_LD10 0 | ||
51 | #define PD_SWIM 1 | ||
52 | #define PD_TX 5 | ||
53 | #define PD_RX 6 | ||
54 | |||
55 | /* | ||
56 | * Port A initial setup. | ||
57 | */ | ||
58 | #define VAL_GPIOAODR 0 | ||
59 | #define VAL_GPIOADDR 0 /* All inputs. */ | ||
60 | #define VAL_GPIOACR1 0xFF /* All pull-up or push-pull. */ | ||
61 | #define VAL_GPIOACR2 0 | ||
62 | |||
63 | /* | ||
64 | * Port B initial setup. | ||
65 | */ | ||
66 | #define VAL_GPIOBODR 0 | ||
67 | #define VAL_GPIOBDDR 0 /* All inputs. */ | ||
68 | #define VAL_GPIOBCR1 0xFF /* All push-pull. */ | ||
69 | #define VAL_GPIOBCR2 0 | ||
70 | |||
71 | /* | ||
72 | * Port C initial setup. | ||
73 | */ | ||
74 | #define VAL_GPIOCODR 0 | ||
75 | #define VAL_GPIOCDDR 0 /* All inputs. */ | ||
76 | #define VAL_GPIOCCR1 0xFF /* All pull-up. */ | ||
77 | #define VAL_GPIOCCR2 0 | ||
78 | |||
79 | /* | ||
80 | * Port D initial setup. | ||
81 | */ | ||
82 | #define VAL_GPIODODR (1 << PD_LD10) | (1 << PD_TX) | ||
83 | #define VAL_GPIODDDR (1 << PD_LD10) | (1 << PD_TX) | ||
84 | #define VAL_GPIODCR1 0xFF /* All pull-up. */ | ||
85 | #define VAL_GPIODCR2 0 | ||
86 | |||
87 | /* | ||
88 | * Port E initial setup. | ||
89 | */ | ||
90 | #define VAL_GPIOEODR 0 | ||
91 | #define VAL_GPIOEDDR 0 /* All inputs. */ | ||
92 | #define VAL_GPIOECR1 0xFF /* All pull-up. */ | ||
93 | #define VAL_GPIOECR2 0 | ||
94 | |||
95 | /* | ||
96 | * Port F initial setup. | ||
97 | */ | ||
98 | #define VAL_GPIOFODR 0 | ||
99 | #define VAL_GPIOFDDR 0 /* All inputs. */ | ||
100 | #define VAL_GPIOFCR1 0xFF /* All pull-up. */ | ||
101 | #define VAL_GPIOFCR2 0 | ||
102 | |||
103 | /* | ||
104 | * Port G initial setup. | ||
105 | */ | ||
106 | #define VAL_GPIOGODR 0 | ||
107 | #define VAL_GPIOGDDR 0 /* All inputs. */ | ||
108 | #define VAL_GPIOGCR1 0xFF /* All pull-up or push-pull. */ | ||
109 | #define VAL_GPIOGCR2 0 | ||
110 | |||
111 | #if !defined(_FROM_ASM_) | ||
112 | #ifdef __cplusplus | ||
113 | extern "C" { | ||
114 | #endif | ||
115 | void boardInit(void); | ||
116 | #ifdef __cplusplus | ||
117 | } | ||
118 | #endif | ||
119 | #endif /* _FROM_ASM_ */ | ||
120 | |||
121 | #endif /* _BOARD_H_ */ | ||