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:
402:09075a3b15e3
Parent:
285:31249416b6f9
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F072RB/port_api.c	Fri Nov 14 08:45:06 2014 +0000
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F072RB/port_api.c	Fri Nov 14 09:00:07 2014 +0000
@@ -38,11 +38,13 @@
 
 // high nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F, ...)
 // low nibble  = pin number
-PinName port_pin(PortName port, int pin_n) {
+PinName port_pin(PortName port, int pin_n)
+{
     return (PinName)(pin_n + (port << 4));
 }
 
-void port_init(port_t *obj, PortName port, int mask, PinDirection dir) {
+void port_init(port_t *obj, PortName port, int mask, PinDirection dir)
+{
     uint32_t port_index = (uint32_t)port;
 
     // Enable GPIO clock
@@ -59,7 +61,8 @@
     port_dir(obj, dir);
 }
 
-void port_dir(port_t *obj, PinDirection dir) {
+void port_dir(port_t *obj, PinDirection dir)
+{
     uint32_t i;
     obj->direction = dir;
     for (i = 0; i < 16; i++) { // Process all pins
@@ -73,7 +76,8 @@
     }
 }
 
-void port_mode(port_t *obj, PinMode mode) {
+void port_mode(port_t *obj, PinMode mode)
+{
     uint32_t i;
     for (i = 0; i < 16; i++) { // Process all pins
         if (obj->mask & (1 << i)) { // If the pin is used
@@ -82,11 +86,13 @@
     }
 }
 
-void port_write(port_t *obj, int value) {
+void port_write(port_t *obj, int value)
+{
     *obj->reg_out = (*obj->reg_out & ~obj->mask) | (value & obj->mask);
 }
 
-int port_read(port_t *obj) {
+int port_read(port_t *obj)
+{
     if (obj->direction == PIN_OUTPUT) {
         return (*obj->reg_out & obj->mask);
     } else { // PIN_INPUT