This is the final version of Mini Gateway for Automation and Security desgined for Renesas GR Peach Design Contest

Dependencies:   GR-PEACH_video GraphicsFramework HTTPServer R_BSP mbed-rpc mbed-rtos Socket lwip-eth lwip-sys lwip FATFileSystem

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Committer:
vipinranka
Date:
Wed Jan 11 11:41:30 2017 +0000
Revision:
12:9a20164dcc47
This is the final version MGAS Project for Renesas GR Peach Design Contest

Who changed what in which revision?

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