aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/boards
diff options
context:
space:
mode:
authorFabio Utzig <utzig@utzig.org>2015-05-15 21:04:52 -0300
committerFabio Utzig <utzig@utzig.org>2015-05-15 21:04:52 -0300
commit69d70de9b746094768de835e14d2f3686d15e072 (patch)
treeb56874c5867d643aea396a44e94d37940fff8a96 /os/hal/boards
parent443c13d8785cbcbd3550bc091ba502fd156a5c8b (diff)
downloadChibiOS-Contrib-69d70de9b746094768de835e14d2f3686d15e072.tar.gz
ChibiOS-Contrib-69d70de9b746094768de835e14d2f3686d15e072.tar.bz2
ChibiOS-Contrib-69d70de9b746094768de835e14d2f3686d15e072.zip
Add PAL configuration
Diffstat (limited to 'os/hal/boards')
-rw-r--r--os/hal/boards/WVSHARE_BLE400/board.c55
1 files changed, 49 insertions, 6 deletions
diff --git a/os/hal/boards/WVSHARE_BLE400/board.c b/os/hal/boards/WVSHARE_BLE400/board.c
index 3c33e5d..bee9490 100644
--- a/os/hal/boards/WVSHARE_BLE400/board.c
+++ b/os/hal/boards/WVSHARE_BLE400/board.c
@@ -16,6 +16,51 @@
#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_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_OUTPUT_PUSHPULL, // UART_TX
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT, // UART_RX
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_OUTPUT_PUSHPULL, // LED0
+ PAL_MODE_OUTPUT_PUSHPULL, // LED1
+ PAL_MODE_OUTPUT_PUSHPULL, // LED2
+ PAL_MODE_OUTPUT_PUSHPULL, // LED3
+ PAL_MODE_OUTPUT_PUSHPULL, // LED4
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ PAL_MODE_INPUT,
+ },
+};
+#endif
+
/**
* @brief Early initialization code.
* @details This initialization is performed just after reset before BSS and
@@ -23,8 +68,6 @@
*/
void __early_init(void)
{
- NRF_GPIO->PIN_CNF[20] = 1;
- NRF_GPIO->OUTSET = (uint32_t) 1 << 20;
}
/**
@@ -35,8 +78,8 @@ void __early_init(void)
void boardInit(void)
{
//FIXME: not really needed yet
- NRF_CLOCK->XTALFREQ = 0xff;
- NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
- NRF_CLOCK->TASKS_HFCLKSTART = 1;
- while (!NRF_CLOCK->EVENTS_HFCLKSTARTED) {}
+ //NRF_CLOCK->XTALFREQ = 0xff;
+ //NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
+ //NRF_CLOCK->TASKS_HFCLKSTART = 1;
+ //while (!NRF_CLOCK->EVENTS_HFCLKSTARTED) {}
}