mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Thu Feb 12 13:00:07 2015 +0000
Revision:
472:7bbab527289d
Parent:
459:397407b8d9f7
Child:
505:0be0981777d7
Synchronized with git revision 4a7b7d067deeff485150756fa782d3952e160017

Full URL: https://github.com/mbedmicro/mbed/commit/4a7b7d067deeff485150756fa782d3952e160017/

Modify 32MHz crystal setting for NRF51822, overrides file for DFCM-NNN40 target

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 459:397407b8d9f7 1 /* mbed Microcontroller Library
mbed_official 472:7bbab527289d 2 * Copyright (c) 2006-2013 ARM Limited
mbed_official 472:7bbab527289d 3 *
mbed_official 472:7bbab527289d 4 * Licensed under the Apache License, Version 2.0 (the "License");
mbed_official 472:7bbab527289d 5 * you may not use this file except in compliance with the License.
mbed_official 472:7bbab527289d 6 * You may obtain a copy of the License at
mbed_official 472:7bbab527289d 7 *
mbed_official 472:7bbab527289d 8 * http://www.apache.org/licenses/LICENSE-2.0
mbed_official 472:7bbab527289d 9 *
mbed_official 472:7bbab527289d 10 * Unless required by applicable law or agreed to in writing, software
mbed_official 472:7bbab527289d 11 * distributed under the License is distributed on an "AS IS" BASIS,
mbed_official 472:7bbab527289d 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbed_official 472:7bbab527289d 13 * See the License for the specific language governing permissions and
mbed_official 472:7bbab527289d 14 * limitations under the License.
mbed_official 459:397407b8d9f7 15 */
mbed_official 472:7bbab527289d 16
mbed_official 459:397407b8d9f7 17 #include "cmsis.h"
mbed_official 459:397407b8d9f7 18
mbed_official 459:397407b8d9f7 19 void mbed_sdk_init()
mbed_official 459:397407b8d9f7 20 {
mbed_official 472:7bbab527289d 21 // Default SWIO setting, pull SWIO(p19) to low for turning antenna switch to BLE radiated path
mbed_official 459:397407b8d9f7 22 NRF_GPIO->PIN_CNF[19] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
mbed_official 459:397407b8d9f7 23 | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
mbed_official 459:397407b8d9f7 24 | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
mbed_official 459:397407b8d9f7 25 | (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
mbed_official 459:397407b8d9f7 26 | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
mbed_official 459:397407b8d9f7 27
mbed_official 459:397407b8d9f7 28 NRF_GPIO->OUTCLR = (GPIO_OUTCLR_PIN19_Clear << GPIO_OUTCLR_PIN19_Pos);
mbed_official 472:7bbab527289d 29
mbed_official 472:7bbab527289d 30 // Config External Crystal to 32MHz
mbed_official 472:7bbab527289d 31 NRF_CLOCK->XTALFREQ = 0x00;
mbed_official 472:7bbab527289d 32 NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
mbed_official 472:7bbab527289d 33 NRF_CLOCK->TASKS_HFCLKSTART = 1;
mbed_official 472:7bbab527289d 34 while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
mbed_official 472:7bbab527289d 35 {// Do nothing.
mbed_official 472:7bbab527289d 36 }
mbed_official 459:397407b8d9f7 37 }