The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_SDT32620B/TOOLCHAIN_IAR/PinNames.h@172:65be27845400, 2019-02-20 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Feb 20 20:53:29 2019 +0000
- Revision:
- 172:65be27845400
- Parent:
- 171:3a7713b1edbc
mbed library release version 165
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AnnaBridge | 171:3a7713b1edbc | 1 | /******************************************************************************* |
AnnaBridge | 171:3a7713b1edbc | 2 | * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. |
AnnaBridge | 171:3a7713b1edbc | 3 | * |
AnnaBridge | 171:3a7713b1edbc | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
AnnaBridge | 171:3a7713b1edbc | 5 | * copy of this software and associated documentation files (the "Software"), |
AnnaBridge | 171:3a7713b1edbc | 6 | * to deal in the Software without restriction, including without limitation |
AnnaBridge | 171:3a7713b1edbc | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
AnnaBridge | 171:3a7713b1edbc | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
AnnaBridge | 171:3a7713b1edbc | 9 | * Software is furnished to do so, subject to the following conditions: |
AnnaBridge | 171:3a7713b1edbc | 10 | * |
AnnaBridge | 171:3a7713b1edbc | 11 | * The above copyright notice and this permission notice shall be included |
AnnaBridge | 171:3a7713b1edbc | 12 | * in all copies or substantial portions of the Software. |
AnnaBridge | 171:3a7713b1edbc | 13 | * |
AnnaBridge | 171:3a7713b1edbc | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
AnnaBridge | 171:3a7713b1edbc | 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
AnnaBridge | 171:3a7713b1edbc | 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
AnnaBridge | 171:3a7713b1edbc | 17 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
AnnaBridge | 171:3a7713b1edbc | 18 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
AnnaBridge | 171:3a7713b1edbc | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
AnnaBridge | 171:3a7713b1edbc | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
AnnaBridge | 171:3a7713b1edbc | 21 | * |
AnnaBridge | 171:3a7713b1edbc | 22 | * Except as contained in this notice, the name of Maxim Integrated |
AnnaBridge | 171:3a7713b1edbc | 23 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
AnnaBridge | 171:3a7713b1edbc | 24 | * Products, Inc. Branding Policy. |
AnnaBridge | 171:3a7713b1edbc | 25 | * |
AnnaBridge | 171:3a7713b1edbc | 26 | * The mere transfer of this software does not imply any licenses |
AnnaBridge | 171:3a7713b1edbc | 27 | * of trade secrets, proprietary technology, copyrights, patents, |
AnnaBridge | 171:3a7713b1edbc | 28 | * trademarks, maskwork rights, or any other form of intellectual |
AnnaBridge | 171:3a7713b1edbc | 29 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
AnnaBridge | 171:3a7713b1edbc | 30 | * ownership rights. |
AnnaBridge | 171:3a7713b1edbc | 31 | ******************************************************************************* |
AnnaBridge | 171:3a7713b1edbc | 32 | */ |
AnnaBridge | 171:3a7713b1edbc | 33 | |
AnnaBridge | 171:3a7713b1edbc | 34 | #ifndef MBED_PINNAMES_H |
AnnaBridge | 171:3a7713b1edbc | 35 | #define MBED_PINNAMES_H |
AnnaBridge | 171:3a7713b1edbc | 36 | |
AnnaBridge | 171:3a7713b1edbc | 37 | #include "cmsis.h" |
AnnaBridge | 171:3a7713b1edbc | 38 | #include "gpio_regs.h" |
AnnaBridge | 171:3a7713b1edbc | 39 | |
AnnaBridge | 171:3a7713b1edbc | 40 | #ifdef __cplusplus |
AnnaBridge | 171:3a7713b1edbc | 41 | extern "C" { |
AnnaBridge | 171:3a7713b1edbc | 42 | #endif |
AnnaBridge | 171:3a7713b1edbc | 43 | |
AnnaBridge | 171:3a7713b1edbc | 44 | typedef enum { |
AnnaBridge | 171:3a7713b1edbc | 45 | PIN_INPUT = MXC_V_GPIO_OUT_MODE_NORMAL_HIGH_Z, |
AnnaBridge | 171:3a7713b1edbc | 46 | PIN_OUTPUT = MXC_V_GPIO_OUT_MODE_NORMAL |
AnnaBridge | 171:3a7713b1edbc | 47 | } PinDirection; |
AnnaBridge | 171:3a7713b1edbc | 48 | |
AnnaBridge | 171:3a7713b1edbc | 49 | #define PORT_SHIFT 12 |
AnnaBridge | 171:3a7713b1edbc | 50 | #define PINNAME_TO_PORT(name) ((unsigned int)(name) >> PORT_SHIFT) |
AnnaBridge | 171:3a7713b1edbc | 51 | #define PINNAME_TO_PIN(name) ((unsigned int)(name) & ~(0xFFFFFFFF << PORT_SHIFT)) |
AnnaBridge | 171:3a7713b1edbc | 52 | |
AnnaBridge | 171:3a7713b1edbc | 53 | #define NOT_CONNECTED (int)0xFFFFFFFF |
AnnaBridge | 171:3a7713b1edbc | 54 | |
AnnaBridge | 171:3a7713b1edbc | 55 | typedef enum { |
AnnaBridge | 171:3a7713b1edbc | 56 | P0_0 = (0 << PORT_SHIFT), P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, |
AnnaBridge | 171:3a7713b1edbc | 57 | P1_0 = (1 << PORT_SHIFT), P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, |
AnnaBridge | 171:3a7713b1edbc | 58 | P2_0 = (2 << PORT_SHIFT), P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7, |
AnnaBridge | 171:3a7713b1edbc | 59 | P3_0 = (3 << PORT_SHIFT), P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7, |
AnnaBridge | 171:3a7713b1edbc | 60 | P4_0 = (4 << PORT_SHIFT), P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7, |
AnnaBridge | 171:3a7713b1edbc | 61 | P5_0 = (5 << PORT_SHIFT), P5_1, P5_2, P5_3, P5_4, P5_5, P5_6, P5_7, |
AnnaBridge | 171:3a7713b1edbc | 62 | P6_0 = (6 << PORT_SHIFT), |
AnnaBridge | 171:3a7713b1edbc | 63 | |
AnnaBridge | 171:3a7713b1edbc | 64 | // Analog input pins |
AnnaBridge | 171:3a7713b1edbc | 65 | AIN_0 = (0xA << PORT_SHIFT), AIN_1, AIN_2, AIN_3, AIN_4, AIN_5, AIN_6, AIN_7, AIN_8, AIN_9, AIN_10, AIN_11, |
AnnaBridge | 171:3a7713b1edbc | 66 | |
AnnaBridge | 171:3a7713b1edbc | 67 | // Analog |
AnnaBridge | 171:3a7713b1edbc | 68 | A0 = AIN_0, |
AnnaBridge | 171:3a7713b1edbc | 69 | A1 = AIN_1, |
AnnaBridge | 171:3a7713b1edbc | 70 | A2 = AIN_2, |
AnnaBridge | 171:3a7713b1edbc | 71 | A3 = AIN_3, |
AnnaBridge | 171:3a7713b1edbc | 72 | |
AnnaBridge | 171:3a7713b1edbc | 73 | // General Pin Input Output (GPIO) |
AnnaBridge | 171:3a7713b1edbc | 74 | GPIO0 = P1_4, |
AnnaBridge | 171:3a7713b1edbc | 75 | GPIO1 = P1_5, |
AnnaBridge | 171:3a7713b1edbc | 76 | GPIO2 = P4_0, |
AnnaBridge | 171:3a7713b1edbc | 77 | GPIO3 = P4_1, |
AnnaBridge | 171:3a7713b1edbc | 78 | GPIO4 = P4_2, |
AnnaBridge | 171:3a7713b1edbc | 79 | GPIO5 = P4_3, |
AnnaBridge | 171:3a7713b1edbc | 80 | GPIO6 = P5_6, |
AnnaBridge | 171:3a7713b1edbc | 81 | |
AnnaBridge | 171:3a7713b1edbc | 82 | //Purse Width Modulation (PWM) |
AnnaBridge | 171:3a7713b1edbc | 83 | PWM0 = GPIO2, |
AnnaBridge | 171:3a7713b1edbc | 84 | PWM1 = GPIO3, |
AnnaBridge | 171:3a7713b1edbc | 85 | PWM2 = GPIO0, |
AnnaBridge | 171:3a7713b1edbc | 86 | PWM3 = GPIO1, |
AnnaBridge | 171:3a7713b1edbc | 87 | |
AnnaBridge | 171:3a7713b1edbc | 88 | // LEDs |
AnnaBridge | 171:3a7713b1edbc | 89 | LED0 = GPIO0, |
AnnaBridge | 171:3a7713b1edbc | 90 | LED1 = GPIO1, |
AnnaBridge | 171:3a7713b1edbc | 91 | LED2 = GPIO2, |
AnnaBridge | 171:3a7713b1edbc | 92 | LED3 = NOT_CONNECTED, |
AnnaBridge | 171:3a7713b1edbc | 93 | LED4 = NOT_CONNECTED, |
AnnaBridge | 171:3a7713b1edbc | 94 | |
AnnaBridge | 171:3a7713b1edbc | 95 | LED_RED = LED0, |
AnnaBridge | 171:3a7713b1edbc | 96 | LED_GREEN = LED1, |
AnnaBridge | 171:3a7713b1edbc | 97 | LED_BLUE = LED2, |
AnnaBridge | 171:3a7713b1edbc | 98 | |
AnnaBridge | 171:3a7713b1edbc | 99 | // USB bridge and SWD UART connected UART pins |
AnnaBridge | 171:3a7713b1edbc | 100 | USBTX = P2_1, |
AnnaBridge | 171:3a7713b1edbc | 101 | USBRX = P2_0, |
AnnaBridge | 171:3a7713b1edbc | 102 | STDIO_UART_TX = USBTX, |
AnnaBridge | 171:3a7713b1edbc | 103 | STDIO_UART_RX = USBRX, |
AnnaBridge | 171:3a7713b1edbc | 104 | |
AnnaBridge | 171:3a7713b1edbc | 105 | // UART pins |
AnnaBridge | 171:3a7713b1edbc | 106 | UART0_RX = P0_0, |
AnnaBridge | 171:3a7713b1edbc | 107 | UART0_TX = P0_1, |
AnnaBridge | 171:3a7713b1edbc | 108 | UART0_CTS = P0_2, |
AnnaBridge | 171:3a7713b1edbc | 109 | UART0_RTS = P0_3, |
AnnaBridge | 171:3a7713b1edbc | 110 | |
AnnaBridge | 171:3a7713b1edbc | 111 | UART1_RX = P2_0, |
AnnaBridge | 171:3a7713b1edbc | 112 | UART1_TX = P2_1, |
AnnaBridge | 171:3a7713b1edbc | 113 | UART1_CTS = P2_2, |
AnnaBridge | 171:3a7713b1edbc | 114 | UART1_RTS = P2_3, |
AnnaBridge | 171:3a7713b1edbc | 115 | |
AnnaBridge | 171:3a7713b1edbc | 116 | UART2_RX = P3_0, |
AnnaBridge | 171:3a7713b1edbc | 117 | UART2_TX = P3_1, |
AnnaBridge | 171:3a7713b1edbc | 118 | UART2_CTS = P3_2, |
AnnaBridge | 171:3a7713b1edbc | 119 | UART2_RTS = P3_3, |
AnnaBridge | 171:3a7713b1edbc | 120 | |
AnnaBridge | 171:3a7713b1edbc | 121 | // I2C pins |
AnnaBridge | 171:3a7713b1edbc | 122 | I2C0_SCL = P1_7, |
AnnaBridge | 171:3a7713b1edbc | 123 | I2C0_SDA = P1_6, |
AnnaBridge | 171:3a7713b1edbc | 124 | |
AnnaBridge | 171:3a7713b1edbc | 125 | I2C1_SCL = P3_5, |
AnnaBridge | 171:3a7713b1edbc | 126 | I2C1_SDA = P3_4, |
AnnaBridge | 171:3a7713b1edbc | 127 | |
AnnaBridge | 171:3a7713b1edbc | 128 | I2C2_SCL = P6_0, |
AnnaBridge | 171:3a7713b1edbc | 129 | I2C2_SDA = P5_7, |
AnnaBridge | 171:3a7713b1edbc | 130 | |
AnnaBridge | 171:3a7713b1edbc | 131 | // SPI pins |
AnnaBridge | 171:3a7713b1edbc | 132 | SPI0_SCK = P0_4, |
AnnaBridge | 171:3a7713b1edbc | 133 | SPI0_MOSI = P0_5, |
AnnaBridge | 171:3a7713b1edbc | 134 | SPI0_MISO = P0_6, |
AnnaBridge | 171:3a7713b1edbc | 135 | SPI0_SS0 = P0_7, |
AnnaBridge | 171:3a7713b1edbc | 136 | SPI0_SS1 = P4_4, |
AnnaBridge | 171:3a7713b1edbc | 137 | SPI0_SS2 = P4_5, |
AnnaBridge | 171:3a7713b1edbc | 138 | |
AnnaBridge | 171:3a7713b1edbc | 139 | SPI1_SCK = P1_0, |
AnnaBridge | 171:3a7713b1edbc | 140 | SPI1_MOSI = P1_1, |
AnnaBridge | 171:3a7713b1edbc | 141 | SPI1_MISO = P1_2, |
AnnaBridge | 171:3a7713b1edbc | 142 | SPI1_SS0 = P1_3, |
AnnaBridge | 171:3a7713b1edbc | 143 | SPI1_SS1 = P3_6, |
AnnaBridge | 171:3a7713b1edbc | 144 | SPI1_SS2 = P3_7, |
AnnaBridge | 171:3a7713b1edbc | 145 | |
AnnaBridge | 171:3a7713b1edbc | 146 | SPI2_SCK = P2_4, |
AnnaBridge | 171:3a7713b1edbc | 147 | SPI2_MOSI = P2_5, |
AnnaBridge | 171:3a7713b1edbc | 148 | SPI2_MISO = P2_6, |
AnnaBridge | 171:3a7713b1edbc | 149 | SPI2_SS0 = P2_7, |
AnnaBridge | 171:3a7713b1edbc | 150 | SPI2_SS1 = P4_6, |
AnnaBridge | 171:3a7713b1edbc | 151 | SPI2_SS2 = P4_7, |
AnnaBridge | 171:3a7713b1edbc | 152 | |
AnnaBridge | 171:3a7713b1edbc | 153 | SPI3_SCK = P5_0, |
AnnaBridge | 171:3a7713b1edbc | 154 | SPI3_MOSI = P5_1, |
AnnaBridge | 171:3a7713b1edbc | 155 | SPI3_MISO = P5_2, |
AnnaBridge | 171:3a7713b1edbc | 156 | SPI3_SS0 = P5_3, |
AnnaBridge | 171:3a7713b1edbc | 157 | SPI3_SS1 = P5_4, |
AnnaBridge | 171:3a7713b1edbc | 158 | SPI3_SS2 = P5_5, |
AnnaBridge | 171:3a7713b1edbc | 159 | |
AnnaBridge | 171:3a7713b1edbc | 160 | // SWD UART |
AnnaBridge | 171:3a7713b1edbc | 161 | SWD_TGT_TX = UART1_TX, |
AnnaBridge | 171:3a7713b1edbc | 162 | SWD_TGT_RX = UART1_RX, |
AnnaBridge | 171:3a7713b1edbc | 163 | SWD_TGT_CTS = UART1_CTS, |
AnnaBridge | 171:3a7713b1edbc | 164 | SWD_TGT_RTS = UART1_RTS, |
AnnaBridge | 171:3a7713b1edbc | 165 | |
AnnaBridge | 171:3a7713b1edbc | 166 | // Generics |
AnnaBridge | 171:3a7713b1edbc | 167 | SERIAL_TX = UART0_TX, |
AnnaBridge | 171:3a7713b1edbc | 168 | SERIAL_RX = UART0_RX, |
AnnaBridge | 171:3a7713b1edbc | 169 | I2C_SCL = I2C0_SCL, |
AnnaBridge | 171:3a7713b1edbc | 170 | I2C_SDA = I2C0_SDA, |
AnnaBridge | 171:3a7713b1edbc | 171 | SPI_MOSI = SPI0_MOSI, |
AnnaBridge | 171:3a7713b1edbc | 172 | SPI_MISO = SPI0_MISO, |
AnnaBridge | 171:3a7713b1edbc | 173 | SPI_SCK = SPI0_SCK, |
AnnaBridge | 171:3a7713b1edbc | 174 | SPI_CS = SPI0_SS0, |
AnnaBridge | 171:3a7713b1edbc | 175 | PWM_OUT = PWM0, |
AnnaBridge | 171:3a7713b1edbc | 176 | |
AnnaBridge | 171:3a7713b1edbc | 177 | // Not connected |
AnnaBridge | 171:3a7713b1edbc | 178 | NC = NOT_CONNECTED |
AnnaBridge | 171:3a7713b1edbc | 179 | } PinName; |
AnnaBridge | 171:3a7713b1edbc | 180 | |
AnnaBridge | 171:3a7713b1edbc | 181 | typedef enum { |
AnnaBridge | 171:3a7713b1edbc | 182 | PullUp, |
AnnaBridge | 171:3a7713b1edbc | 183 | PullDown, |
AnnaBridge | 171:3a7713b1edbc | 184 | OpenDrain, |
AnnaBridge | 171:3a7713b1edbc | 185 | PullNone, |
AnnaBridge | 171:3a7713b1edbc | 186 | PullDefault = PullUp |
AnnaBridge | 171:3a7713b1edbc | 187 | } PinMode; |
AnnaBridge | 171:3a7713b1edbc | 188 | |
AnnaBridge | 171:3a7713b1edbc | 189 | typedef enum { |
AnnaBridge | 171:3a7713b1edbc | 190 | LED_ON = 0, |
AnnaBridge | 171:3a7713b1edbc | 191 | LED_OFF = 1 |
AnnaBridge | 171:3a7713b1edbc | 192 | } LedStates; |
AnnaBridge | 171:3a7713b1edbc | 193 | |
AnnaBridge | 171:3a7713b1edbc | 194 | #ifdef __cplusplus |
AnnaBridge | 171:3a7713b1edbc | 195 | } |
AnnaBridge | 171:3a7713b1edbc | 196 | #endif |
AnnaBridge | 171:3a7713b1edbc | 197 | |
AnnaBridge | 171:3a7713b1edbc | 198 | #endif |