diff options
Diffstat (limited to 'lib/chibios-contrib/os/hal/boards/EXP430FR5969')
3 files changed, 177 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/boards/EXP430FR5969/board.c b/lib/chibios-contrib/os/hal/boards/EXP430FR5969/board.c new file mode 100644 index 000000000..08c71112f --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/EXP430FR5969/board.c | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2016 Andrew Wygle aka awygle | ||
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__) | ||
25 | const PALConfig pal_default_config = | ||
26 | { | ||
27 | {VAL_IOPORT1_OUT, VAL_IOPORT1_DIR, VAL_IOPORT1_REN, VAL_IOPORT1_SEL0, | ||
28 | VAL_IOPORT1_SEL1}, | ||
29 | {VAL_IOPORT2_OUT, VAL_IOPORT2_DIR, VAL_IOPORT2_REN, VAL_IOPORT2_SEL0, | ||
30 | VAL_IOPORT2_SEL1}, | ||
31 | {VAL_IOPORT0_OUT, VAL_IOPORT0_DIR, VAL_IOPORT0_REN, VAL_IOPORT0_SEL0, | ||
32 | VAL_IOPORT0_SEL1} | ||
33 | }; /* Set UART TX pin correctly */ | ||
34 | #endif /* HAL_USE_PAL */ | ||
35 | |||
36 | /** | ||
37 | * Board-specific initialization code. | ||
38 | */ | ||
39 | void boardInit(void) { | ||
40 | |||
41 | /* | ||
42 | * External interrupts setup, all disabled initially. | ||
43 | */ | ||
44 | _disable_interrupts(); | ||
45 | |||
46 | } | ||
diff --git a/lib/chibios-contrib/os/hal/boards/EXP430FR5969/board.h b/lib/chibios-contrib/os/hal/boards/EXP430FR5969/board.h new file mode 100644 index 000000000..a0ed8f792 --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/EXP430FR5969/board.h | |||
@@ -0,0 +1,123 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2016 Andrew Wygle aka awygle | ||
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 EXP430FR5969 LaunchPad board | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * Board identifier. | ||
26 | */ | ||
27 | #define BOARD_EXP430FR5959 | ||
28 | #define BOARD_NAME "MSP430FR5969 LaunchPad" | ||
29 | |||
30 | /* | ||
31 | * IO lines assignments. | ||
32 | */ | ||
33 | #define LINE_LED_G PAL_LINE(IOPORT1, 0U) | ||
34 | #define LINE_LED_R PAL_LINE(IOPORT2, 14U) | ||
35 | #define LINE_SW_S1 PAL_LINE(IOPORT2, 13U) | ||
36 | #define LINE_SW_S2 PAL_LINE(IOPORT1, 1U) | ||
37 | |||
38 | /* | ||
39 | * I/O ports initial setup, this configuration is established soon after reset | ||
40 | * in the initialization code. | ||
41 | * Please refer to the MSP430X Family Users Guide for details. | ||
42 | */ | ||
43 | /* | ||
44 | * Port A setup: | ||
45 | * | ||
46 | * P1.0 - Green LED (output low) | ||
47 | * P1.1 - Switch S2 (input pullup) | ||
48 | * P1.2 - BoosterPack BP19 (input pullup) | ||
49 | * P1.3 - BoosterPack BP11 (input pullup) | ||
50 | * P1.4 - BoosterPack BP12 (input pullup) | ||
51 | * P1.5 - BoosterPack BP13 (input pullup) | ||
52 | * P1.6 - BoosterPack BP15 (input pullup) | ||
53 | * P1.7 - BoosterPack BP14 (input pullup) | ||
54 | * P2.0 - Application UART TX (alternate 2) | ||
55 | * P2.1 - Application UART RX (alternate 2) | ||
56 | * P2.2 - BoosterPack BP7 (input pullup) | ||
57 | * P2.3 - N/C (input pullup) | ||
58 | * P2.4 - BoosterPack BP6 (input pullup) | ||
59 | * P2.5 - BoosterPack BP4 (input pullup) | ||
60 | * P2.6 - BoosterPack BP3 (input pullup) | ||
61 | * P2.7 - N/C (input pullup) | ||
62 | */ | ||
63 | #define VAL_IOPORT1_OUT 0xFCFE | ||
64 | #define VAL_IOPORT1_DIR 0x0001 | ||
65 | #define VAL_IOPORT1_REN 0xFCFE | ||
66 | #define VAL_IOPORT1_SEL0 0x0000 | ||
67 | #define VAL_IOPORT1_SEL1 0x0300 | ||
68 | |||
69 | /* | ||
70 | * Port B setup: | ||
71 | * | ||
72 | * P3.0 - BoosterPack BP18 (input pullup) | ||
73 | * P3.1 - N/C (input pullup) | ||
74 | * P3.2 - N/C (input pullup) | ||
75 | * P3.3 - N/C (input pullup) | ||
76 | * P3.4 - BoosterPack BP8 (input pullup) | ||
77 | * P3.5 - BoosterPack BP9 (input pullup) | ||
78 | * P3.6 - BoosterPack BP10 (input pullup) | ||
79 | * P3.7 - N/C (input pullup) | ||
80 | * P4.0 - Application UART CTS (input pullup) | ||
81 | * P4.1 - Application UART RTS (output high) | ||
82 | * P4.2 - BoosterPack BP2 (input pullup) | ||
83 | * P4.3 - BoosterPack BP5 (input pullup) | ||
84 | * P4.4 - N/C (input pullup) | ||
85 | * P4.5 - Switch S1 (input pullup) | ||
86 | * P4.6 - Red LED (output low) | ||
87 | * P4.7 - N/C (input pullup) | ||
88 | */ | ||
89 | #define VAL_IOPORT2_OUT 0xBFFF | ||
90 | #define VAL_IOPORT2_DIR 0x4200 | ||
91 | #define VAL_IOPORT2_REN 0xBDFF | ||
92 | #define VAL_IOPORT2_SEL0 0x0000 | ||
93 | #define VAL_IOPORT2_SEL1 0x0000 | ||
94 | |||
95 | /* | ||
96 | * Port J setup: | ||
97 | * | ||
98 | * PJ.0 - TDO (input pullup) | ||
99 | * PJ.1 - TDI (input pullup) | ||
100 | * PJ.2 - TMS (input pullup) | ||
101 | * PJ.3 - TCK (input pullup) | ||
102 | * PJ.4 - LFXIN (alternate 1) | ||
103 | * PJ.5 - LFXOUT (alternate 1) | ||
104 | * PJ.6 - HFXIN (N/C) (input pullup) | ||
105 | * PJ.7 - HFXOUT (N/C) (input pullup) | ||
106 | */ | ||
107 | #define VAL_IOPORT0_OUT 0x00FF | ||
108 | #define VAL_IOPORT0_DIR 0x0000 | ||
109 | #define VAL_IOPORT0_REN 0x00CF | ||
110 | #define VAL_IOPORT0_SEL0 0x0030 | ||
111 | #define VAL_IOPORT0_SEL1 0x0000 | ||
112 | |||
113 | #if !defined(_FROM_ASM_) | ||
114 | #ifdef __cplusplus | ||
115 | extern "C" { | ||
116 | #endif | ||
117 | void boardInit(void); | ||
118 | #ifdef __cplusplus | ||
119 | } | ||
120 | #endif | ||
121 | #endif /* _FROM_ASM_ */ | ||
122 | |||
123 | #endif /* _BOARD_H_ */ | ||
diff --git a/lib/chibios-contrib/os/hal/boards/EXP430FR5969/board.mk b/lib/chibios-contrib/os/hal/boards/EXP430FR5969/board.mk new file mode 100644 index 000000000..9b0d0e11f --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/EXP430FR5969/board.mk | |||
@@ -0,0 +1,8 @@ | |||
1 | # List of all the board related files. | ||
2 | BOARDSRC = ${CHIBIOS_CONTRIB}/os/hal/boards/EXP430FR5969/board.c | ||
3 | |||
4 | # Required include directories | ||
5 | BOARDINC = ${CHIBIOS_CONTRIB}/os/hal/boards/EXP430FR5969 | ||
6 | |||
7 | ALLINC += $(BOARDINC) | ||
8 | ALLSRC += $(BOARDSRC) | ||