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