|
| 1 | +/******************************************************************************* |
| 2 | + * Copyright (C) 2022 Maxim Integrated Products, Inc., All Rights Reserved. |
| 3 | + * |
| 4 | + * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | + * copy of this software and associated documentation files (the "Software"), |
| 6 | + * to deal in the Software without restriction, including without limitation |
| 7 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | + * and/or sell copies of the Software, and to permit persons to whom the |
| 9 | + * Software is furnished to do so, subject to the following conditions: |
| 10 | + * |
| 11 | + * The above copyright notice and this permission notice shall be included |
| 12 | + * in all copies or substantial portions of the Software. |
| 13 | + * |
| 14 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 15 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 16 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 17 | + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
| 18 | + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 | + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 | + * OTHER DEALINGS IN THE SOFTWARE. |
| 21 | + * |
| 22 | + * Except as contained in this notice, the name of Maxim Integrated |
| 23 | + * Products, Inc. shall not be used except as stated in the Maxim Integrated |
| 24 | + * Products, Inc. Branding Policy. |
| 25 | + * |
| 26 | + * The mere transfer of this software does not imply any licenses |
| 27 | + * of trade secrets, proprietary technology, copyrights, patents, |
| 28 | + * trademarks, maskwork rights, or any other form of intellectual |
| 29 | + * property whatsoever. Maxim Integrated Products, Inc. retains all |
| 30 | + * ownership rights. |
| 31 | + ******************************************************************************* |
| 32 | + */ |
| 33 | + |
| 34 | +/* MBED TARGET LIST: MAX32670EVKIT */ |
| 35 | + |
| 36 | +#ifndef MBED_PINNAMES_H |
| 37 | +#define MBED_PINNAMES_H |
| 38 | + |
| 39 | +#include "cmsis.h" |
| 40 | +#include "gpio_regs.h" |
| 41 | + |
| 42 | +#ifdef __cplusplus |
| 43 | +extern "C" { |
| 44 | +#endif |
| 45 | + |
| 46 | +typedef enum { |
| 47 | + PIN_INPUT = 0, |
| 48 | + PIN_OUTPUT = 1 |
| 49 | +} PinDirection; |
| 50 | + |
| 51 | +#define PORT_SHIFT 12 |
| 52 | + |
| 53 | +#define PINNAME_TO_PORT(name) ((unsigned int)(name) >> PORT_SHIFT) |
| 54 | +#define PINNAME_TO_PIN(name) ((unsigned int)(name) & ~(0xFFFFFFFF << PORT_SHIFT)) |
| 55 | +#define NOT_CONNECTED (int)0xFFFFFFFF |
| 56 | + |
| 57 | +typedef enum { |
| 58 | + // Port 0 |
| 59 | + P0_0 = (0 << PORT_SHIFT), |
| 60 | + P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, P0_8, P0_9, P0_10, P0_11, P0_12, P0_13, P0_14, P0_15, |
| 61 | + P0_16, P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23,P0_24, P0_25, P0_26, P0_27, P0_28, P0_29, P0_30, P0_31, |
| 62 | + |
| 63 | + // Port 1 |
| 64 | + P1_0 = (1 << PORT_SHIFT), |
| 65 | + P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15, |
| 66 | + P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23,P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31, |
| 67 | + |
| 68 | + // USB bridge connected UART pins |
| 69 | +#if defined(MBED_CONF_TARGET_STDIO_UART_TX) |
| 70 | + CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX, |
| 71 | +#else |
| 72 | + CONSOLE_TX = P0_29, |
| 73 | +#endif // MBED_CONF_TARGET_STDIO_UART_TX |
| 74 | + |
| 75 | +#if defined(MBED_CONF_TARGET_STDIO_UART_RX) |
| 76 | + CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX, |
| 77 | +#else |
| 78 | + CONSOLE_RX = P0_28, |
| 79 | +#endif // MBED_CONF_TARGET_STDIO_UART_RX |
| 80 | + |
| 81 | + STDIO_UART_TX = CONSOLE_TX, |
| 82 | + STDIO_UART_RX = CONSOLE_RX, |
| 83 | + |
| 84 | +// ----- Start of xDot external pin definitions ----- |
| 85 | + WAKE = P0_19, |
| 86 | + GPIO0 = P0_30, |
| 87 | + GPIO1 = P0_27, |
| 88 | + GPIO2 = P0_26, |
| 89 | + GPIO3 = P0_25, |
| 90 | + |
| 91 | + // AT command port UART |
| 92 | + UART_RX = P0_8, |
| 93 | + UART_TX = P0_9, |
| 94 | + UART_CTS = P0_10, |
| 95 | + UART_RTS = P0_11, |
| 96 | + |
| 97 | + UART0_RX = UART_RX, |
| 98 | + UART0_TX = UART_TX, |
| 99 | + UART0_CTS = UART_CTS, |
| 100 | + UART0_RTS = UART_RTS, |
| 101 | + |
| 102 | + // debug UART |
| 103 | + UART1_RX = P0_28, |
| 104 | + UART1_TX = P0_29, |
| 105 | + |
| 106 | + // SwD |
| 107 | + SWDIO = P0_0, |
| 108 | + SWCLK = P0_1, |
| 109 | + |
| 110 | + // I2C |
| 111 | + I2C1_SCL = P0_12, |
| 112 | + I2C1_SDA = P0_13, |
| 113 | + |
| 114 | + // SPI |
| 115 | + SPI0_SCK = P0_4, |
| 116 | + SPI0_MOSI = P0_3, |
| 117 | + SPI0_MISO = P0_2, |
| 118 | + SPI0_SS = P0_5, |
| 119 | +// ----- End of xDot external pin definitions ----- |
| 120 | + |
| 121 | +// ----- Start of xDot dedicated internal pins. ----- |
| 122 | + MEM_PWR_EN = P0_24, // Power to EEPROM, Flash & Secure element |
| 123 | + FLASH_CS = P0_23, |
| 124 | + |
| 125 | + // EEPROM and SE I2C |
| 126 | + I2C0_SCL = P0_6, |
| 127 | + I2C0_SDA = P0_7, |
| 128 | + SE_SDA = I2C0_SDA, |
| 129 | + SE_SCL = I2C0_SCL, |
| 130 | + |
| 131 | + // SX1262 |
| 132 | + SPI1_SCK = P0_16, |
| 133 | + SPI1_MOSI = P0_15, |
| 134 | + SPI1_MISO = P0_14, |
| 135 | + SPI1_SS = P0_17, |
| 136 | + LORA_MISO = SPI1_MISO, |
| 137 | + LORA_MOSI = SPI1_MOSI, |
| 138 | + LORA_SCK = SPI1_SCK, |
| 139 | + LORA_NSS = SPI1_SS, |
| 140 | + |
| 141 | + LORA_RESET = P0_20, |
| 142 | + LORA_BUSY = P0_21, |
| 143 | + LORA_DIO1 = P0_22, |
| 144 | + |
| 145 | + RF_SW_CTRL = P0_18, // RF switch, active high |
| 146 | +// ----- End of xDot dedicated internal pins. ----- |
| 147 | + |
| 148 | +// ----- Start of aliases for MAX32670 serial_api.c ----- |
| 149 | +// The xDot does not use these serial UARTs or the serial_api |
| 150 | +// code. These pins are used on the xDot as detailed above. |
| 151 | + UART0B_RX = P0_24, |
| 152 | + UART0B_TX = P0_25, |
| 153 | + |
| 154 | + UART1B_RX = P0_2, |
| 155 | + UART1B_TX = P0_3, |
| 156 | + |
| 157 | + UART2B_RX = P0_14, |
| 158 | + UART2B_TX = P0_15, |
| 159 | +// ----- end of aliases for MAX32670 serial_api.c ----- |
| 160 | + |
| 161 | + // Not connected |
| 162 | + NC = NOT_CONNECTED |
| 163 | +} PinName; |
| 164 | + |
| 165 | +#define LED1 P0_30 |
| 166 | +#define I2C_SCL I2C1_SCL |
| 167 | +#define I2C_SDA I2C1_SDA |
| 168 | +#define SPI_MISO SPI0_MISO |
| 169 | +#define SPI_MOSI SPI0_MOSI |
| 170 | +#define SPI_SCK SPI0_SCK |
| 171 | +#define SPI_NSS SPI0_SS |
| 172 | + |
| 173 | +typedef enum { |
| 174 | + PullNone = 0, |
| 175 | + PullUp = 1, |
| 176 | + PullDown = 2, |
| 177 | + PullDefault = PullUp |
| 178 | +} PinMode; |
| 179 | + |
| 180 | +typedef enum { |
| 181 | + LED_ON = 0, |
| 182 | + LED_OFF = 1 |
| 183 | +} LedStates; |
| 184 | + |
| 185 | +#ifdef __cplusplus |
| 186 | +} |
| 187 | +#endif |
| 188 | + |
| 189 | +#endif |
0 commit comments