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 PinNames.h
Zaitsev 10:41552d038a69 4 * @brief Implements common PIN names for peripherals.
Zaitsev 10:41552d038a69 5 * @internal
Zaitsev 10:41552d038a69 6 * @author ON Semiconductor
Zaitsev 10:41552d038a69 7 * $Rev: 0.1 $
Zaitsev 10:41552d038a69 8 * $Date: 2015-11-06 $
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 debug
Zaitsev 10:41552d038a69 28 */
Zaitsev 10:41552d038a69 29
Zaitsev 10:41552d038a69 30
Zaitsev 10:41552d038a69 31 #ifndef PINNAME_H_
Zaitsev 10:41552d038a69 32 #define PINNAME_H_
Zaitsev 10:41552d038a69 33
Zaitsev 10:41552d038a69 34 #include "types.h"
Zaitsev 10:41552d038a69 35 #ifdef __cplusplus
Zaitsev 10:41552d038a69 36 extern "C" {
Zaitsev 10:41552d038a69 37 #endif
Zaitsev 10:41552d038a69 38
Zaitsev 10:41552d038a69 39 typedef enum {
Zaitsev 10:41552d038a69 40 GPIO0 = 0,
Zaitsev 10:41552d038a69 41 GPIO1,
Zaitsev 10:41552d038a69 42 GPIO2,
Zaitsev 10:41552d038a69 43 GPIO3,
Zaitsev 10:41552d038a69 44 GPIO4,
Zaitsev 10:41552d038a69 45 GPIO5,
Zaitsev 10:41552d038a69 46 GPIO6,
Zaitsev 10:41552d038a69 47 GPIO7,
Zaitsev 10:41552d038a69 48 GPIO8,
Zaitsev 10:41552d038a69 49 GPIO9,
Zaitsev 10:41552d038a69 50 GPIO10,
Zaitsev 10:41552d038a69 51 GPIO11,
Zaitsev 10:41552d038a69 52 GPIO12,
Zaitsev 10:41552d038a69 53 GPIO13,
Zaitsev 10:41552d038a69 54 GPIO14,
Zaitsev 10:41552d038a69 55 GPIO15,
Zaitsev 10:41552d038a69 56 GPIO16,
Zaitsev 10:41552d038a69 57 GPIO17,
Zaitsev 10:41552d038a69 58 A0,
Zaitsev 10:41552d038a69 59 A1,
Zaitsev 10:41552d038a69 60 A2,
Zaitsev 10:41552d038a69 61 A3,
Zaitsev 10:41552d038a69 62 UART1_TX = GPIO0,
Zaitsev 10:41552d038a69 63 UART1_RX = GPIO1,
Zaitsev 10:41552d038a69 64 UART2_TX = GPIO8,
Zaitsev 10:41552d038a69 65 UART2_RX = GPIO9,
Zaitsev 10:41552d038a69 66
Zaitsev 10:41552d038a69 67 I2C1_SCLK_1 = GPIO2,
Zaitsev 10:41552d038a69 68 I2C1_SDATA_1 = GPIO3,
Zaitsev 10:41552d038a69 69 I2C1_SCLK_2 = GPIO5,
Zaitsev 10:41552d038a69 70 I2C1_SDATA_2 = GPIO4,
Zaitsev 10:41552d038a69 71 I2C1_SCLK = I2C1_SCLK_1, /*Default*/
Zaitsev 10:41552d038a69 72 I2C1_SDATA = I2C1_SDATA_1, /*Default*/
Zaitsev 10:41552d038a69 73
Zaitsev 10:41552d038a69 74 I2C2_SCLK_1 = GPIO14,
Zaitsev 10:41552d038a69 75 I2C2_SDATA_1 = GPIO15,
Zaitsev 10:41552d038a69 76 I2C2_SCLK_2 = GPIO17,
Zaitsev 10:41552d038a69 77 I2C2_SDATA_2 = GPIO16,
Zaitsev 10:41552d038a69 78 I2C2_SCLK = I2C2_SCLK_2, /*Default*/
Zaitsev 10:41552d038a69 79 I2C2_SDATA = I2C2_SDATA_2, /*Default*/
Zaitsev 10:41552d038a69 80 I2C_SCL = I2C1_SCLK_1, /*Default*/
Zaitsev 10:41552d038a69 81 I2C_SDA = I2C1_SDATA_1, /*Default*/
Zaitsev 10:41552d038a69 82
Zaitsev 10:41552d038a69 83 /* SPI 1 with 1st set of CROSS BAR */
Zaitsev 10:41552d038a69 84 SPI1_SSNO0_1 = GPIO0,
Zaitsev 10:41552d038a69 85 SPI1_SSNO1_1 = GPIO1,
Zaitsev 10:41552d038a69 86 SPI1_SSNO2_1 = GPIO2,
Zaitsev 10:41552d038a69 87 SPI1_SSNO3_1 = GPIO3,
Zaitsev 10:41552d038a69 88
Zaitsev 10:41552d038a69 89 /* SPI 1 with 2st set of CROSS BAR */
Zaitsev 10:41552d038a69 90 SPI1_SCLK_2 = GPIO4,
Zaitsev 10:41552d038a69 91 SPI1_SDATAO_2 = GPIO5,
Zaitsev 10:41552d038a69 92 SPI1_SDATAI_2 = GPIO6,
Zaitsev 10:41552d038a69 93 SPI1_SSNI_2 = GPIO7,
Zaitsev 10:41552d038a69 94 SPI1_SSNO0_2 = GPIO8,
Zaitsev 10:41552d038a69 95 SPI1_SSNO1_2 = GPIO9,
Zaitsev 10:41552d038a69 96 SPI1_SSNO2_2 = GPIO10,
Zaitsev 10:41552d038a69 97
Zaitsev 10:41552d038a69 98 SPI1_SCLK = SPI1_SCLK_2, /*Default*/
Zaitsev 10:41552d038a69 99 SPI1_SDATAO = SPI1_SDATAO_2, /*Default*/
Zaitsev 10:41552d038a69 100 SPI1_SDATAI = SPI1_SDATAI_2, /*Default*/
Zaitsev 10:41552d038a69 101 SPI1_SSNI = SPI1_SSNI_2, /*Default*/
Zaitsev 10:41552d038a69 102 SPI1_SSNO0 = SPI1_SSNO0_2, /*Default*/
Zaitsev 10:41552d038a69 103 SPI1_SSNO1 = SPI1_SSNO1_2, /*Default*/
Zaitsev 10:41552d038a69 104 SPI1_SSNO2 = SPI1_SSNO2_2, /*Default*/
Zaitsev 10:41552d038a69 105
Zaitsev 10:41552d038a69 106 /* SPI 1 with 3rd set of CROSS BAR */
Zaitsev 10:41552d038a69 107 SPI1_SCLK_3 = GPIO8,
Zaitsev 10:41552d038a69 108 SPI1_SDATAO_3 = GPIO9,
Zaitsev 10:41552d038a69 109 SPI1_SDATAI_3 = GPIO10,
Zaitsev 10:41552d038a69 110
Zaitsev 10:41552d038a69 111 /* SPI 2 */
Zaitsev 10:41552d038a69 112 SPI2_SCLK = GPIO14,
Zaitsev 10:41552d038a69 113 SPI2_SDATAO = GPIO15,
Zaitsev 10:41552d038a69 114 SPI2_SDATAI = GPIO16,
Zaitsev 10:41552d038a69 115 SPI2_SSNI = GPIO17,
Zaitsev 10:41552d038a69 116 SPI2_SSNO0 = GPIO17,
Zaitsev 10:41552d038a69 117
Zaitsev 10:41552d038a69 118 // Generic signals namings
Zaitsev 10:41552d038a69 119 LED1 = GPIO4,
Zaitsev 10:41552d038a69 120 LED2 = GPIO6,
Zaitsev 10:41552d038a69 121 LED3 = GPIO5,
Zaitsev 10:41552d038a69 122 LED4 = (int)0xFFFFFFFF,
Zaitsev 10:41552d038a69 123 LED5 = (int)0xFFFFFFFF,
Zaitsev 10:41552d038a69 124 LED_GREEN = GPIO4,
Zaitsev 10:41552d038a69 125 LED_YELLOW = GPIO6,
Zaitsev 10:41552d038a69 126 LED_BLUE = GPIO5,
Zaitsev 10:41552d038a69 127 USER_BUTTON = GPIO7, /*NEW connection on NCS36510-RF Rev 1.1 - Alias of SW1 */
Zaitsev 10:41552d038a69 128 SW1 = GPIO7, /*NEW connection on NCS36510-RF Rev 1.1 */
Zaitsev 10:41552d038a69 129 SW2 = GPIO10, /*NEW connection on NCS36510-RF Rev 1.1 */
Zaitsev 10:41552d038a69 130 SERIAL_TX = GPIO0,
Zaitsev 10:41552d038a69 131 SERIAL_RX = GPIO1,
Zaitsev 10:41552d038a69 132 USBTX = GPIO0,
Zaitsev 10:41552d038a69 133 USBRX = GPIO1,
Zaitsev 10:41552d038a69 134 D0 = GPIO9,
Zaitsev 10:41552d038a69 135 D1 = GPIO8,
Zaitsev 10:41552d038a69 136 D2 = GPIO4,
Zaitsev 10:41552d038a69 137 D3 = GPIO6,
Zaitsev 10:41552d038a69 138 D4 = GPIO5,
Zaitsev 10:41552d038a69 139 D5 = GPIO7,
Zaitsev 10:41552d038a69 140 D6 = GPIO10,
Zaitsev 10:41552d038a69 141 D7 = (int)0xFFFFFFFF,
Zaitsev 10:41552d038a69 142 D8 = (int)0xFFFFFFFF,
Zaitsev 10:41552d038a69 143 D9 = (int)0xFFFFFFFF,
Zaitsev 10:41552d038a69 144 D10 = GPIO17,
Zaitsev 10:41552d038a69 145 D11 = GPIO15,
Zaitsev 10:41552d038a69 146 D12 = GPIO16,
Zaitsev 10:41552d038a69 147 D13 = GPIO14,
Zaitsev 10:41552d038a69 148 D14 = GPIO3,
Zaitsev 10:41552d038a69 149 D15 = GPIO2,
Zaitsev 10:41552d038a69 150 NC = (int)0xFFFFFFFF
Zaitsev 10:41552d038a69 151 } PinName;
Zaitsev 10:41552d038a69 152
Zaitsev 10:41552d038a69 153 typedef enum {
Zaitsev 10:41552d038a69 154 PIN_INPUT,
Zaitsev 10:41552d038a69 155 PIN_OUTPUT,
Zaitsev 10:41552d038a69 156
Zaitsev 10:41552d038a69 157 } PinDirection;
Zaitsev 10:41552d038a69 158
Zaitsev 10:41552d038a69 159 typedef enum {
Zaitsev 10:41552d038a69 160 PushPullPullDown = 0,
Zaitsev 10:41552d038a69 161 PushPullNoPull = 1,
Zaitsev 10:41552d038a69 162 PushPullPullUp = 2,
Zaitsev 10:41552d038a69 163 OpenDrainPullDown = 3,
Zaitsev 10:41552d038a69 164 OpenDrainNoPull = 4,
Zaitsev 10:41552d038a69 165 OpenDrainPullUp = 5,
Zaitsev 10:41552d038a69 166 PullNone = PushPullNoPull,
Zaitsev 10:41552d038a69 167 PullUp = PushPullPullUp,
Zaitsev 10:41552d038a69 168 PullDown = PushPullPullDown,
Zaitsev 10:41552d038a69 169 OpenDrain = OpenDrainPullUp,
Zaitsev 10:41552d038a69 170 PullDefault = PullNone
Zaitsev 10:41552d038a69 171
Zaitsev 10:41552d038a69 172 } PinMode;
Zaitsev 10:41552d038a69 173
Zaitsev 10:41552d038a69 174 #ifdef __cplusplus
Zaitsev 10:41552d038a69 175 }
Zaitsev 10:41552d038a69 176 #endif
Zaitsev 10:41552d038a69 177
Zaitsev 10:41552d038a69 178 #endif //PINNAME_H_