mbed SDK library sources

Fork of mbed-src by mbed official

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Fri Oct 11 13:30:08 2013 +0100
Parent:
33:e214068ab66c
Child:
35:371630885ad6
Commit message:
Synchronized with git revision eaafc74ae29c565a716b8c5f9d5899ef7d680b8b

Changed in this revision

targets/hal/TARGET_NXP/TARGET_LPC408X/i2c_api.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NXP/TARGET_LPC408X/port_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_NXP/TARGET_LPC408X/i2c_api.c	Mon Oct 07 09:15:08 2013 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC408X/i2c_api.c	Fri Oct 11 13:30:08 2013 +0100
@@ -122,6 +122,15 @@
     
     pinmap_pinout(sda, PinMap_I2C_SDA);
     pinmap_pinout(scl, PinMap_I2C_SCL);
+
+    // OpenDrain must explicitly be enabled for p0.0 and p0.1
+    if (sda == P0_0) {
+        pin_mode(sda, OpenDrain);
+    }
+    if (scl == P0_1) {
+        pin_mode(scl, OpenDrain);
+    }
+
 }
 
 inline int i2c_start(i2c_t *obj) {
--- a/targets/hal/TARGET_NXP/TARGET_LPC408X/port_api.c	Mon Oct 07 09:15:08 2013 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC408X/port_api.c	Fri Oct 11 13:30:08 2013 +0100
@@ -17,8 +17,9 @@
 #include "pinmap.h"
 #include "gpio_api.h"
 
+
 PinName port_pin(PortName port, int pin_n) {
-    return (PinName)(LPC_GPIO0_BASE + ((port << PORT_SHIFT) | pin_n));
+    return (PinName)(((port << PORT_SHIFT) | pin_n));
 }
 
 void port_init(port_t *obj, PortName port, int mask, PinDirection dir) {