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:
630:825f75ca301e
Parent:
469:fc4922e0c183
--- a/targets/hal/TARGET_STM/TARGET_STM32F0/port_api.c	Mon Sep 28 10:30:09 2015 +0100
+++ b/targets/hal/TARGET_STM/TARGET_STM32F0/port_api.c	Mon Sep 28 10:45:10 2015 +0100
@@ -1,6 +1,6 @@
 /* mbed Microcontroller Library
  *******************************************************************************
- * Copyright (c) 2014, STMicroelectronics
+ * Copyright (c) 2015, STMicroelectronics
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -38,13 +38,11 @@
 
 // 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
@@ -61,8 +59,7 @@
     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
@@ -76,8 +73,7 @@
     }
 }
 
-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
@@ -86,13 +82,11 @@
     }
 }
 
-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