aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/ARDUINO_MINI
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/ARDUINO_MINI')
-rw-r--r--lib/chibios/os/hal/boards/ARDUINO_MINI/board.c50
-rw-r--r--lib/chibios/os/hal/boards/ARDUINO_MINI/board.h71
-rw-r--r--lib/chibios/os/hal/boards/ARDUINO_MINI/board.mk9
3 files changed, 130 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ARDUINO_MINI/board.c b/lib/chibios/os/hal/boards/ARDUINO_MINI/board.c
new file mode 100644
index 000000000..47ee782c1
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ARDUINO_MINI/board.c
@@ -0,0 +1,50 @@
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#include "hal.h"
18
19/**
20 * @brief PAL setup.
21 * @details Digital I/O ports static configuration as defined in @p board.h.
22 * This variable is used by the HAL when initializing the PAL driver.
23 */
24#if HAL_USE_PAL || defined(__DOXYGEN__)
25const PALConfig pal_default_config =
26{
27#if defined(PORTB)
28 {VAL_PORTB, VAL_DDRB},
29#endif
30#if defined(PORTC)
31 {VAL_PORTC, VAL_DDRC},
32#endif
33#if defined(PORTD)
34 {VAL_PORTD, VAL_DDRD},
35#endif
36};
37#endif /* HAL_USE_PAL */
38
39/**
40 * Board-specific initialization code.
41 */
42void boardInit(void) {
43
44 /*
45 * External interrupts setup, all disabled initially.
46 */
47 EICRA = 0x00;
48 EIMSK = 0x00;
49
50}
diff --git a/lib/chibios/os/hal/boards/ARDUINO_MINI/board.h b/lib/chibios/os/hal/boards/ARDUINO_MINI/board.h
new file mode 100644
index 000000000..dd4bcfe6d
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ARDUINO_MINI/board.h
@@ -0,0 +1,71 @@
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 Arduino Uno or board.
22 */
23
24/*
25 * Board identifier.
26 */
27#define BOARD_ARDUINO_MINI
28#define BOARD_NAME "Arduino Mini"
29
30/*
31 * IO pins assignments.
32 */
33#define PORTB_LED1 5
34
35/*
36 * IO lines assignments.
37 */
38#define LINE_LED1 PAL_LINE(IOPORT2, 5U)
39
40/*
41 * Port B setup.
42 * All inputs except PB5 which has a LED connected.
43 */
44#define VAL_DDRB 0x20
45#define VAL_PORTB 0xFF
46
47/*
48 * Port C setup.
49 * All inputs with pull-ups.
50 */
51#define VAL_DDRC 0x00
52#define VAL_PORTC 0xFF
53
54/*
55 * Port D setup.
56 * All inputs except PD1 (Serial TX0).
57 */
58#define VAL_DDRD 0x02
59#define VAL_PORTD 0xFF
60
61#if !defined(_FROM_ASM_)
62#ifdef __cplusplus
63extern "C" {
64#endif
65 void boardInit(void);
66#ifdef __cplusplus
67}
68#endif
69#endif /* _FROM_ASM_ */
70
71#endif /* _BOARD_H_ */
diff --git a/lib/chibios/os/hal/boards/ARDUINO_MINI/board.mk b/lib/chibios/os/hal/boards/ARDUINO_MINI/board.mk
new file mode 100644
index 000000000..1e32b9124
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ARDUINO_MINI/board.mk
@@ -0,0 +1,9 @@
1# List of all the board related files.
2BOARDSRC = ${CHIBIOS}/os/hal/boards/ARDUINO_MINI/board.c
3
4# Required include directories
5BOARDINC = ${CHIBIOS}/os/hal/boards/ARDUINO_MINI
6
7# Shared variables
8ALLCSRC += $(BOARDSRC)
9ALLINC += $(BOARDINC)