|
| 1 | +/* |
| 2 | + * Copyright (c) 2019-2020 SparkFun Electronics |
| 3 | + * SPDX-License-Identifier: MIT |
| 4 | + * |
| 5 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | + * of this software and associated documentation files (the "Software"), to deal |
| 7 | + * in the Software without restriction, including without limitation the rights |
| 8 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 9 | + * copies of the Software, and to permit persons to whom the Software is |
| 10 | + * furnished to do so, subject to the following conditions: |
| 11 | + * |
| 12 | + * The above copyright notice and this permission notice shall be included in |
| 13 | + * all copies or substantial portions of the Software. |
| 14 | + * |
| 15 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 21 | + * SOFTWARE. |
| 22 | + */ |
| 23 | +#ifndef MBED_PINNAMES_H |
| 24 | +#define MBED_PINNAMES_H |
| 25 | + |
| 26 | +#include "am_bsp.h" |
| 27 | +#include "objects_gpio.h" |
| 28 | + |
| 29 | +#ifdef __cplusplus |
| 30 | +extern "C" |
| 31 | +{ |
| 32 | +#endif |
| 33 | + |
| 34 | +#define NC_VAL (int)0xFFFFFFFF |
| 35 | + |
| 36 | +typedef enum |
| 37 | +{ |
| 38 | + // Digital naming |
| 39 | + D0 = 19, |
| 40 | + D1 = 18, |
| 41 | + D2 = 41, |
| 42 | + D3 = 31, |
| 43 | + D4 = 10, |
| 44 | + D5 = 30, |
| 45 | + D6 = 37, |
| 46 | + D7 = 24, |
| 47 | + D8 = 46, |
| 48 | + D9 = 33, |
| 49 | + D10 = 48, |
| 50 | + D11 = 28, |
| 51 | + D12 = 25, //SDA2 |
| 52 | + D13 = 27, //SCL2 |
| 53 | + D14 = 6, |
| 54 | + D15 = 5, |
| 55 | + D16 = 9, //SDA1 |
| 56 | + D17 = 8, //SCL1 |
| 57 | + D18 = 26, |
| 58 | + D19 = 13, |
| 59 | + D20 = 12, |
| 60 | + D21 = 32, |
| 61 | + D22 = 35, |
| 62 | + D23 = 34, |
| 63 | + D24 = 11, |
| 64 | + |
| 65 | + //LoRa reserved pins (internal) |
| 66 | + D36 = 36, //RADIO NSS |
| 67 | + D38 = 38, //RADIO_MOSI |
| 68 | + D39 = 39, //RADIO_BUSY |
| 69 | + D40 = 40, //RADIO_DIO1 |
| 70 | + D42 = 42, //RADIO_CLK |
| 71 | + D43 = 43, //RADIO_MISO |
| 72 | + D44 = 44, //RADIO_nRESET |
| 73 | + D47 = 47, //RADIO_DIO3 |
| 74 | + |
| 75 | + // Analog naming |
| 76 | + A0 = D19, |
| 77 | + A1 = D20, |
| 78 | + A2 = D21, |
| 79 | + A3 = D22, |
| 80 | + A4 = D23, |
| 81 | + A5 = D24, |
| 82 | + A6 = D3, |
| 83 | + A7 = D9, |
| 84 | + |
| 85 | + //BUTTONs |
| 86 | + SW1 = AM_BSP_GPIO_BUTTON0, |
| 87 | + |
| 88 | + // LEDs |
| 89 | + LED_BLUE = AM_BSP_GPIO_LED0, |
| 90 | + |
| 91 | + // mbed original LED naming |
| 92 | + |
| 93 | + LED1 = AM_BSP_GPIO_LED0, |
| 94 | + |
| 95 | + |
| 96 | + // I2C |
| 97 | + I2C_SCL = AM_BSP_QWIIC_I2C_SCL_PIN, |
| 98 | + I2C_SDA = AM_BSP_QWIIC_I2C_SDA_PIN, |
| 99 | + |
| 100 | + // Qwiic |
| 101 | + QWIIC_SCL = I2C_SCL, |
| 102 | + QWIIC_SDA = I2C_SDA, |
| 103 | + |
| 104 | + // SPI |
| 105 | + SPI_CLK = AM_BSP_PRIM_SPI_CLK_PIN, |
| 106 | + SPI_SDO = AM_BSP_PRIM_SPI_SDO_PIN, |
| 107 | + SPI_SDI = AM_BSP_PRIM_SPI_SDI_PIN, |
| 108 | + |
| 109 | + // UART |
| 110 | + SERIAL_TX = AM_BSP_PRIM_UART_TX_PIN, |
| 111 | + SERIAL_RX = AM_BSP_PRIM_UART_RX_PIN, |
| 112 | + USBTX = SERIAL_TX, |
| 113 | + USBRX = SERIAL_RX, |
| 114 | + |
| 115 | + SERIAL1_TX = D1, |
| 116 | + SERIAL1_RX = D0, |
| 117 | + |
| 118 | + // Not connected |
| 119 | + NC = NC_VAL |
| 120 | +} PinName; |
| 121 | + |
| 122 | +#define STDIO_UART_TX USBTX |
| 123 | +#define STDIO_UART_RX USBRX |
| 124 | + |
| 125 | +#ifdef __cplusplus |
| 126 | +} |
| 127 | +#endif |
| 128 | + |
| 129 | +#endif |
0 commit comments