Kenji Arai / Mbed 2 deprecated BLE_Temp_Vdd_via_UART_TY

Dependencies:   BLE_API mbed nRF51822 nRF51_Vdd

Fork of BLE_Temp_Vdd_via_UART by Kenji Arai

Files at this revision

API Documentation at this revision

Comitter:
kenjiArai
Date:
Sat Feb 20 06:02:21 2016 +0000
Parent:
11:da2dc9a847a8
Commit message:
UART sample program. Show VDD & Chip temperature.

Changed in this revision

1st_readme.txt Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-dev.lib Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
modify_info/1st_readme.txt Show diff for this revision Revisions of this file
modify_info/fstorage_config.h Show diff for this revision Revisions of this file
modify_info/port_api.c Show diff for this revision Revisions of this file
modify_info/system_nrf51.c Show diff for this revision Revisions of this file
--- a/1st_readme.txt	Tue Feb 09 12:21:41 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-
-///////////////  PLEASE MODIFY FOLLOWING FILES ////////////////////////////////////////////////////
-
---- 32MHz Clock --- ONLY FOR TAIYO YUDEN MODULE (as of Feb.9th, 2016) ----
-
-/mbed-dev/targets/cmsis/TARGET_NORDIC/system_nrf51.c
-
-//--------- original ---------------------------------------
-#define __SYSTEM_CLOCK      (16000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
-
------------ modified ---------------------------------------
-#define TARGET_NRF_32MHZ_XTAL
-//#if defined(TARGET_NRF_32MHZ_XTAL)
-//#define __SYSTEM_CLOCK      (32000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 32MHz */
-//#else
-#define __SYSTEM_CLOCK      (16000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
-//#endif
-
-
---- PortOut ----
-
-/mbed-dev/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/port_api.c
-
-//--------- original ---------------------------------------
-void port_write(port_t *obj, int value)
-{
-    *obj->reg_out = value;
-}
-
------------ modified ---------------------------------------
-void port_write(port_t *obj, int value)
-{
-#if 0
-    *obj->reg_out = value;
-#else
-    *obj->reg_out = (*obj->reg_out & ~obj->mask) | (value & obj->mask);
-#endif
-}
-
-
---- Error ---
-
-/nRF51822/source/nordic_sdk/components/libraries/fstorage/fstorage_config.h
-
-//--------- original ---------------------------------------
-static __INLINE uint32_t fs_flash_page_end_addr()
-{
-    uint32_t const bootloader_addr = NRF_UICR->NRFFW[0];
-    return  ((bootloader_addr != FS_EMPTY_MASK) ?
-             bootloader_addr : NRF_FICR->CODESIZE * FS_PAGE_SIZE);
-}
-
-//--------- modified ---------------------------------------
-static __INLINE uint32_t fs_flash_page_end_addr()
-{
-#if 0
-    uint32_t const bootloader_addr = NRF_UICR->NRFFW[0];
-#else
-    uint32_t const bootloader_addr = NRF_UICR->BOOTLOADERADDR;
-#endif
-    return  ((bootloader_addr != FS_EMPTY_MASK) ?
-             bootloader_addr : NRF_FICR->CODESIZE * FS_PAGE_SIZE);
-}
-
--- a/main.cpp	Tue Feb 09 12:21:41 2016 +0000
+++ b/main.cpp	Sat Feb 20 06:02:21 2016 +0000
@@ -16,7 +16,7 @@
 
 /*
  *      January   6th, 2016     Modified by Kenji Arai
- *      Feburary  9th, 2016
+ *      Feburary 19th, 2016
  *                              http://www.page.sannet.ne.jp/kenjia/index.html
  *                              http://mbed.org/users/kenjiArai/
  *
@@ -41,7 +41,7 @@
 #include "nRF51_Vdd.h"          // Read nRF51 Vdd voltage
 
 //  Definition ------------------------------------------------------------------------------------
-#define NEED_CONSOLE_OUTPUT 0   // Set this if you need debug messages on the console;
+#define NEED_CONSOLE_OUTPUT 1   // Set this if you need debug messages on the console;
 
 #if NEED_CONSOLE_OUTPUT
 #define DEBUG(...) { pc.printf(__VA_ARGS__); }
--- a/mbed-dev.lib	Tue Feb 09 12:21:41 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed-dev/#d25f6f8282a3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Feb 20 06:02:21 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3
\ No newline at end of file
--- a/modify_info/1st_readme.txt	Tue Feb 09 12:21:41 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-
-///////////////  PLEASE MODIFY FOLLOWING FILES ////////////////////////////////////////////////////
-
---- 32MHz Clock --- ONLY FOR TAIYO YUDEN MODULE (as of Feb.9th, 2016) ----
-
-/mbed-dev/targets/cmsis/TARGET_NORDIC/system_nrf51.c
-
-//--------- original ---------------------------------------
-#define __SYSTEM_CLOCK      (16000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
-
------------ modified ---------------------------------------
-#define TARGET_NRF_32MHZ_XTAL
-//#if defined(TARGET_NRF_32MHZ_XTAL)
-//#define __SYSTEM_CLOCK      (32000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 32MHz */
-//#else
-#define __SYSTEM_CLOCK      (16000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
-//#endif
-
-
---- PortOut ----
-
-/mbed-dev/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/port_api.c
-
-//--------- original ---------------------------------------
-void port_write(port_t *obj, int value)
-{
-    *obj->reg_out = value;
-}
-
------------ modified ---------------------------------------
-void port_write(port_t *obj, int value)
-{
-#if 0
-    *obj->reg_out = value;
-#else
-    *obj->reg_out = (*obj->reg_out & ~obj->mask) | (value & obj->mask);
-#endif
-}
-
-
---- Error ---
-
-/nRF51822/source/nordic_sdk/components/libraries/fstorage/fstorage_config.h
-
-//--------- original ---------------------------------------
-static __INLINE uint32_t fs_flash_page_end_addr()
-{
-    uint32_t const bootloader_addr = NRF_UICR->NRFFW[0];
-    return  ((bootloader_addr != FS_EMPTY_MASK) ?
-             bootloader_addr : NRF_FICR->CODESIZE * FS_PAGE_SIZE);
-}
-
-//--------- modified ---------------------------------------
-static __INLINE uint32_t fs_flash_page_end_addr()
-{
-#if 0
-    uint32_t const bootloader_addr = NRF_UICR->NRFFW[0];
-#else
-    uint32_t const bootloader_addr = NRF_UICR->BOOTLOADERADDR;
-#endif
-    return  ((bootloader_addr != FS_EMPTY_MASK) ?
-             bootloader_addr : NRF_FICR->CODESIZE * FS_PAGE_SIZE);
-}
-
--- a/modify_info/fstorage_config.h	Tue Feb 09 12:21:41 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-#if 0
-/*
- * Copyright (c) Nordic Semiconductor ASA
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- *   1. Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- *
- *   2. Redistributions in binary form must reproduce the above copyright notice, this
- *   list of conditions and the following disclaimer in the documentation and/or
- *   other materials provided with the distribution.
- *
- *   3. Neither the name of Nordic Semiconductor ASA nor the names of other
- *   contributors to this software may be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef FS_CONFIG_H__
-#define FS_CONFIG_H__
-
-#include <stdint.h>
-#include "nrf.h"
-
-/**
- * @defgroup fstorage_config FStorage configuration
- * @ingroup fstorage
- * @{
- * @brief FStorage configuration.
- */
-
-
-/**@brief Macro for max number of operations in the fs cmd queue.
- */
-#define FS_CMD_QUEUE_SIZE   (8)
-
-
-/**@brief Macro for max number of retries for a flash command before it notifies as failed.
- */
-#define FS_CMD_MAX_RETRIES  (3)
-
-
-/**@brief Macro for the content of a flash address that has not been written to.
- */
-#define FS_EMPTY_MASK       (0xFFFFFFFF)
-
-
-/**@brief Macro for flash page size according to chip family
- */
-#if defined (NRF51)
-    #define FS_PAGE_SIZE    (1024)
-#elif defined (NRF52)
-    #define FS_PAGE_SIZE    (4096)
-#else
-    #error "Device family must be defined. See nrf.h."
-#endif
-
-
-/*@brief Macro for flash page size according to chip family
-*/
-#define FS_PAGE_SIZE_WORDS  (FS_PAGE_SIZE/4)
-
-
-/**@brief Static inline function that provides last page address
- *
- * @note    If there is a bootloader present the bootloader address read from UICR
- *          will act as the page beyond the end of the available flash storage
- */
-static __INLINE uint32_t fs_flash_page_end_addr()
-{
-// January 30th, 2016 modified by JH1PJL    --- from here ---
-#if 0
-    uint32_t const bootloader_addr = NRF_UICR->NRFFW[0];
-#else
-    uint32_t const bootloader_addr = NRF_UICR->BOOTLOADERADDR;
-#endif
-//                                          ---- to here ---
-    return  ((bootloader_addr != FS_EMPTY_MASK) ?
-             bootloader_addr : NRF_FICR->CODESIZE * FS_PAGE_SIZE);
-}
-
-
-/**@brief Macro for last page address
- *
- * @note    If there is a bootloader present the bootloader address read from UICR
- *          will act as the page beyond the end of the available flash storage
- */
-#define FS_PAGE_END_ADDR  fs_flash_page_end_addr()
-
-
-/**@brief Macro to describe the write
- *
- */
-#if defined (NRF51)
-    #define FS_MAX_WRITE_SIZE_WORDS	    (256)
-#elif defined (NRF52)
-    #define FS_MAX_WRITE_SIZE_WORDS     (1024)
-#else
-    #error "Device family must be defined. see nrf.h"
-#endif
-
-/** @} */
-
-#endif // FS_CONFIG_H__
-#endif
-
--- a/modify_info/port_api.c	Tue Feb 09 12:21:41 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-#if 0
-/* mbed Microcontroller Library
- * Copyright (c) 2013 Nordic Semiconductor
- *
- * 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 "port_api.h"
-#include "pinmap.h"
-#include "gpio_api.h"
-
-PinName port_pin(PortName port, int pin_n)
-{
-    return (PinName)(pin_n);
-}
-
-void port_init(port_t *obj, PortName port, int mask, PinDirection dir)
-{
-    obj->port = port;
-    obj->mask = mask;
-
-    obj->reg_out = &NRF_GPIO->OUT;
-    obj->reg_in  = &NRF_GPIO->IN;
-    obj->reg_cnf = NRF_GPIO->PIN_CNF;
-
-    port_dir(obj, dir);
-}
-
-void port_mode(port_t *obj, PinMode mode)
-{
-    uint32_t i;
-    // The mode is set per pin: reuse pinmap logic
-    for (i = 0; i<31; i++) {
-        if (obj->mask & (1 << i)) {
-            pin_mode(port_pin(obj->port, i), mode);
-        }
-    }
-}
-
-void port_dir(port_t *obj, PinDirection dir)
-{
-    int i;
-    switch (dir) {
-    case PIN_INPUT:
-        for (i = 0; i<31; i++) {
-            if (obj->mask & (1 << i)) {
-                obj->reg_cnf[i] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
-                                    | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
-                                    | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos)
-                                    | (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos);
-            }
-        }
-        break;
-    case PIN_OUTPUT:
-        for (i = 0; i<31; i++) {
-            if (obj->mask & (1 << i)) {
-                obj->reg_cnf[i] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
-                                    | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
-                                    | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
-                                    | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos)
-                                    | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
-            }
-        }
-        break;
-    }
-}
-
-// January 30th, 2016 modified by JH1PJL    --- from here ---
-void port_write(port_t *obj, int value)
-{
-#if 0
-    *obj->reg_out = value;
-#else
-    *obj->reg_out = (*obj->reg_out & ~obj->mask) | (value & obj->mask);
-#endif
-}
-//                                          ---- to here ---
-
-int port_read(port_t *obj)
-{
-    return (*obj->reg_in);
-}
-
-#endif
-
--- a/modify_info/system_nrf51.c	Tue Feb 09 12:21:41 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-#if 0
-/* Copyright (c) 2013, Nordic Semiconductor ASA
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *   * Redistributions of source code must retain the above copyright notice, this
- *     list of conditions and the following disclaimer.
- *
- *   * Redistributions in binary form must reproduce the above copyright notice,
- *     this list of conditions and the following disclaimer in the documentation
- *     and/or other materials provided with the distribution.
- *
- *   * Neither the name of Nordic Semiconductor ASA nor the names of its
- *     contributors may be used to endorse or promote products derived from
- *     this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/* NOTE: Template files (including this one) are application specific and therefore expected to
-   be copied into the application project folder prior to its use! */
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "nrf.h"
-#include "nrf_delay.h"
-#include "system_nrf51.h"
-
-/*lint ++flb "Enter library region" */
-
-// January 30th, 2016 modified by JH1PJL    --- from here ---
-#define TARGET_NRF_32MHZ_XTAL
-//#if defined(TARGET_NRF_32MHZ_XTAL)
-//#define __SYSTEM_CLOCK      (32000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 32MHz */
-//#else
-#define __SYSTEM_CLOCK      (16000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
-//#endif
-//                                          ---- to here ---
-
-static bool is_manual_peripheral_setup_needed(void);
-static bool is_disabled_in_debug_needed(void);
-static void init_clock(void);
-
-
-#if defined ( __CC_ARM )
-    uint32_t SystemCoreClock __attribute__((used)) = __SYSTEM_CLOCK;
-#elif defined ( __ICCARM__ )
-    __root uint32_t SystemCoreClock = __SYSTEM_CLOCK;
-#elif defined   ( __GNUC__ )
-    uint32_t SystemCoreClock __attribute__((used)) = __SYSTEM_CLOCK;
-#endif
-
-void SystemCoreClockUpdate(void)
-{
-    SystemCoreClock = __SYSTEM_CLOCK;
-}
-
-void SystemInit(void)
-{
-#if defined(TARGET_NRF_32MHZ_XTAL)
-    /* For 32MHz HFCLK XTAL such as Taiyo Yuden
-       Physically, tiny footprint XTAL oscillate higher freq. To make BLE modules smaller, some modules
-       are using 32MHz XTAL.
-       This code wriging the value 0xFFFFFF00 to the UICR (User Information Configuration Register)
-       at address 0x10001008, to make nRF51 works with 32MHz system clock. This register will be overwritten
-       by SoftDevice to 0xFFFFFFFF, the default value. Each hex files built with mbed classic online compiler
-       contain SoftDevice, so that, this code run once just after the hex file will be flashed onto nRF51.
-       After changing the value, nRF51 need to reboot. */
-    if (*(uint32_t *)0x10001008 == 0xFFFFFFFF)
-    {
-        NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
-        while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
-        *(uint32_t *)0x10001008 = 0xFFFFFF00;
-        NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
-        while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
-        NVIC_SystemReset();
-        while (true){}
-    }
-#endif
-
-    /* If desired, switch off the unused RAM to lower consumption by the use of RAMON register.
-       It can also be done in the application main() function. */
-
-    /* Prepare the peripherals for use as indicated by the PAN 26 "System: Manual setup is required
-       to enable the use of peripherals" found at Product Anomaly document for your device found at
-       https://www.nordicsemi.com/. The side effect of executing these instructions in the devices
-       that do not need it is that the new peripherals in the second generation devices (LPCOMP for
-       example) will not be available. */
-    if (is_manual_peripheral_setup_needed())
-    {
-        *(uint32_t volatile *)0x40000504 = 0xC007FFDF;
-        *(uint32_t volatile *)0x40006C18 = 0x00008000;
-    }
-
-    /* Disable PROTENSET registers under debug, as indicated by PAN 59 "MPU: Reset value of DISABLEINDEBUG
-       register is incorrect" found at Product Anomaly document four your device found at
-       https://www.nordicsemi.com/. There is no side effect of using these instruction if not needed. */
-    if (is_disabled_in_debug_needed())
-    {
-        NRF_MPU->DISABLEINDEBUG = MPU_DISABLEINDEBUG_DISABLEINDEBUG_Disabled << MPU_DISABLEINDEBUG_DISABLEINDEBUG_Pos;
-    }
-
-    // Start the external 32khz crystal oscillator.
-    init_clock();
-}
-
-void init_clock(void)
-{
-    /* For compatibility purpose, the default behaviour is to first attempt to initialise an
-       external clock, and after a timeout, use the internal RC one. To avoid this wait, boards that
-       don't have an external oscillator can set TARGET_NRF_LFCLK_RC directly. */
-    uint32_t i = 0;
-    const uint32_t polling_period = 200;
-    const uint32_t timeout = 1000000;
-
-#if defined(TARGET_NRF_LFCLK_RC)
-    NRF_CLOCK->LFCLKSRC             = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
-#else
-    NRF_CLOCK->LFCLKSRC             = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
-#endif
-    NRF_CLOCK->EVENTS_LFCLKSTARTED  = 0;
-    NRF_CLOCK->TASKS_LFCLKSTART     = 1;
-
-    /* Wait for the external oscillator to start up.
-       nRF51822 product specification (8.1.5) gives a typical value of 300ms for external clock
-       startup duration, and a maximum value of 1s. When using the internal RC source, typical delay
-       will be 390µs, so we use a polling period of 200µs.
-
-       We can't use us_ticker at this point, so we have to rely on a less precise method for
-       measuring our timeout. Because of this, the actual timeout will be slightly longer than 1
-       second, which isn't an issue at all, since this fallback should only be used as a safety net.
-       */
-    for (i = 0; i < (timeout / polling_period); i++) {
-        if (NRF_CLOCK->EVENTS_LFCLKSTARTED != 0)
-            return;
-        nrf_delay_us(polling_period);
-    }
-
-    /* Fallback to internal clock. Belt and braces, since the internal clock is used by default
-       whilst no external source is running. This is not only a sanity check, but it also allows
-       code down the road (e.g. ble initialisation) to directly know which clock is used. */
-    NRF_CLOCK->LFCLKSRC         = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
-    NRF_CLOCK->TASKS_LFCLKSTART = 1;
-    while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {
-        // Do nothing.
-    }
-}
-
-static bool is_manual_peripheral_setup_needed(void)
-{
-    if ((((*(uint32_t *)0xF0000FE0) & 0x000000FF) == 0x1) && (((*(uint32_t *)0xF0000FE4) & 0x0000000F) == 0x0))
-    {
-        if ((((*(uint32_t *)0xF0000FE8) & 0x000000F0) == 0x00) && (((*(uint32_t *)0xF0000FEC) & 0x000000F0) == 0x0))
-        {
-            return true;
-        }
-        if ((((*(uint32_t *)0xF0000FE8) & 0x000000F0) == 0x10) && (((*(uint32_t *)0xF0000FEC) & 0x000000F0) == 0x0))
-        {
-            return true;
-        }
-        if ((((*(uint32_t *)0xF0000FE8) & 0x000000F0) == 0x30) && (((*(uint32_t *)0xF0000FEC) & 0x000000F0) == 0x0))
-        {
-            return true;
-        }
-    }
-
-    return false;
-}
-
-static bool is_disabled_in_debug_needed(void)
-{
-    if ((((*(uint32_t *)0xF0000FE0) & 0x000000FF) == 0x1) && (((*(uint32_t *)0xF0000FE4) & 0x0000000F) == 0x0))
-    {
-        if ((((*(uint32_t *)0xF0000FE8) & 0x000000F0) == 0x40) && (((*(uint32_t *)0xF0000FEC) & 0x000000F0) == 0x0))
-        {
-            return true;
-        }
-    }
-
-    return false;
-}
-
-/*lint --flb "Leave library region" */
-#endif
-