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

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
<>
Date:
Mon Jan 16 12:05:23 2017 +0000
Revision:
134:ad3be0349dc5
Parent:
101:7cff1c4259d7
Release 134 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3488: Dev stm i2c v2 unitary functions https://github.com/ARMmbed/mbed-os/pull/3488
3492: Fix #3463 CAN read() return value https://github.com/ARMmbed/mbed-os/pull/3492
3503: [LPC15xx] Ensure that PWM=1 is resolved correctly https://github.com/ARMmbed/mbed-os/pull/3503
3504: [LPC15xx] CAN implementation improvements https://github.com/ARMmbed/mbed-os/pull/3504
3539: NUCLEO_F412ZG - Add support of TRNG peripheral https://github.com/ARMmbed/mbed-os/pull/3539
3540: STM: SPI: Initialize Rx in spi_master_write https://github.com/ARMmbed/mbed-os/pull/3540
3438: K64F: Add support for SERIAL ASYNCH API https://github.com/ARMmbed/mbed-os/pull/3438
3519: MCUXpresso: Fix ENET driver to enable interrupts after interrupt handler is set https://github.com/ARMmbed/mbed-os/pull/3519
3544: STM32L4 deepsleep improvement https://github.com/ARMmbed/mbed-os/pull/3544
3546: NUCLEO-F412ZG - Add CAN peripheral https://github.com/ARMmbed/mbed-os/pull/3546
3551: Fix I2C driver for RZ/A1H https://github.com/ARMmbed/mbed-os/pull/3551
3558: K64F UART Asynch API: Fix synchronization issue https://github.com/ARMmbed/mbed-os/pull/3558
3563: LPC4088 - Fix vector checksum https://github.com/ARMmbed/mbed-os/pull/3563
3567: Dev stm32 F0 v1.7.0 https://github.com/ARMmbed/mbed-os/pull/3567
3577: Fixes linking errors when building with debug profile https://github.com/ARMmbed/mbed-os/pull/3577

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 101:7cff1c4259d7 1 /*******************************************************************************
Kojto 101:7cff1c4259d7 2 * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
Kojto 101:7cff1c4259d7 3 *
Kojto 101:7cff1c4259d7 4 * Permission is hereby granted, free of charge, to any person obtaining a
Kojto 101:7cff1c4259d7 5 * copy of this software and associated documentation files (the "Software"),
Kojto 101:7cff1c4259d7 6 * to deal in the Software without restriction, including without limitation
Kojto 101:7cff1c4259d7 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Kojto 101:7cff1c4259d7 8 * and/or sell copies of the Software, and to permit persons to whom the
Kojto 101:7cff1c4259d7 9 * Software is furnished to do so, subject to the following conditions:
Kojto 101:7cff1c4259d7 10 *
Kojto 101:7cff1c4259d7 11 * The above copyright notice and this permission notice shall be included
Kojto 101:7cff1c4259d7 12 * in all copies or substantial portions of the Software.
Kojto 101:7cff1c4259d7 13 *
Kojto 101:7cff1c4259d7 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
Kojto 101:7cff1c4259d7 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Kojto 101:7cff1c4259d7 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Kojto 101:7cff1c4259d7 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
Kojto 101:7cff1c4259d7 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Kojto 101:7cff1c4259d7 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Kojto 101:7cff1c4259d7 20 * OTHER DEALINGS IN THE SOFTWARE.
Kojto 101:7cff1c4259d7 21 *
Kojto 101:7cff1c4259d7 22 * Except as contained in this notice, the name of Maxim Integrated
Kojto 101:7cff1c4259d7 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
Kojto 101:7cff1c4259d7 24 * Products, Inc. Branding Policy.
Kojto 101:7cff1c4259d7 25 *
Kojto 101:7cff1c4259d7 26 * The mere transfer of this software does not imply any licenses
Kojto 101:7cff1c4259d7 27 * of trade secrets, proprietary technology, copyrights, patents,
Kojto 101:7cff1c4259d7 28 * trademarks, maskwork rights, or any other form of intellectual
Kojto 101:7cff1c4259d7 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
Kojto 101:7cff1c4259d7 30 * ownership rights.
Kojto 101:7cff1c4259d7 31 *******************************************************************************
Kojto 101:7cff1c4259d7 32 */
Kojto 101:7cff1c4259d7 33
Kojto 101:7cff1c4259d7 34 #ifndef MBED_GPIO_OBJECT_H
Kojto 101:7cff1c4259d7 35 #define MBED_GPIO_OBJECT_H
Kojto 101:7cff1c4259d7 36
Kojto 101:7cff1c4259d7 37 #include "mbed_assert.h"
Kojto 101:7cff1c4259d7 38
Kojto 101:7cff1c4259d7 39 #ifdef __cplusplus
Kojto 101:7cff1c4259d7 40 extern "C" {
Kojto 101:7cff1c4259d7 41 #endif
Kojto 101:7cff1c4259d7 42
Kojto 101:7cff1c4259d7 43 typedef struct {
Kojto 101:7cff1c4259d7 44 PinName name;
Kojto 101:7cff1c4259d7 45 __IO uint32_t *reg_out;
Kojto 101:7cff1c4259d7 46 __I uint32_t *reg_in;
Kojto 101:7cff1c4259d7 47 } gpio_t;
Kojto 101:7cff1c4259d7 48
Kojto 101:7cff1c4259d7 49 static inline void gpio_write(gpio_t *obj, int value)
Kojto 101:7cff1c4259d7 50 {
Kojto 101:7cff1c4259d7 51 MBED_ASSERT(obj->name != (PinName)NC);
Kojto 101:7cff1c4259d7 52 *obj->reg_out = !!value;
Kojto 101:7cff1c4259d7 53 }
Kojto 101:7cff1c4259d7 54
Kojto 101:7cff1c4259d7 55 static inline int gpio_read(gpio_t *obj)
Kojto 101:7cff1c4259d7 56 {
Kojto 101:7cff1c4259d7 57 MBED_ASSERT(obj->name != (PinName)NC);
Kojto 101:7cff1c4259d7 58 return *obj->reg_in;
Kojto 101:7cff1c4259d7 59 }
Kojto 101:7cff1c4259d7 60
Kojto 101:7cff1c4259d7 61 void pin_dir(PinName name, PinDirection direction);
Kojto 101:7cff1c4259d7 62
Kojto 101:7cff1c4259d7 63 static inline int gpio_is_connected(const gpio_t *obj) {
Kojto 101:7cff1c4259d7 64 return obj->name != (PinName)NC;
Kojto 101:7cff1c4259d7 65 }
Kojto 101:7cff1c4259d7 66
Kojto 101:7cff1c4259d7 67 #ifdef __cplusplus
Kojto 101:7cff1c4259d7 68 }
Kojto 101:7cff1c4259d7 69 #endif
Kojto 101:7cff1c4259d7 70
Kojto 101:7cff1c4259d7 71 #endif