|
| 1 | +/******************************************************************************* |
| 2 | + * Copyright (c) 2010-2017 Analog Devices, Inc. |
| 3 | + * |
| 4 | + * All rights reserved. |
| 5 | + * |
| 6 | + * Redistribution and use in source and binary forms, with or without modification, |
| 7 | + * are permitted provided that the following conditions are met: |
| 8 | + * - Redistributions of source code must retain the above copyright notice, |
| 9 | + * this list of conditions and the following disclaimer. |
| 10 | + * - Redistributions in binary form must reproduce the above copyright notice, |
| 11 | + * this list of conditions and the following disclaimer in the documentation |
| 12 | + * and/or other materials provided with the distribution. |
| 13 | + * - Modified versions of the software must be conspicuously marked as such. |
| 14 | + * - This software is licensed solely and exclusively for use with processors |
| 15 | + * manufactured by or for Analog Devices, Inc. |
| 16 | + * - This software may not be combined or merged with other code in any manner |
| 17 | + * that would cause the software to become subject to terms and conditions |
| 18 | + * which differ from those listed here. |
| 19 | + * - Neither the name of Analog Devices, Inc. nor the names of its |
| 20 | + * contributors may be used to endorse or promote products derived |
| 21 | + * from this software without specific prior written permission. |
| 22 | + * - The use of this software may or may not infringe the patent rights of one |
| 23 | + * or more patent holders. This license does not release you from the |
| 24 | + * requirement that you obtain separate licenses from these patent holders |
| 25 | + * to use this software. |
| 26 | + * |
| 27 | + * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" |
| 28 | + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON- |
| 29 | + * INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 30 | + * DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE |
| 31 | + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR |
| 32 | + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF |
| 33 | + * CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF |
| 34 | + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 35 | + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 36 | + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 37 | + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 38 | + * POSSIBILITY OF SUCH DAMAGE. |
| 39 | + ******************************************************************************/ |
| 40 | + |
| 41 | +#ifndef MBED_PINNAMES_H |
| 42 | +#define MBED_PINNAMES_H |
| 43 | + |
| 44 | +#include "cmsis.h" |
| 45 | + |
| 46 | +#include "adi_gpio.h" |
| 47 | + |
| 48 | +#ifdef __cplusplus |
| 49 | +extern "C" { |
| 50 | +#endif |
| 51 | + |
| 52 | +typedef enum { |
| 53 | + PIN_INPUT, |
| 54 | + PIN_OUTPUT |
| 55 | +} PinDirection; |
| 56 | + |
| 57 | +//update |
| 58 | + |
| 59 | +#define GPIO_PORT_SHIFT 12 |
| 60 | + |
| 61 | + |
| 62 | +typedef enum { |
| 63 | + P0_00 = (0 << GPIO_PORT_SHIFT | 0 ), |
| 64 | + P0_01 = (0 << GPIO_PORT_SHIFT | 1 ), |
| 65 | + P0_02 = (0 << GPIO_PORT_SHIFT | 2 ), |
| 66 | + P0_03 = (0 << GPIO_PORT_SHIFT | 3 ), |
| 67 | + P0_04 = (0 << GPIO_PORT_SHIFT | 4 ), |
| 68 | + P0_05 = (0 << GPIO_PORT_SHIFT | 5 ), |
| 69 | + P0_06 = (0 << GPIO_PORT_SHIFT | 6 ), |
| 70 | + P0_07 = (0 << GPIO_PORT_SHIFT | 7 ), |
| 71 | + P0_08 = (0 << GPIO_PORT_SHIFT | 8 ), |
| 72 | + P0_09 = (0 << GPIO_PORT_SHIFT | 9 ), |
| 73 | + P0_10 = (0 << GPIO_PORT_SHIFT | 10), |
| 74 | + P0_11 = (0 << GPIO_PORT_SHIFT | 11), |
| 75 | + P0_12 = (0 << GPIO_PORT_SHIFT | 12), |
| 76 | + P0_13 = (0 << GPIO_PORT_SHIFT | 13), |
| 77 | + P0_14 = (0 << GPIO_PORT_SHIFT | 14), |
| 78 | + P0_15 = (0 << GPIO_PORT_SHIFT | 15), |
| 79 | + P1_00 = (1 << GPIO_PORT_SHIFT | 0 ), |
| 80 | + P1_01 = (1 << GPIO_PORT_SHIFT | 1 ), |
| 81 | + P1_02 = (1 << GPIO_PORT_SHIFT | 2 ), |
| 82 | + P1_03 = (1 << GPIO_PORT_SHIFT | 3 ), |
| 83 | + P1_04 = (1 << GPIO_PORT_SHIFT | 4 ), |
| 84 | + P1_05 = (1 << GPIO_PORT_SHIFT | 5 ), |
| 85 | + P1_06 = (1 << GPIO_PORT_SHIFT | 6 ), |
| 86 | + P1_07 = (1 << GPIO_PORT_SHIFT | 7 ), |
| 87 | + P1_08 = (1 << GPIO_PORT_SHIFT | 8 ), |
| 88 | + P1_09 = (1 << GPIO_PORT_SHIFT | 9 ), |
| 89 | + P1_10 = (1 << GPIO_PORT_SHIFT | 10), |
| 90 | + P1_11 = (1 << GPIO_PORT_SHIFT | 11), |
| 91 | + P1_12 = (1 << GPIO_PORT_SHIFT | 12), |
| 92 | + P1_13 = (1 << GPIO_PORT_SHIFT | 13), |
| 93 | + P1_14 = (1 << GPIO_PORT_SHIFT | 14), |
| 94 | + P1_15 = (1 << GPIO_PORT_SHIFT | 15), |
| 95 | + P2_00 = (2 << GPIO_PORT_SHIFT | 0 ), |
| 96 | + P2_01 = (2 << GPIO_PORT_SHIFT | 1 ), |
| 97 | + P2_02 = (2 << GPIO_PORT_SHIFT | 2 ), |
| 98 | + P2_03 = (2 << GPIO_PORT_SHIFT | 3 ), |
| 99 | + P2_04 = (2 << GPIO_PORT_SHIFT | 4 ), |
| 100 | + P2_05 = (2 << GPIO_PORT_SHIFT | 5 ), |
| 101 | + P2_06 = (2 << GPIO_PORT_SHIFT | 6 ), |
| 102 | + P2_07 = (2 << GPIO_PORT_SHIFT | 7 ), |
| 103 | + P2_08 = (2 << GPIO_PORT_SHIFT | 8 ), |
| 104 | + P2_09 = (2 << GPIO_PORT_SHIFT | 9 ), |
| 105 | + P2_10 = (2 << GPIO_PORT_SHIFT | 10), |
| 106 | + P2_11 = (2 << GPIO_PORT_SHIFT | 11), |
| 107 | + |
| 108 | + // USB Pins |
| 109 | + USBTX = P0_10, |
| 110 | + USBRX = P0_11, |
| 111 | + USBTX1 = P1_15, |
| 112 | + USBRX1 = P2_00, |
| 113 | + |
| 114 | + // mbed original LED naming |
| 115 | + LED1 = P2_02, |
| 116 | + LED2 = P2_10, |
| 117 | + LED3 = LED2, |
| 118 | + LED4 = LED1, |
| 119 | + |
| 120 | + //Push buttons |
| 121 | + PB0 = P1_00, // BTN1 |
| 122 | + PB1 = P0_09, // BTN2 |
| 123 | + BOOT = P1_01, |
| 124 | + WAKE0 = P0_15, // JP15 to select |
| 125 | + WAKE1 = P1_00, // JP8 (BTN1 jumper) to select |
| 126 | + WAKE2 = P0_13, // JP4 to select |
| 127 | + WAKE3 = P2_01, // JP15 to select |
| 128 | + |
| 129 | + // SPI Pins |
| 130 | + SPI0_SCLK = P0_00, |
| 131 | + SPI0_MOSI = P0_01, |
| 132 | + SPI0_MISO = P0_02, |
| 133 | + SPI0_CS0 = P0_03, |
| 134 | + SPI0_CS1 = P1_10, |
| 135 | + SPI0_CS2 = P2_08, |
| 136 | + SPI0_CS3 = P2_09, |
| 137 | + |
| 138 | + SPI1_SCLK = P1_06, |
| 139 | + SPI1_MOSI = P1_07, |
| 140 | + SPI1_MISO = P1_08, |
| 141 | + SPI1_CS0 = P1_09, |
| 142 | + SPI1_CS1 = P2_11, |
| 143 | + SPI1_CS2 = P2_02, |
| 144 | + SPI1_CS3 = P1_10, |
| 145 | + |
| 146 | + SPI2_SCLK = P1_02, |
| 147 | + SPI2_MOSI = P1_03, |
| 148 | + SPI2_MISO = P1_04, |
| 149 | + SPI2_CS0 = P1_05, |
| 150 | + SPI2_CS1 = P0_09, |
| 151 | + SPI2_CS2 = P2_10, |
| 152 | + SPI2_CS3 = P2_07, |
| 153 | + |
| 154 | + // ADC Pins |
| 155 | + ADC_VIN0 = P2_03, |
| 156 | + ADC_VIN1 = P2_04, |
| 157 | + ADC_VIN2 = P2_05, |
| 158 | + ADC_VIN3 = P2_06, |
| 159 | + ADC_VIN4 = P2_07, |
| 160 | + ADC_VIN5 = P2_08, |
| 161 | + ADC_VIN6 = P2_09, |
| 162 | + ADC_VIN7 = P2_10, |
| 163 | + |
| 164 | + // Arduino Headers |
| 165 | + D0 = P0_10, // UART0_TXD |
| 166 | + D1 = P0_11, // UART0_RXD |
| 167 | + D2 = P0_15, // INT_WAKE0 |
| 168 | + D3 = P0_13, // EXT_INT_WAKE2 |
| 169 | + D4 = P0_09, // EXT_SPI2_CS1 |
| 170 | + D5 = P2_01, // INT_WAKE3 or EXT_RTC1_SS1 via JP8 |
| 171 | + D6 = P1_11, // GPIO_27 |
| 172 | + D7 = P0_12, // GPIO_08 or GPIO_12 via JP7 |
| 173 | + |
| 174 | + D8 = P1_12, // GPIO_28 |
| 175 | + D9 = P1_14, // GPIO_30 |
| 176 | + D10 = SPI0_CS2, // P2_08 |
| 177 | + D11 = SPI0_MOSI, // P0_01 |
| 178 | + D12 = SPI0_MISO, // P0_02 |
| 179 | + D13 = SPI0_SCLK, // P0_00 |
| 180 | + I2C_SCL = P0_04, // I2C_SCL |
| 181 | + I2C_SDA = P0_05, // I2C_SDA |
| 182 | + |
| 183 | + A0 = P2_03, // ADC0 |
| 184 | + A1 = P2_04, // EXT_ADC1 |
| 185 | + A2 = P2_05, // EXT_ADC2 |
| 186 | + A3 = P2_06, // ADC3 |
| 187 | + A4 = P2_07, // SPI2_CS3/ADC_VIN4 |
| 188 | + A5 = P2_10, // EXT_GPIO42/ADC_VIN7 |
| 189 | + |
| 190 | + // Not connected |
| 191 | + NC = (int)0xFFFFFFFF |
| 192 | +} PinName; |
| 193 | + |
| 194 | + |
| 195 | +typedef enum { |
| 196 | + PullNone = 0, |
| 197 | + PullDown = 1, |
| 198 | + PullUp = 2, |
| 199 | + PullDefault = PullNone |
| 200 | +} PinMode; |
| 201 | + |
| 202 | +#ifdef __cplusplus |
| 203 | +} |
| 204 | +#endif |
| 205 | + |
| 206 | +#endif |
0 commit comments