mbed-os

Fork of mbed-os by erkin yucel

Committer:
xuaner
Date:
Thu Jul 20 14:26:57 2017 +0000
Revision:
1:3deb71413561
Parent:
0:f269e3021894
mbed_os

Who changed what in which revision?

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