mbed library sources for airmote

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
zskdan
Date:
Sun Nov 22 05:08:48 2015 +0000
Parent:
623:810c7848b2db
Child:
625:88d3fa07e462
Commit message:
no prescaling + 1.2 ref for adc

Changed in this revision

targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/analogin_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/analogin_api.c	Thu Sep 10 21:56:09 2015 +0000
+++ b/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/analogin_api.c	Sun Nov 22 05:08:48 2015 +0000
@@ -23,7 +23,8 @@
 #define ADC_RANGE    ADC_10BIT_RANGE
 
 static const PinMap PinMap_ADC[] = {
-    {p0, ADC0_0, 2},
+    {p26, ADC0_0, 1},
+    {p27, ADC0_0, 2},
     {p1, ADC0_0, 4},
     {p2, ADC0_0, 8},
     {p3, ADC0_0, 16},
@@ -52,8 +53,9 @@
 
     NRF_ADC->ENABLE = ADC_ENABLE_ENABLE_Enabled;
     NRF_ADC->CONFIG = (ADC_CONFIG_RES_10bit << ADC_CONFIG_RES_Pos) |
-                      (ADC_CONFIG_INPSEL_AnalogInputOneThirdPrescaling << ADC_CONFIG_INPSEL_Pos) |
-                      (ADC_CONFIG_REFSEL_SupplyOneThirdPrescaling << ADC_CONFIG_REFSEL_Pos) |
+                      //(ADC_CONFIG_INPSEL_AnalogInputOneThirdPrescaling << ADC_CONFIG_INPSEL_Pos) |
+                      (ADC_CONFIG_INPSEL_AnalogInputNoPrescaling << ADC_CONFIG_INPSEL_Pos) |
+                      (ADC_CONFIG_REFSEL_VBG << ADC_CONFIG_REFSEL_Pos) |
                       (analogInputPin << ADC_CONFIG_PSEL_Pos) |
                       (ADC_CONFIG_EXTREFSEL_None << ADC_CONFIG_EXTREFSEL_Pos);
 }