mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

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.

Revision:
556:a217bc785985
Parent:
548:1abac31e188e
--- a/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_object.h	Wed Jun 03 08:00:08 2015 +0100
+++ b/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_object.h	Wed Jun 03 08:30:08 2015 +0100
@@ -25,27 +25,25 @@
 
 typedef struct {
     PinName pin;
-    uint32_t mask;
-    GPIO_Port_TypeDef port;
     PinMode mode;
-    uint32_t dir;
+    PinDirection dir;
 } gpio_t;
 
 static inline void gpio_write(gpio_t *obj, int value)
 {
     if (value) {
-        GPIO_PinOutSet(obj->port, obj->pin & 0xF); // Pin number encoded in first four bits of obj->pin
+        GPIO_PinOutSet((GPIO_Port_TypeDef)((obj->pin >> 4) & 0xF), obj->pin & 0xF); // Pin number encoded in first four bits of obj->pin
     } else {
-        GPIO_PinOutClear(obj->port, obj->pin & 0xF);
+        GPIO_PinOutClear((GPIO_Port_TypeDef)((obj->pin >> 4) & 0xF), obj->pin & 0xF);
     }
 }
 
 static inline int gpio_read(gpio_t *obj)
 {
     if (obj->dir == PIN_INPUT) {
-        return GPIO_PinInGet(obj->port, obj->pin & 0xF); // Pin number encoded in first four bits of obj->pin
+        return GPIO_PinInGet((GPIO_Port_TypeDef)((obj->pin >> 4) & 0xF), obj->pin & 0xF); // Pin number encoded in first four bits of obj->pin
     } else {
-        return GPIO_PinOutGet(obj->port, obj->pin & 0xF);
+        return GPIO_PinOutGet((GPIO_Port_TypeDef)((obj->pin >> 4) & 0xF), obj->pin & 0xF);
     }
 }