diff options
Diffstat (limited to 'lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0')
3 files changed, 153 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.c b/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.c new file mode 100644 index 000000000..85e4486b3 --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.c | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | Copyright (C) 2016 flabbergast | ||
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 | #if HAL_USE_PAL || defined(__DOXYGEN__) | ||
20 | /** | ||
21 | * @brief PAL setup. | ||
22 | * @details Digital I/O ports static configuration as defined in @p board.h. | ||
23 | * This variable is used by the HAL when initializing the PAL driver. | ||
24 | */ | ||
25 | const PALConfig pal_default_config = | ||
26 | { | ||
27 | .pads = { | ||
28 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.0: PIN11 (AREF0) */ | ||
29 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.1: PIN9 (AIN2) */ | ||
30 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.2: PIN10 (AIN3) */ | ||
31 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.3: LED_BLUE */ | ||
32 | PAL_MODE_UNCONNECTED, /* P0.4 */ | ||
33 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.5: LED_GREEN */ | ||
34 | PAL_MODE_UNCONNECTED, /* P0.6 */ | ||
35 | PAL_MODE_UNCONNECTED, /* P0.7 */ | ||
36 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.8: LED_RED */ | ||
37 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.9: PIN7 */ | ||
38 | PAL_MODE_UNCONNECTED, /* P0.10 */ | ||
39 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.11: PIN6 */ | ||
40 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.12: PIN5 */ | ||
41 | PAL_MODE_UNCONNECTED, /* P0.13 */ | ||
42 | PAL_MODE_UNCONNECTED, /* P0.14 */ | ||
43 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.15: PIN4 */ | ||
44 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.16: PIN3 */ | ||
45 | PAL_MODE_UNCONNECTED, /* P0.17 */ | ||
46 | PAL_MODE_INPUT_PULLUP, /* P0.18: PIN2 (RX) */ | ||
47 | PAL_MODE_UNCONNECTED, /* P0.19 */ | ||
48 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.20: PIN1 (TX) */ | ||
49 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.21: PIN15 */ | ||
50 | PAL_MODE_UNCONNECTED, /* P0.22 */ | ||
51 | PAL_MODE_UNCONNECTED, /* P0.23 */ | ||
52 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.24: PIN14 */ | ||
53 | PAL_MODE_UNCONNECTED, /* P0.25 */ | ||
54 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.26: PIN13 (LFXTL) (AIN0) */ | ||
55 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.27: PIN12 (LFXTL) (AIN1) */ | ||
56 | PAL_MODE_UNCONNECTED, /* P0.28 */ | ||
57 | PAL_MODE_UNCONNECTED, /* P0.29 */ | ||
58 | PAL_MODE_UNCONNECTED, /* P0.30 */ | ||
59 | PAL_MODE_UNCONNECTED, /* P0.31 */ | ||
60 | }, | ||
61 | }; | ||
62 | #endif | ||
63 | |||
64 | /** | ||
65 | * @brief Early initialization code. | ||
66 | * @details This initialization is performed just after reset before BSS and | ||
67 | * DATA segments initialization. | ||
68 | */ | ||
69 | void __early_init(void) | ||
70 | { | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * @brief Late initialization code. | ||
75 | * @note This initialization is performed after BSS and DATA segments | ||
76 | * initialization and before invoking the main() function. | ||
77 | */ | ||
78 | void boardInit(void) | ||
79 | { | ||
80 | } | ||
diff --git a/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.h b/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.h new file mode 100644 index 000000000..e3bbb0baa --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | Copyright (C) 2016 flabbergast | ||
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 | /* Board identifier. */ | ||
21 | #define BOARD_OSHCHIP_V10 | ||
22 | #define BOARD_NAME "OSHChip_V1.0" | ||
23 | |||
24 | /* Board oscillators-related settings. */ | ||
25 | #define NRF51_XTAL_VALUE 16000000 | ||
26 | |||
27 | /* Non-header GPIO pins. */ | ||
28 | #define LED_RED 8 | ||
29 | #define LED_GREEN 5 | ||
30 | #define LED_BLUE 3 | ||
31 | |||
32 | /* Common peripheral GPIO pins. */ | ||
33 | #define UART_TX 20 | ||
34 | #define UART_RX 18 | ||
35 | |||
36 | /* GPIO on DIP pins. */ | ||
37 | #define OSHCHIP_PIN1 20 | ||
38 | #define OSHCHIP_PIN2 18 | ||
39 | #define OSHCHIP_PIN3 16 | ||
40 | #define OSHCHIP_PIN4 15 | ||
41 | #define OSHCHIP_PIN5 12 | ||
42 | #define OSHCHIP_PIN6 11 | ||
43 | #define OSHCHIP_PIN7 9 | ||
44 | /* Pin 8 is GND */ | ||
45 | #define OSHCHIP_PIN9 1 | ||
46 | #define OSHCHIP_PIN10 2 | ||
47 | #define OSHCHIP_PIN11 0 | ||
48 | #define OSHCHIP_PIN12 27 | ||
49 | #define OSHCHIP_PIN13 26 | ||
50 | #define OSHCHIP_PIN14 24 | ||
51 | #define OSHCHIP_PIN15 21 | ||
52 | /* Pin 16 is VCC */ | ||
53 | |||
54 | #if !defined(_FROM_ASM_) | ||
55 | #ifdef __cplusplus | ||
56 | extern "C" { | ||
57 | #endif | ||
58 | void boardInit(void); | ||
59 | #ifdef __cplusplus | ||
60 | } | ||
61 | #endif | ||
62 | #endif /* _FROM_ASM_ */ | ||
63 | |||
64 | #endif /* _BOARD_H_ */ | ||
diff --git a/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.mk b/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.mk new file mode 100644 index 000000000..de1c59d4d --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.mk | |||
@@ -0,0 +1,9 @@ | |||
1 | # List of all the board related files. | ||
2 | BOARDSRC = ${CHIBIOS_CONTRIB}/os/hal/boards/OSHCHIP_V1.0/board.c | ||
3 | |||
4 | # Required include directories | ||
5 | BOARDINC = ${CHIBIOS_CONTRIB}/os/hal/boards/OSHCHIP_V1.0 | ||
6 | |||
7 | # Shared variables | ||
8 | ALLCSRC += $(BOARDSRC) | ||
9 | ALLINC += $(BOARDINC) | ||