mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
178:79309dc6340a
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 178:79309dc6340a 1 /*******************************************************************************
AnnaBridge 178:79309dc6340a 2 * Copyright (c) 2010-2017 Analog Devices, Inc.
AnnaBridge 178:79309dc6340a 3 *
AnnaBridge 178:79309dc6340a 4 * All rights reserved.
AnnaBridge 178:79309dc6340a 5 *
AnnaBridge 178:79309dc6340a 6 * Redistribution and use in source and binary forms, with or without modification,
AnnaBridge 178:79309dc6340a 7 * are permitted provided that the following conditions are met:
AnnaBridge 178:79309dc6340a 8 * - Redistributions of source code must retain the above copyright notice,
AnnaBridge 178:79309dc6340a 9 * this list of conditions and the following disclaimer.
AnnaBridge 178:79309dc6340a 10 * - Redistributions in binary form must reproduce the above copyright notice,
AnnaBridge 178:79309dc6340a 11 * this list of conditions and the following disclaimer in the documentation
AnnaBridge 178:79309dc6340a 12 * and/or other materials provided with the distribution.
AnnaBridge 178:79309dc6340a 13 * - Modified versions of the software must be conspicuously marked as such.
AnnaBridge 178:79309dc6340a 14 * - This software is licensed solely and exclusively for use with processors
AnnaBridge 178:79309dc6340a 15 * manufactured by or for Analog Devices, Inc.
AnnaBridge 178:79309dc6340a 16 * - This software may not be combined or merged with other code in any manner
AnnaBridge 178:79309dc6340a 17 * that would cause the software to become subject to terms and conditions
AnnaBridge 178:79309dc6340a 18 * which differ from those listed here.
AnnaBridge 178:79309dc6340a 19 * - Neither the name of Analog Devices, Inc. nor the names of its
AnnaBridge 178:79309dc6340a 20 * contributors may be used to endorse or promote products derived
AnnaBridge 178:79309dc6340a 21 * from this software without specific prior written permission.
AnnaBridge 178:79309dc6340a 22 * - The use of this software may or may not infringe the patent rights of one
AnnaBridge 178:79309dc6340a 23 * or more patent holders. This license does not release you from the
AnnaBridge 178:79309dc6340a 24 * requirement that you obtain separate licenses from these patent holders
AnnaBridge 178:79309dc6340a 25 * to use this software.
AnnaBridge 178:79309dc6340a 26 *
AnnaBridge 178:79309dc6340a 27 * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS"
AnnaBridge 178:79309dc6340a 28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-
AnnaBridge 178:79309dc6340a 29 * INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
AnnaBridge 178:79309dc6340a 30 * DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE
AnnaBridge 178:79309dc6340a 31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR
AnnaBridge 178:79309dc6340a 32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF
AnnaBridge 178:79309dc6340a 33 * CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF
AnnaBridge 178:79309dc6340a 34 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
AnnaBridge 178:79309dc6340a 35 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
AnnaBridge 178:79309dc6340a 36 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
AnnaBridge 178:79309dc6340a 37 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
AnnaBridge 178:79309dc6340a 38 * POSSIBILITY OF SUCH DAMAGE.
AnnaBridge 178:79309dc6340a 39 ******************************************************************************/
AnnaBridge 178:79309dc6340a 40
AnnaBridge 178:79309dc6340a 41 #ifndef MBED_GPIO_OBJECT_H
AnnaBridge 178:79309dc6340a 42 #define MBED_GPIO_OBJECT_H
AnnaBridge 178:79309dc6340a 43
AnnaBridge 178:79309dc6340a 44 #ifdef __cplusplus
AnnaBridge 178:79309dc6340a 45 extern "C" {
AnnaBridge 178:79309dc6340a 46 #endif
AnnaBridge 178:79309dc6340a 47
AnnaBridge 178:79309dc6340a 48 typedef struct {
AnnaBridge 178:79309dc6340a 49 PinName pin;
AnnaBridge 178:79309dc6340a 50 } gpio_t;
AnnaBridge 178:79309dc6340a 51
AnnaBridge 178:79309dc6340a 52 static inline int gpio_is_connected(const gpio_t *obj)
AnnaBridge 178:79309dc6340a 53 {
AnnaBridge 178:79309dc6340a 54 return obj->pin != (PinName)NC;
AnnaBridge 178:79309dc6340a 55 }
AnnaBridge 178:79309dc6340a 56
AnnaBridge 178:79309dc6340a 57 #ifdef __cplusplus
AnnaBridge 178:79309dc6340a 58 }
AnnaBridge 178:79309dc6340a 59 #endif
AnnaBridge 178:79309dc6340a 60
AnnaBridge 178:79309dc6340a 61 #endif