lol

Dependencies:   MMA8451Q

Fork of Application by Mateusz Kowalik

Committer:
Zaitsev
Date:
Tue Jan 10 20:42:26 2017 +0000
Revision:
10:41552d038a69
USB Serial bi-directional bridge

Who changed what in which revision?

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