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:
AnnaBridge
Date:
Thu Nov 08 11:45:42 2018 +0000
Revision:
171:3a7713b1edbc
mbed library. Release version 164

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 171:3a7713b1edbc 1 /**
AnnaBridge 171:3a7713b1edbc 2 ******************************************************************************
AnnaBridge 171:3a7713b1edbc 3 * @file gpio.h
AnnaBridge 171:3a7713b1edbc 4 * @brief (API) Public header of GPIO driver
AnnaBridge 171:3a7713b1edbc 5 * @internal
AnnaBridge 171:3a7713b1edbc 6 * @author ON Semiconductor
AnnaBridge 171:3a7713b1edbc 7 * $Rev: 3724 $
AnnaBridge 171:3a7713b1edbc 8 * $Date: 2015-09-14 14:35:42 +0530 (Mon, 14 Sep 2015) $
AnnaBridge 171:3a7713b1edbc 9 ******************************************************************************
AnnaBridge 171:3a7713b1edbc 10 * Copyright 2016 Semiconductor Components Industries LLC (d/b/a “ON Semiconductor”).
AnnaBridge 171:3a7713b1edbc 11 * All rights reserved. This software and/or documentation is licensed by ON Semiconductor
AnnaBridge 171:3a7713b1edbc 12 * under limited terms and conditions. The terms and conditions pertaining to the software
AnnaBridge 171:3a7713b1edbc 13 * and/or documentation are available at http://www.onsemi.com/site/pdf/ONSEMI_T&C.pdf
AnnaBridge 171:3a7713b1edbc 14 * (“ON Semiconductor Standard Terms and Conditions of Sale, Section 8 Software”) and
AnnaBridge 171:3a7713b1edbc 15 * if applicable the software license agreement. Do not use this software and/or
AnnaBridge 171:3a7713b1edbc 16 * documentation unless you have carefully read and you agree to the limited terms and
AnnaBridge 171:3a7713b1edbc 17 * conditions. By using this software and/or documentation, you agree to the limited
AnnaBridge 171:3a7713b1edbc 18 * terms and conditions.
AnnaBridge 171:3a7713b1edbc 19 *
AnnaBridge 171:3a7713b1edbc 20 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
AnnaBridge 171:3a7713b1edbc 21 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
AnnaBridge 171:3a7713b1edbc 22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
AnnaBridge 171:3a7713b1edbc 23 * ON SEMICONDUCTOR SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL,
AnnaBridge 171:3a7713b1edbc 24 * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
AnnaBridge 171:3a7713b1edbc 25 * @endinternal
AnnaBridge 171:3a7713b1edbc 26 *
AnnaBridge 171:3a7713b1edbc 27 * @ingroup gpio
AnnaBridge 171:3a7713b1edbc 28 *
AnnaBridge 171:3a7713b1edbc 29 * @details
AnnaBridge 171:3a7713b1edbc 30 *
AnnaBridge 171:3a7713b1edbc 31 * <h1> General description </h1>
AnnaBridge 171:3a7713b1edbc 32 * <p>
AnnaBridge 171:3a7713b1edbc 33 * The APB GPIO is a configurable module allowing the use of 14 I/O lines.
AnnaBridge 171:3a7713b1edbc 34 * Each line can be configured independently.
AnnaBridge 171:3a7713b1edbc 35 * The GPIO module supports a wide variety of features concerning interrupts,
AnnaBridge 171:3a7713b1edbc 36 * which can be triggered by a low level, high level, positive or negative edge,
AnnaBridge 171:3a7713b1edbc 37 * or both edges.
AnnaBridge 171:3a7713b1edbc 38 * </p>
AnnaBridge 171:3a7713b1edbc 39 *
AnnaBridge 171:3a7713b1edbc 40 */
AnnaBridge 171:3a7713b1edbc 41
AnnaBridge 171:3a7713b1edbc 42 #ifndef GPIO_H_
AnnaBridge 171:3a7713b1edbc 43 #define GPIO_H_
AnnaBridge 171:3a7713b1edbc 44
AnnaBridge 171:3a7713b1edbc 45 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 46 extern "C" {
AnnaBridge 171:3a7713b1edbc 47 #endif
AnnaBridge 171:3a7713b1edbc 48
AnnaBridge 171:3a7713b1edbc 49 #include "memory_map.h"
AnnaBridge 171:3a7713b1edbc 50 #include "gpio_map.h"
AnnaBridge 171:3a7713b1edbc 51 #include "pad_map.h"
AnnaBridge 171:3a7713b1edbc 52 #include "crossbar.h"
AnnaBridge 171:3a7713b1edbc 53 #include "clock.h"
AnnaBridge 171:3a7713b1edbc 54 #include "pad.h"
AnnaBridge 171:3a7713b1edbc 55
AnnaBridge 171:3a7713b1edbc 56
AnnaBridge 171:3a7713b1edbc 57 /** output configuration push/pull */
AnnaBridge 171:3a7713b1edbc 58 #define PAD_OUTCFG_PUSHPULL (uint8_t)0x00
AnnaBridge 171:3a7713b1edbc 59
AnnaBridge 171:3a7713b1edbc 60 /** output configuration open drain */
AnnaBridge 171:3a7713b1edbc 61 #define PAD_OOUTCFG_OPENDRAIN (uint8_t)0x01
AnnaBridge 171:3a7713b1edbc 62
AnnaBridge 171:3a7713b1edbc 63 /** no pull up nor pull down */
AnnaBridge 171:3a7713b1edbc 64 #define PAD_PULL_NONE (uint8_t)0x01
AnnaBridge 171:3a7713b1edbc 65
AnnaBridge 171:3a7713b1edbc 66 /** pull down */
AnnaBridge 171:3a7713b1edbc 67 #define PAD_PULL_DOWN (uint8_t)0x00
AnnaBridge 171:3a7713b1edbc 68
AnnaBridge 171:3a7713b1edbc 69 /** pull up */
AnnaBridge 171:3a7713b1edbc 70 #define PAD_PULL_UP (uint8_t)0x03
AnnaBridge 171:3a7713b1edbc 71
AnnaBridge 171:3a7713b1edbc 72 /* Number of DIO lines supported by NCS36510 */
AnnaBridge 171:3a7713b1edbc 73 #define NUMBER_OF_GPIO ((uint8_t)0x12)
AnnaBridge 171:3a7713b1edbc 74
AnnaBridge 171:3a7713b1edbc 75 /* All DIO lines set to 1 */
AnnaBridge 171:3a7713b1edbc 76 #define IO_ALL ((uint32_t)0x3FFFF)
AnnaBridge 171:3a7713b1edbc 77 #define IO_NONE ((uint32_t)0x00000)
AnnaBridge 171:3a7713b1edbc 78
AnnaBridge 171:3a7713b1edbc 79 /* Gpio handler */
AnnaBridge 171:3a7713b1edbc 80 void fGpioHandler(void);
AnnaBridge 171:3a7713b1edbc 81
AnnaBridge 171:3a7713b1edbc 82 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 83 }
AnnaBridge 171:3a7713b1edbc 84 #endif
AnnaBridge 171:3a7713b1edbc 85
AnnaBridge 171:3a7713b1edbc 86 #endif /* GPIO_H_ */