mbed library sources

Dependents:   SPI_slave_frdm

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Mon Feb 02 07:30:07 2015 +0000
Parent:
458:84b15e04105a
Child:
460:3bcf9be0332c
Commit message:
Synchronized with git revision 9f80c904774a5f24198502d615ba9978c26616ab

Full URL: https://github.com/mbedmicro/mbed/commit/9f80c904774a5f24198502d615ba9978c26616ab/

Add a new target DELTA_DFCM_NNN40

Changed in this revision

targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/system_nrf51822.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_DELTA_DFCM_NNN40/PinNames.h Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_DELTA_DFCM_NNN40/device.h Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_DELTA_DFCM_NNN40/mbed_overrides.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/system_nrf51822.c	Fri Jan 30 07:15:07 2015 +0000
+++ b/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/system_nrf51822.c	Mon Feb 02 07:30:07 2015 +0000
@@ -1,6 +1,6 @@
 /* mbed Microcontroller Library
 
- * Copyright (c) 2013 Nordic Semiconductor.
+ * Copyright (c) 2015 Nordic Semiconductor.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,8 +21,12 @@
 #include "nrf51822.h"
 #include "system_nrf51822.h"
 
+#ifdef TARGET_DELTA_DFCM_NNN40
 
-#define __SYSTEM_CLOCK      (16000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
+	#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
 
 static bool is_manual_peripheral_setup_needed(void);
 static bool is_disabled_in_debug_needed(void);
@@ -67,7 +71,7 @@
 
     // Start the external 32khz crystal oscillator.
 
-#ifdef TARGET_HRM1017
+#ifdef TARGET_DELTA_DFCM_NNN40 || TARGET_HRM1017
     NRF_CLOCK->LFCLKSRC             = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
 #else
     NRF_CLOCK->LFCLKSRC             = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_DELTA_DFCM_NNN40/PinNames.h	Mon Feb 02 07:30:07 2015 +0000
@@ -0,0 +1,125 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 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.
+ */
+#ifndef MBED_PINNAMES_H
+#define MBED_PINNAMES_H
+
+#include "cmsis.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+    PIN_INPUT,
+    PIN_OUTPUT
+} PinDirection;
+
+#define PORT_SHIFT  3
+
+typedef enum {
+    NC = (int)0xFFFFFFFF,
+    p0  = 0,
+    p1  = 1,
+    p2  = 2,
+    p3  = 3,
+    p4  = 4,
+    p5  = 5,
+    p6  = 6,
+    p7  = 7,
+    p8  = NC,
+    p9  = NC,
+    p10 = NC,
+    p11 = NC,
+    p12 = NC,
+    p13 = 13,
+    p14 = NC,
+    p15 = NC,
+    p16 = 16,
+    p17 = 17,
+    p18 = NC,
+    p19 = 19,
+    p20 = 20,
+    p21 = 21,
+    p22 = 22,
+    p23 = 23,
+    p24 = 24,
+    p25 = 25,
+    p26 = 26,
+    p27 = 27,
+    p28 = NC,
+    p29 = 29,
+    p30 = 30,
+	p31 = 31,
+
+    LED1    = p7,
+    LED2    = p13,
+
+    BUTTON0 = p16,
+    BUTTON1 = p17,
+
+    RX_PIN_NUMBER  = p23,
+    TX_PIN_NUMBER  = p25,
+
+    // mBed interface Pins
+    USBTX = TX_PIN_NUMBER,
+    USBRX = RX_PIN_NUMBER,
+
+    SPI_PSELMOSI0 = p24,
+    SPI_PSELMISO0 = p29,
+    SPI_PSELSS0   = p6,
+    SPI_PSELSCK0  = p21,
+
+    SPIS_PSELMOSI = p24,
+    SPIS_PSELMISO = p29,
+    SPIS_PSELSS   = p6,
+    SPIS_PSELSCK  = p21,
+
+    I2C_SDA0 = p22,
+    I2C_SCL0 = p20,
+
+    A0  = p0,
+    A1  = p1,
+    A2  = p2,
+    A3  = p3,
+    A4  = p4,
+    A5  = p5,
+	
+	SWIO = p19,
+	VERF0 = p0,
+    // Not connected
+	
+	CTS_PIN_NUMBER	= NC,
+	RTS_PIN_NUMBER	= NC,
+	SPI_PSELMOSI1 = NC,
+    SPI_PSELMISO1 = NC,
+    SPI_PSELSS1   = NC,
+    SPI_PSELSCK1  = NC,
+	LED3 	= NC,
+	LED4	= NC
+} PinName;
+
+typedef enum {
+    PullNone = 0,
+    PullDown = 1,
+    PullUp = 3,
+    PullDefault = PullUp
+} PinMode;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_DELTA_DFCM_NNN40/device.h	Mon Feb 02 07:30:07 2015 +0000
@@ -0,0 +1,57 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2015 ARM Limited
+ *
+ * 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 MBED_DEVICE_H
+#define MBED_DEVICE_H
+
+#define DEVICE_PORTIN           1
+#define DEVICE_PORTOUT          1
+#define DEVICE_PORTINOUT        1
+
+#define DEVICE_INTERRUPTIN      1
+
+#define DEVICE_ANALOGIN         1
+#define DEVICE_ANALOGOUT        0
+
+#define DEVICE_SERIAL           1
+
+#define DEVICE_I2C              1
+#define DEVICE_I2CSLAVE         0
+
+#define DEVICE_SPI              1
+#define DEVICE_SPISLAVE         1
+
+#define DEVICE_CAN              0
+
+#define DEVICE_RTC              0
+
+#define DEVICE_ETHERNET         0
+
+#define DEVICE_PWMOUT           1
+
+#define DEVICE_SEMIHOST         0
+#define DEVICE_LOCALFILESYSTEM  0
+
+#define DEVICE_SLEEP            1
+
+#define DEVICE_DEBUG_AWARENESS  1
+
+#define DEVICE_STDIO_MESSAGES   0
+
+#define DEVICE_ERROR_PATTERN    1
+
+#include "objects.h"
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_DELTA_DFCM_NNN40/mbed_overrides.c	Mon Feb 02 07:30:07 2015 +0000
@@ -0,0 +1,20 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015, Cyntec
+ */
+#include "cmsis.h"
+
+// This function is called after RAM initialization and before main.
+void mbed_sdk_init()
+{
+	// Default SWIO setting, pull SWIO(p19) to low for turning antenna switch to BLE radiated path.
+#ifdef TARGET_DELTA_DFCM_NNN40
+	NRF_GPIO->PIN_CNF[19] = (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_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
+                                        | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
+
+	NRF_GPIO->OUTCLR 		= 	(GPIO_OUTCLR_PIN19_Clear << GPIO_OUTCLR_PIN19_Pos);
+
+#endif
+}