aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/RAISONANCE_REVA_STM8S/board.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/RAISONANCE_REVA_STM8S/board.h')
-rw-r--r--lib/chibios/os/hal/boards/RAISONANCE_REVA_STM8S/board.h184
1 files changed, 184 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/RAISONANCE_REVA_STM8S/board.h b/lib/chibios/os/hal/boards/RAISONANCE_REVA_STM8S/board.h
new file mode 100644
index 000000000..510c8bfa0
--- /dev/null
+++ b/lib/chibios/os/hal/boards/RAISONANCE_REVA_STM8S/board.h
@@ -0,0 +1,184 @@
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 Raisonance REva V3 + STM8S208RB daughter board.
22 */
23
24/*
25 * Board identifiers.
26 */
27#define BOARD_REVA_V3_STM8S208RB
28#define BOARD_NAME "Raisonance REva V3 + STM8S208RB"
29
30/*
31 * Board frequencies.
32 */
33#define HSECLK 0
34
35/*
36 * MCU model used on the board.
37 */
38#define STM8S208
39
40/*
41 * Pin definitions.
42 */
43#define PA_OSCIN 1
44#define PA_J2_25 2 /* It is also OSCOUT. */
45#define PA_J2_27 3
46#define PA_RX 4
47#define PA_TX 5
48
49#define PB_LED(n) (n)
50#define PB_LCD_D0 0
51#define PB_LCD_D1 1
52#define PB_LCD_CSB 2
53#define PB_LCD_RESB 3
54
55#define PC_ADC_ETR 0
56#define PC_J2_51 1
57#define PC_J2_53 2
58#define PC_J2_55 3
59#define PC_J2_57 4
60#define PC_SCK 5
61#define PC_MOSI 6
62#define PC_MISO 7
63
64#define PD_J2_69 0
65#define PD_J2_21 1
66#define PD_J2_67 2
67#define PD_J2_65 3
68#define PD_PWM 4
69#define PD_J2_63 5
70#define PD_J2_61 6
71#define PD_J2_59 7
72
73#define PE_P2_49 0
74#define PE_SCL 1
75#define PE_SDA 2
76#define PE_P2_47 3
77#define PE_P2_45 4
78#define PE_P2_43 5
79#define PE_P2_41 6
80#define PE_P2_39 7
81
82#define PF_J2_37 0
83#define PF_J2_35 1
84#define PF_J2_33 2
85#define PF_J2_31 3
86#define PF_ANA_IN1 4
87#define PF_ANA_IN2 5
88#define PF_ANA_TEMP 6
89#define PF_ANA_POT 7
90
91#define PG_CAN_TX 0
92#define PG_CAN_RX 1
93#define PG_BT5 2
94#define PG_BT6 3
95#define PG_SW4 4
96#define PG_SW3 5
97#define PG_SW2 6
98#define PG_SW1 7
99
100#define PI_J2_71 0
101
102/*
103 * Port A initial setup.
104 */
105#define VAL_GPIOAODR (1 << PA_TX) /* PA_TX initially to 1. */
106#define VAL_GPIOADDR (1 << PA_TX) /* PA_TX output, others inputs. */
107#define VAL_GPIOACR1 0xFF /* All pull-up or push-pull. */
108#define VAL_GPIOACR2 0
109
110/*
111 * Port B initial setup.
112 */
113#define VAL_GPIOBODR 0xFF /* Initially all set to high. */
114#define VAL_GPIOBDDR 0xFF /* All outputs. */
115#define VAL_GPIOBCR1 0xFF /* All push-pull. */
116#define VAL_GPIOBCR2 0
117
118/*
119 * Port C initial setup.
120 */
121#define VAL_GPIOCODR 0
122#define VAL_GPIOCDDR 0 /* All inputs. */
123#define VAL_GPIOCCR1 0xFF /* All pull-up. */
124#define VAL_GPIOCCR2 0
125
126/*
127 * Port D initial setup.
128 */
129#define VAL_GPIODODR 0
130#define VAL_GPIODDDR 0 /* All inputs. */
131#define VAL_GPIODCR1 0xFF /* All pull-up. */
132#define VAL_GPIODCR2 0
133
134/*
135 * Port E initial setup.
136 */
137#define VAL_GPIOEODR 0
138#define VAL_GPIOEDDR 0 /* All inputs. */
139#define VAL_GPIOECR1 0xFF /* All pull-up. */
140#define VAL_GPIOECR2 0
141
142/*
143 * Port F initial setup.
144 */
145#define VAL_GPIOFODR 0
146#define VAL_GPIOFDDR 0 /* All inputs. */
147#define VAL_GPIOFCR1 0xFF /* All pull-up. */
148#define VAL_GPIOFCR2 0
149
150/*
151 * Port G initial setup.
152 */
153#define VAL_GPIOGODR (1 << PG_CAN_TX)/* CAN_TX initially to 1. */
154#define VAL_GPIOGDDR (1 << PG_CAN_TX)/* CAN_TX output, others inputs. */
155#define VAL_GPIOGCR1 0xFF /* All pull-up or push-pull. */
156#define VAL_GPIOGCR2 0
157
158/*
159 * Port H initial setup (dummy, not present).
160 */
161#define VAL_GPIOHODR 0
162#define VAL_GPIOHDDR 0 /* All inputs. */
163#define VAL_GPIOHCR1 0xFF /* All pull-up. */
164#define VAL_GPIOHCR2 0
165
166/*
167 * Port I initial setup.
168 */
169#define VAL_GPIOIODR 0
170#define VAL_GPIOIDDR 0 /* All inputs. */
171#define VAL_GPIOICR1 0xFF /* All pull-up. */
172#define VAL_GPIOICR2 0
173
174#if !defined(_FROM_ASM_)
175#ifdef __cplusplus
176extern "C" {
177#endif
178 void boardInit(void);
179#ifdef __cplusplus
180}
181#endif
182#endif /* _FROM_ASM_ */
183
184#endif /* _BOARD_H_ */