From 399acd1d6f0c130ff3dd6ce318c93eb9f4a92651 Mon Sep 17 00:00:00 2001 From: Toyomasa Watarai Date: Thu, 19 Sep 2013 16:16:05 +0900 Subject: [PATCH 1/3] Fixed ADC offset problem --- .../targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h | 3 ++- .../targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h index 724ab1ab282..3ec662f11c8 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h @@ -37,7 +37,8 @@ typedef enum { ADC0_3, ADC0_4, ADC0_5, - ADC0_6 + ADC0_6, + ADC0_7 } ADCName; typedef enum { diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c index 49ad37453ef..2b0f0322b2a 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c @@ -32,9 +32,9 @@ static const PinMap PinMap_ADC[] = { {P1_0 , ADC0_1, 2}, {P1_1 , ADC0_2, 2}, {P1_2 , ADC0_3, 2}, - {P1_4 , ADC0_4, 1}, - {P1_10, ADC0_5, 1}, - {P1_11, ADC0_6, 1}, + {P1_4 , ADC0_5, 1}, + {P1_10, ADC0_6, 1}, + {P1_11, ADC0_7, 1}, {NC , NC , 0} }; From f4bfe5aedbd39207a865c5e7be16ef4ddfe6ad14 Mon Sep 17 00:00:00 2001 From: Toyomasa Watarai Date: Thu, 19 Sep 2013 16:16:52 +0900 Subject: [PATCH 2/3] Revert "Fixed ADC offset problem" This reverts commit 399acd1d6f0c130ff3dd6ce318c93eb9f4a92651. --- .../targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h | 3 +-- .../targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h index 3ec662f11c8..724ab1ab282 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h @@ -37,8 +37,7 @@ typedef enum { ADC0_3, ADC0_4, ADC0_5, - ADC0_6, - ADC0_7 + ADC0_6 } ADCName; typedef enum { diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c index 2b0f0322b2a..49ad37453ef 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c @@ -32,9 +32,9 @@ static const PinMap PinMap_ADC[] = { {P1_0 , ADC0_1, 2}, {P1_1 , ADC0_2, 2}, {P1_2 , ADC0_3, 2}, - {P1_4 , ADC0_5, 1}, - {P1_10, ADC0_6, 1}, - {P1_11, ADC0_7, 1}, + {P1_4 , ADC0_4, 1}, + {P1_10, ADC0_5, 1}, + {P1_11, ADC0_6, 1}, {NC , NC , 0} }; From 866858a81640ffda3fae7cd5cde09718c25d24f1 Mon Sep 17 00:00:00 2001 From: Toyomasa Watarai Date: Thu, 19 Sep 2013 16:19:04 +0900 Subject: [PATCH 3/3] Fixed LPC1114 ADC offset problem --- .../hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h | 3 ++- .../targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h index 724ab1ab282..3ec662f11c8 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PeripheralNames.h @@ -37,7 +37,8 @@ typedef enum { ADC0_3, ADC0_4, ADC0_5, - ADC0_6 + ADC0_6, + ADC0_7 } ADCName; typedef enum { diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c index 49ad37453ef..7fd16253d3d 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c @@ -32,9 +32,10 @@ static const PinMap PinMap_ADC[] = { {P1_0 , ADC0_1, 2}, {P1_1 , ADC0_2, 2}, {P1_2 , ADC0_3, 2}, - {P1_4 , ADC0_4, 1}, - {P1_10, ADC0_5, 1}, - {P1_11, ADC0_6, 1}, + // ADC0_4 (P1_3) should be mapped to SWDIO only + {P1_4 , ADC0_5, 1}, + {P1_10, ADC0_6, 1}, + {P1_11, ADC0_7, 1}, {NC , NC , 0} };