diff options
Diffstat (limited to 'os/hal/boards')
-rw-r--r-- | os/hal/boards/EXP430FR5969/board.c | 46 | ||||
-rw-r--r-- | os/hal/boards/EXP430FR5969/board.h | 129 | ||||
-rw-r--r-- | os/hal/boards/EXP430FR5969/board.mk | 5 | ||||
-rw-r--r-- | os/hal/boards/FREESCALE_FREEDOM_KL26Z/board.h | 6 | ||||
-rw-r--r-- | os/hal/boards/OSHCHIP_V1.0/board.c | 80 | ||||
-rw-r--r-- | os/hal/boards/OSHCHIP_V1.0/board.h | 64 | ||||
-rw-r--r-- | os/hal/boards/OSHCHIP_V1.0/board.mk | 5 | ||||
-rw-r--r-- | os/hal/boards/WVSHARE_BLE400/board.h | 2 |
8 files changed, 335 insertions, 2 deletions
diff --git a/os/hal/boards/EXP430FR5969/board.c b/os/hal/boards/EXP430FR5969/board.c new file mode 100644 index 0000000..ac48ba0 --- /dev/null +++ b/os/hal/boards/EXP430FR5969/board.c @@ -0,0 +1,46 @@ +/*
+ ChibiOS - Copyright (C) 2016 Andrew Wygle aka awygle
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#include "hal.h"
+
+/**
+ * @brief PAL setup.
+ * @details Digital I/O ports static configuration as defined in @p board.h.
+ * This variable is used by the HAL when initializing the PAL driver.
+ */
+#if HAL_USE_PAL || defined(__DOXYGEN__)
+const PALConfig pal_default_config =
+{
+ {VAL_IOPORT1_OUT, VAL_IOPORT1_DIR, VAL_IOPORT1_REN, VAL_IOPORT1_SEL0,
+ VAL_IOPORT1_SEL1, VAL_IOPORT1_IES, VAL_IOPORT1_IE},
+ {VAL_IOPORT2_OUT, VAL_IOPORT2_DIR, VAL_IOPORT2_REN, VAL_IOPORT2_SEL0,
+ VAL_IOPORT2_SEL1, VAL_IOPORT2_IES, VAL_IOPORT2_IE},
+ {VAL_IOPORT0_OUT, VAL_IOPORT0_DIR, VAL_IOPORT0_REN, VAL_IOPORT0_SEL0,
+ VAL_IOPORT0_SEL1, VAL_IOPORT0_IES, VAL_IOPORT0_IE}
+}; /* Set UART TX pin correctly */
+#endif /* HAL_USE_PAL */
+
+/**
+ * Board-specific initialization code.
+ */
+void boardInit(void) {
+
+ /*
+ * External interrupts setup, all disabled initially.
+ */
+ _disable_interrupts();
+
+}
diff --git a/os/hal/boards/EXP430FR5969/board.h b/os/hal/boards/EXP430FR5969/board.h new file mode 100644 index 0000000..6b53f4b --- /dev/null +++ b/os/hal/boards/EXP430FR5969/board.h @@ -0,0 +1,129 @@ +/*
+ ChibiOS - Copyright (C) 2016 Andrew Wygle aka awygle
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#ifndef _BOARD_H_
+#define _BOARD_H_
+
+/*
+ * Setup for the Arduino Uno or board.
+ */
+
+/*
+ * Board identifier.
+ */
+#define BOARD_EXP430FR5959
+#define BOARD_NAME "MSP430FR5969 LaunchPad"
+
+/*
+ * IO lines assignments.
+ */
+#define LINE_LED_G PAL_LINE(IOPORT1, 0U)
+#define LINE_LED_R PAL_LINE(IOPORT2, 14U)
+#define LINE_SW_S1 PAL_LINE(IOPORT2, 13U)
+#define LINE_SW_S2 PAL_LINE(IOPORT1, 1U)
+
+/*
+ * I/O ports initial setup, this configuration is established soon after reset
+ * in the initialization code.
+ * Please refer to the MSP430X Family Users Guide for details.
+ */
+/*
+ * Port A setup:
+ *
+ * P1.0 - Green LED (output low)
+ * P1.1 - Switch S2 (input pullup falling-edge interrupt)
+ * P1.2 - BoosterPack BP19 (input pullup)
+ * P1.3 - BoosterPack BP11 (input pullup)
+ * P1.4 - BoosterPack BP12 (input pullup)
+ * P1.5 - BoosterPack BP13 (input pullup)
+ * P1.6 - BoosterPack BP15 (input pullup)
+ * P1.7 - BoosterPack BP14 (input pullup)
+ * P2.0 - Application UART TX (alternate 2)
+ * P2.1 - Application UART RX (alternate 2)
+ * P2.2 - BoosterPack BP7 (input pullup)
+ * P2.3 - N/C (input pullup)
+ * P2.4 - BoosterPack BP6 (input pullup)
+ * P2.5 - BoosterPack BP4 (input pullup)
+ * P2.6 - BoosterPack BP3 (input pullup)
+ * P2.7 - N/C (input pullup)
+ */
+#define VAL_IOPORT1_OUT 0xFCFE
+#define VAL_IOPORT1_DIR 0x0001
+#define VAL_IOPORT1_REN 0xFCFE
+#define VAL_IOPORT1_SEL0 0x0000
+#define VAL_IOPORT1_SEL1 0x0300
+#define VAL_IOPORT1_IES 0x0002
+#define VAL_IOPORT1_IE 0x0002
+
+/*
+ * Port B setup:
+ *
+ * P3.0 - BoosterPack BP18 (input pullup)
+ * P3.1 - N/C (input pullup)
+ * P3.2 - N/C (input pullup)
+ * P3.3 - N/C (input pullup)
+ * P3.4 - BoosterPack BP8 (input pullup)
+ * P3.5 - BoosterPack BP9 (input pullup)
+ * P3.6 - BoosterPack BP10 (input pullup)
+ * P3.7 - N/C (input pullup)
+ * P4.0 - Application UART CTS (input pullup falling-edge interrupt)
+ * P4.1 - Application UART RTS (output high)
+ * P4.2 - BoosterPack BP2 (input pullup)
+ * P4.3 - BoosterPack BP5 (input pullup)
+ * P4.4 - N/C (input pullup)
+ * P4.5 - Switch S1 (input pullup falling-edge interrupt)
+ * P4.6 - Red LED (output low)
+ * P4.7 - N/C (input pullup)
+ */
+#define VAL_IOPORT2_OUT 0xBFFF
+#define VAL_IOPORT2_DIR 0x4200
+#define VAL_IOPORT2_REN 0xBDFF
+#define VAL_IOPORT2_SEL0 0x0000
+#define VAL_IOPORT2_SEL1 0x0000
+#define VAL_IOPORT2_IES 0x2100
+#define VAL_IOPORT2_IE 0x2100
+
+/*
+ * Port J setup:
+ *
+ * PJ.0 - TDO (input pullup)
+ * PJ.1 - TDI (input pullup)
+ * PJ.2 - TMS (input pullup)
+ * PJ.3 - TCK (input pullup)
+ * PJ.4 - LFXIN (alternate 1)
+ * PJ.5 - LFXOUT (alternate 1)
+ * PJ.6 - HFXIN (N/C) (input pullup)
+ * PJ.7 - HFXOUT (N/C) (input pullup)
+ */
+#define VAL_IOPORT0_OUT 0x00FF
+#define VAL_IOPORT0_DIR 0x0000
+#define VAL_IOPORT0_REN 0x00CF
+#define VAL_IOPORT0_SEL0 0x0030
+#define VAL_IOPORT0_SEL1 0x0000
+#define VAL_IOPORT0_IES 0x0000
+#define VAL_IOPORT0_IE 0x0000
+
+#if !defined(_FROM_ASM_)
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void boardInit(void);
+#ifdef __cplusplus
+}
+#endif
+#endif /* _FROM_ASM_ */
+
+#endif /* _BOARD_H_ */
diff --git a/os/hal/boards/EXP430FR5969/board.mk b/os/hal/boards/EXP430FR5969/board.mk new file mode 100644 index 0000000..c629257 --- /dev/null +++ b/os/hal/boards/EXP430FR5969/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files.
+BOARDSRC = ${CHIBIOS_CONTRIB}/os/hal/boards/EXP430FR5969/board.c
+
+# Required include directories
+BOARDINC = ${CHIBIOS_CONTRIB}/os/hal/boards/EXP430FR5969
diff --git a/os/hal/boards/FREESCALE_FREEDOM_KL26Z/board.h b/os/hal/boards/FREESCALE_FREEDOM_KL26Z/board.h index e13debb..2ae42aa 100644 --- a/os/hal/boards/FREESCALE_FREEDOM_KL26Z/board.h +++ b/os/hal/boards/FREESCALE_FREEDOM_KL26Z/board.h @@ -49,11 +49,13 @@ #define GPIO_LIGHTSNS IOPORT5
#define PIN_LIGHTSNS 22
-#define I2C_INERIAL_SENSOR I2C0
-
/*
* Not configured:
* - TSI Slider on PTB16/TSI0_CH9 and PTB17/TSI_CH10
+ * - I2C inertial sensor on I2C0, routed to PTE25 and PTE25
+ * Note: these pins are assigned to I2C0 by default;
+ * if I2C0 is wanted on other pins, these need to be
+ * assigned another function explicitly!
*/
#if !defined(_FROM_ASM_)
diff --git a/os/hal/boards/OSHCHIP_V1.0/board.c b/os/hal/boards/OSHCHIP_V1.0/board.c new file mode 100644 index 0000000..85e4486 --- /dev/null +++ b/os/hal/boards/OSHCHIP_V1.0/board.c @@ -0,0 +1,80 @@ +/* + Copyright (C) 2016 flabbergast + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = +{ + .pads = { + PAL_MODE_OUTPUT_PUSHPULL, /* P0.0: PIN11 (AREF0) */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.1: PIN9 (AIN2) */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.2: PIN10 (AIN3) */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.3: LED_BLUE */ + PAL_MODE_UNCONNECTED, /* P0.4 */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.5: LED_GREEN */ + PAL_MODE_UNCONNECTED, /* P0.6 */ + PAL_MODE_UNCONNECTED, /* P0.7 */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.8: LED_RED */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.9: PIN7 */ + PAL_MODE_UNCONNECTED, /* P0.10 */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.11: PIN6 */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.12: PIN5 */ + PAL_MODE_UNCONNECTED, /* P0.13 */ + PAL_MODE_UNCONNECTED, /* P0.14 */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.15: PIN4 */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.16: PIN3 */ + PAL_MODE_UNCONNECTED, /* P0.17 */ + PAL_MODE_INPUT_PULLUP, /* P0.18: PIN2 (RX) */ + PAL_MODE_UNCONNECTED, /* P0.19 */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.20: PIN1 (TX) */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.21: PIN15 */ + PAL_MODE_UNCONNECTED, /* P0.22 */ + PAL_MODE_UNCONNECTED, /* P0.23 */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.24: PIN14 */ + PAL_MODE_UNCONNECTED, /* P0.25 */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.26: PIN13 (LFXTL) (AIN0) */ + PAL_MODE_OUTPUT_PUSHPULL, /* P0.27: PIN12 (LFXTL) (AIN1) */ + PAL_MODE_UNCONNECTED, /* P0.28 */ + PAL_MODE_UNCONNECTED, /* P0.29 */ + PAL_MODE_UNCONNECTED, /* P0.30 */ + PAL_MODE_UNCONNECTED, /* P0.31 */ + }, +}; +#endif + +/** + * @brief Early initialization code. + * @details This initialization is performed just after reset before BSS and + * DATA segments initialization. + */ +void __early_init(void) +{ +} + +/** + * @brief Late initialization code. + * @note This initialization is performed after BSS and DATA segments + * initialization and before invoking the main() function. + */ +void boardInit(void) +{ +} diff --git a/os/hal/boards/OSHCHIP_V1.0/board.h b/os/hal/boards/OSHCHIP_V1.0/board.h new file mode 100644 index 0000000..e3bbb0b --- /dev/null +++ b/os/hal/boards/OSHCHIP_V1.0/board.h @@ -0,0 +1,64 @@ +/* + Copyright (C) 2016 flabbergast + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* Board identifier. */ +#define BOARD_OSHCHIP_V10 +#define BOARD_NAME "OSHChip_V1.0" + +/* Board oscillators-related settings. */ +#define NRF51_XTAL_VALUE 16000000 + +/* Non-header GPIO pins. */ +#define LED_RED 8 +#define LED_GREEN 5 +#define LED_BLUE 3 + +/* Common peripheral GPIO pins. */ +#define UART_TX 20 +#define UART_RX 18 + +/* GPIO on DIP pins. */ +#define OSHCHIP_PIN1 20 +#define OSHCHIP_PIN2 18 +#define OSHCHIP_PIN3 16 +#define OSHCHIP_PIN4 15 +#define OSHCHIP_PIN5 12 +#define OSHCHIP_PIN6 11 +#define OSHCHIP_PIN7 9 +/* Pin 8 is GND */ +#define OSHCHIP_PIN9 1 +#define OSHCHIP_PIN10 2 +#define OSHCHIP_PIN11 0 +#define OSHCHIP_PIN12 27 +#define OSHCHIP_PIN13 26 +#define OSHCHIP_PIN14 24 +#define OSHCHIP_PIN15 21 +/* Pin 16 is VCC */ + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/os/hal/boards/OSHCHIP_V1.0/board.mk b/os/hal/boards/OSHCHIP_V1.0/board.mk new file mode 100644 index 0000000..08afdbd --- /dev/null +++ b/os/hal/boards/OSHCHIP_V1.0/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = ${CHIBIOS_CONTRIB}/os/hal/boards/OSHCHIP_V1.0/board.c + +# Required include directories +BOARDINC = ${CHIBIOS_CONTRIB}/os/hal/boards/OSHCHIP_V1.0 diff --git a/os/hal/boards/WVSHARE_BLE400/board.h b/os/hal/boards/WVSHARE_BLE400/board.h index 536b7f6..617a0b5 100644 --- a/os/hal/boards/WVSHARE_BLE400/board.h +++ b/os/hal/boards/WVSHARE_BLE400/board.h @@ -34,6 +34,8 @@ #define LED4 22 #define UART_TX 9 #define UART_RX 11 +#define UART_RTS 8 +#define UART_CTS 10 #define SPI_SCK 25 #define SPI_MOSI 24 #define SPI_MISO 23 |