From 69d70de9b746094768de835e14d2f3686d15e072 Mon Sep 17 00:00:00 2001 From: Fabio Utzig Date: Fri, 15 May 2015 21:04:52 -0300 Subject: Add PAL configuration --- os/hal/boards/WVSHARE_BLE400/board.c | 55 ++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 6 deletions(-) (limited to 'os/hal/boards/WVSHARE_BLE400') 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) {} } -- cgit v1.2.3