t
Fork of mbed-dev by
targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625NEXPAQ/PinNames.h@178:c26431f84b0d, 2017-11-09 (annotated)
- Committer:
- amithy
- Date:
- Thu Nov 09 22:14:37 2017 +0000
- Revision:
- 178:c26431f84b0d
- Parent:
- 150:02e0a0aed4ec
- Child:
- 164:289d4deac6e4
test export
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 150:02e0a0aed4ec | 1 | /******************************************************************************* |
<> | 150:02e0a0aed4ec | 2 | * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. |
<> | 150:02e0a0aed4ec | 3 | * |
<> | 150:02e0a0aed4ec | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
<> | 150:02e0a0aed4ec | 5 | * copy of this software and associated documentation files (the "Software"), |
<> | 150:02e0a0aed4ec | 6 | * to deal in the Software without restriction, including without limitation |
<> | 150:02e0a0aed4ec | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
<> | 150:02e0a0aed4ec | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
<> | 150:02e0a0aed4ec | 9 | * Software is furnished to do so, subject to the following conditions: |
<> | 150:02e0a0aed4ec | 10 | * |
<> | 150:02e0a0aed4ec | 11 | * The above copyright notice and this permission notice shall be included |
<> | 150:02e0a0aed4ec | 12 | * in all copies or substantial portions of the Software. |
<> | 150:02e0a0aed4ec | 13 | * |
<> | 150:02e0a0aed4ec | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
<> | 150:02e0a0aed4ec | 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
<> | 150:02e0a0aed4ec | 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
<> | 150:02e0a0aed4ec | 17 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
<> | 150:02e0a0aed4ec | 18 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
<> | 150:02e0a0aed4ec | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
<> | 150:02e0a0aed4ec | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
<> | 150:02e0a0aed4ec | 21 | * |
<> | 150:02e0a0aed4ec | 22 | * Except as contained in this notice, the name of Maxim Integrated |
<> | 150:02e0a0aed4ec | 23 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
<> | 150:02e0a0aed4ec | 24 | * Products, Inc. Branding Policy. |
<> | 150:02e0a0aed4ec | 25 | * |
<> | 150:02e0a0aed4ec | 26 | * The mere transfer of this software does not imply any licenses |
<> | 150:02e0a0aed4ec | 27 | * of trade secrets, proprietary technology, copyrights, patents, |
<> | 150:02e0a0aed4ec | 28 | * trademarks, maskwork rights, or any other form of intellectual |
<> | 150:02e0a0aed4ec | 29 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
<> | 150:02e0a0aed4ec | 30 | * ownership rights. |
<> | 150:02e0a0aed4ec | 31 | ******************************************************************************* |
<> | 150:02e0a0aed4ec | 32 | */ |
<> | 150:02e0a0aed4ec | 33 | |
<> | 150:02e0a0aed4ec | 34 | #ifndef MBED_PINNAMES_H |
<> | 150:02e0a0aed4ec | 35 | #define MBED_PINNAMES_H |
<> | 150:02e0a0aed4ec | 36 | |
<> | 150:02e0a0aed4ec | 37 | #include "cmsis.h" |
<> | 150:02e0a0aed4ec | 38 | #include "gpio_regs.h" |
<> | 150:02e0a0aed4ec | 39 | |
<> | 150:02e0a0aed4ec | 40 | #ifdef __cplusplus |
<> | 150:02e0a0aed4ec | 41 | extern "C" { |
<> | 150:02e0a0aed4ec | 42 | #endif |
<> | 150:02e0a0aed4ec | 43 | |
<> | 150:02e0a0aed4ec | 44 | typedef enum { |
<> | 150:02e0a0aed4ec | 45 | PIN_INPUT = 0, /* MXC_V_GPIO_OUT_MODE_HIGH_Z,*/ |
<> | 150:02e0a0aed4ec | 46 | PIN_OUTPUT = 1 /* MXC_V_GPIO_OUT_MODE_NORMAL_DRIVE */ |
<> | 150:02e0a0aed4ec | 47 | } PinDirection; |
<> | 150:02e0a0aed4ec | 48 | |
<> | 150:02e0a0aed4ec | 49 | #define PORT_SHIFT 12 |
<> | 150:02e0a0aed4ec | 50 | #define PINNAME_TO_PORT(name) ((unsigned int)(name) >> PORT_SHIFT) |
<> | 150:02e0a0aed4ec | 51 | #define PINNAME_TO_PIN(name) ((unsigned int)(name) & ~(0xFFFFFFFF << PORT_SHIFT)) |
<> | 150:02e0a0aed4ec | 52 | |
<> | 150:02e0a0aed4ec | 53 | #define NOT_CONNECTED (int)0xFFFFFFFF |
<> | 150:02e0a0aed4ec | 54 | |
<> | 150:02e0a0aed4ec | 55 | typedef enum { |
<> | 150:02e0a0aed4ec | 56 | P0_0 = (0 << PORT_SHIFT), P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, |
<> | 150:02e0a0aed4ec | 57 | P1_0 = (1 << PORT_SHIFT), P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, |
<> | 150:02e0a0aed4ec | 58 | P2_0 = (2 << PORT_SHIFT), P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7, |
<> | 150:02e0a0aed4ec | 59 | P3_0 = (3 << PORT_SHIFT), P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7, |
<> | 150:02e0a0aed4ec | 60 | P4_0 = (4 << PORT_SHIFT), P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7, |
<> | 150:02e0a0aed4ec | 61 | |
<> | 150:02e0a0aed4ec | 62 | // Analog input pins |
<> | 150:02e0a0aed4ec | 63 | AIN_0 = (0xA << PORT_SHIFT), AIN_1, AIN_2, AIN_3, AIN_4, AIN_5, |
<> | 150:02e0a0aed4ec | 64 | |
<> | 150:02e0a0aed4ec | 65 | // LEDs |
<> | 150:02e0a0aed4ec | 66 | LED1 = P2_4, |
<> | 150:02e0a0aed4ec | 67 | LED2 = P2_5, |
<> | 150:02e0a0aed4ec | 68 | LED3 = P2_6, |
<> | 150:02e0a0aed4ec | 69 | LED4 = P2_7, |
<> | 150:02e0a0aed4ec | 70 | LED_RED = LED1, |
<> | 150:02e0a0aed4ec | 71 | LED_GREEN = LED2, |
<> | 150:02e0a0aed4ec | 72 | LED_BLUE = LED3, |
<> | 150:02e0a0aed4ec | 73 | |
<> | 150:02e0a0aed4ec | 74 | // Push button |
<> | 150:02e0a0aed4ec | 75 | SW1 = P4_2, |
<> | 150:02e0a0aed4ec | 76 | SW2 = P4_3, |
<> | 150:02e0a0aed4ec | 77 | SW3 = P4_4, |
<> | 150:02e0a0aed4ec | 78 | |
<> | 150:02e0a0aed4ec | 79 | // USB bridge connected UART pins |
<> | 150:02e0a0aed4ec | 80 | USBTX = P2_1, |
<> | 150:02e0a0aed4ec | 81 | USBRX = P2_0, |
<> | 150:02e0a0aed4ec | 82 | STDIO_UART_TX = USBTX, |
<> | 150:02e0a0aed4ec | 83 | STDIO_UART_RX = USBRX, |
<> | 150:02e0a0aed4ec | 84 | |
<> | 150:02e0a0aed4ec | 85 | // I2C pins |
<> | 150:02e0a0aed4ec | 86 | I2C0_SCL = P1_7, |
<> | 150:02e0a0aed4ec | 87 | I2C0_SDA = P1_6, |
<> | 150:02e0a0aed4ec | 88 | |
<> | 150:02e0a0aed4ec | 89 | I2C1_SCL = P3_5, |
<> | 150:02e0a0aed4ec | 90 | I2C1_SDA = P3_4, |
<> | 150:02e0a0aed4ec | 91 | |
<> | 150:02e0a0aed4ec | 92 | // UART pins |
<> | 150:02e0a0aed4ec | 93 | UART0_RX = P0_0, |
<> | 150:02e0a0aed4ec | 94 | UART0_TX = P0_1, |
<> | 150:02e0a0aed4ec | 95 | UART0_CTS = P0_2, |
<> | 150:02e0a0aed4ec | 96 | UART0_RTS = P0_3, |
<> | 150:02e0a0aed4ec | 97 | |
<> | 150:02e0a0aed4ec | 98 | UART1_RX = P2_0, |
<> | 150:02e0a0aed4ec | 99 | UART1_TX = P2_1, |
<> | 150:02e0a0aed4ec | 100 | UART1_CTS = P2_2, |
<> | 150:02e0a0aed4ec | 101 | UART1_RTS = P2_3, |
<> | 150:02e0a0aed4ec | 102 | |
<> | 150:02e0a0aed4ec | 103 | UART2_RX = P3_0, |
<> | 150:02e0a0aed4ec | 104 | UART2_TX = P3_1, |
<> | 150:02e0a0aed4ec | 105 | UART2_CTS = P3_2, |
<> | 150:02e0a0aed4ec | 106 | UART2_RTS = P3_3, |
<> | 150:02e0a0aed4ec | 107 | |
<> | 150:02e0a0aed4ec | 108 | // SPI pins |
<> | 150:02e0a0aed4ec | 109 | SPI0_SCK = P0_4, |
<> | 150:02e0a0aed4ec | 110 | SPI0_MOSI = P0_5, |
<> | 150:02e0a0aed4ec | 111 | SPI0_MISO = P0_6, |
<> | 150:02e0a0aed4ec | 112 | SPI0_SS = P0_7, |
<> | 150:02e0a0aed4ec | 113 | |
<> | 150:02e0a0aed4ec | 114 | SPI1_SCK = P1_0, |
<> | 150:02e0a0aed4ec | 115 | SPI1_MOSI = P1_1, |
<> | 150:02e0a0aed4ec | 116 | SPI1_MISO = P1_2, |
<> | 150:02e0a0aed4ec | 117 | SPI1_SS = P1_3, |
<> | 150:02e0a0aed4ec | 118 | |
<> | 150:02e0a0aed4ec | 119 | SPI2_SCK = P2_4, |
<> | 150:02e0a0aed4ec | 120 | SPI2_MOSI = P2_5, |
<> | 150:02e0a0aed4ec | 121 | SPI2_MISO = P2_6, |
<> | 150:02e0a0aed4ec | 122 | SPI2_SS = P2_7, |
<> | 150:02e0a0aed4ec | 123 | |
<> | 150:02e0a0aed4ec | 124 | // Not connected |
<> | 150:02e0a0aed4ec | 125 | NC = NOT_CONNECTED |
<> | 150:02e0a0aed4ec | 126 | } PinName; |
<> | 150:02e0a0aed4ec | 127 | |
<> | 150:02e0a0aed4ec | 128 | typedef enum { |
<> | 150:02e0a0aed4ec | 129 | PullUp, |
<> | 150:02e0a0aed4ec | 130 | PullDown, |
<> | 150:02e0a0aed4ec | 131 | OpenDrain, |
<> | 150:02e0a0aed4ec | 132 | PullNone, |
<> | 150:02e0a0aed4ec | 133 | PullDefault = PullUp |
<> | 150:02e0a0aed4ec | 134 | } PinMode; |
<> | 150:02e0a0aed4ec | 135 | |
<> | 150:02e0a0aed4ec | 136 | typedef enum { |
<> | 150:02e0a0aed4ec | 137 | LED_ON = 0, |
<> | 150:02e0a0aed4ec | 138 | LED_OFF = 1 |
<> | 150:02e0a0aed4ec | 139 | } LedStates; |
<> | 150:02e0a0aed4ec | 140 | |
<> | 150:02e0a0aed4ec | 141 | #ifdef __cplusplus |
<> | 150:02e0a0aed4ec | 142 | } |
<> | 150:02e0a0aed4ec | 143 | #endif |
<> | 150:02e0a0aed4ec | 144 | |
<> | 150:02e0a0aed4ec | 145 | #endif |