|
| 1 | + /* |
| 2 | + Copyright (c) 2014-2015 Arduino LLC. All right reserved. |
| 3 | + Copyright (c) 2016 Sandeep Mistry All right reserved. |
| 4 | + Copyright (c) 2018, Adafruit Industries (adafruit.com) |
| 5 | +
|
| 6 | + This library is free software; you can redistribute it and/or |
| 7 | + modify it under the terms of the GNU Lesser General Public |
| 8 | + License as published by the Free Software Foundation; either |
| 9 | + version 2.1 of the License, or (at your option) any later version. |
| 10 | + This library is distributed in the hope that it will be useful, |
| 11 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | + See the GNU Lesser General Public License for more details. |
| 14 | + You should have received a copy of the GNU Lesser General Public |
| 15 | + License along with this library; if not, write to the Free Software |
| 16 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | +*/ |
| 18 | + |
| 19 | +#ifndef _VARIANT_OMNIMO_NRF52840_ |
| 20 | +#define _VARIANT_OMNIMO_NRF52840_ |
| 21 | + |
| 22 | +/** Master clock frequency */ |
| 23 | +#define VARIANT_MCK (64000000ul) |
| 24 | + |
| 25 | +#define USE_LFXO // Board uses 32khz crystal for LF |
| 26 | +// define USE_LFRC // Board uses RC for LF |
| 27 | + |
| 28 | +/*---------------------------------------------------------------------------- |
| 29 | + * Headers |
| 30 | + *----------------------------------------------------------------------------*/ |
| 31 | + |
| 32 | +#include "WVariant.h" |
| 33 | + |
| 34 | +#ifdef __cplusplus |
| 35 | +extern "C" |
| 36 | +{ |
| 37 | +#endif // __cplusplus |
| 38 | + |
| 39 | +// Number of pins defined in PinDescription array |
| 40 | +#define PINS_COUNT (44) |
| 41 | +#define NUM_DIGITAL_PINS (44) |
| 42 | +#define NUM_ANALOG_INPUTS (8) // A6 is used for battery voltage monitoring |
| 43 | +#define NUM_ANALOG_OUTPUTS (0) |
| 44 | + |
| 45 | +// LEDs ///////////////////// |
| 46 | +#define PIN_LED1 (3) |
| 47 | +#define PIN_LED2 (4) |
| 48 | +#define PIN_NEOPIXEL (8) |
| 49 | +#define NEOPIXEL_NUM 1 |
| 50 | +// Redefine |
| 51 | +#define LED1 PIN_LED1 |
| 52 | +#define LED2 PIN_LED2 |
| 53 | + |
| 54 | +#define LED_BUILTIN PIN_LED1 |
| 55 | +#define LED_CONN PIN_LED2 |
| 56 | + |
| 57 | +#define LED_GREEN PIN_LED1 |
| 58 | +#define LED_RED PIN_LED1 // for compatibility with Feather nRF52840 Express |
| 59 | +#define LED_BLUE PIN_LED2 |
| 60 | + |
| 61 | +#define LED_STATE_ON 1 // State when LED is litted |
| 62 | + |
| 63 | +// Buttons ////////////////// |
| 64 | +#define PIN_BUTTON1 (7) |
| 65 | +#define PIN_BTN1 (7) |
| 66 | +#define PIN_BUTTON2 (37) |
| 67 | +#define PIN_BTN2 (37) |
| 68 | +// Redefine |
| 69 | +#define BTN1 PIN_BTN1 |
| 70 | +#define BTN2 PIN_BTN2 |
| 71 | + |
| 72 | +// Analog Pins ////////////// |
| 73 | +#define PIN_A0 (14) |
| 74 | +#define PIN_A1 (15) |
| 75 | +#define PIN_A2 (16) |
| 76 | +#define PIN_A3 (17) |
| 77 | +#define PIN_A4 (18) |
| 78 | +#define PIN_A5 (19) |
| 79 | +#define PIN_A6 (20) |
| 80 | +#define PIN_A7 (21) // mikroBUS AN |
| 81 | + |
| 82 | +static const uint8_t A0 = PIN_A0 ; |
| 83 | +static const uint8_t A1 = PIN_A1 ; |
| 84 | +static const uint8_t A2 = PIN_A2 ; |
| 85 | +static const uint8_t A3 = PIN_A3 ; |
| 86 | +static const uint8_t A4 = PIN_A4 ; |
| 87 | +static const uint8_t A5 = PIN_A5 ; |
| 88 | +static const uint8_t A6 = PIN_A6 ; |
| 89 | +static const uint8_t A7 = PIN_A7 ; |
| 90 | + |
| 91 | +#define PIN_VBAT PIN_A6 |
| 92 | + |
| 93 | +#define ADC_RESOLUTION 14 |
| 94 | + |
| 95 | +// NFC Pins ///////////////// |
| 96 | +#define PIN_NFC1 (33) |
| 97 | +#define PIN_NFC2 (34) |
| 98 | +// Redefine |
| 99 | +#define NFC1 PIN_NFC1 |
| 100 | +#define NFC2 PIN_NFC2 |
| 101 | + |
| 102 | +// Feather UART Pins //////// |
| 103 | +#define PIN_SERIAL1_RX (1) |
| 104 | +#define PIN_SERIAL1_TX (0) |
| 105 | +// Redefine |
| 106 | +#define PIN_FEATHER_RX PIN_SERIAL1_RX |
| 107 | +#define PIN_FEATHER_TX PIN_SERIAL1_TX |
| 108 | + |
| 109 | +// Feather SPI Interface //// |
| 110 | +#define SPI_INTERFACES_COUNT 1 |
| 111 | + |
| 112 | +#define PIN_SPI_MISO (24) |
| 113 | +#define PIN_SPI_MOSI (25) |
| 114 | +#define PIN_SPI_SCK (26) |
| 115 | +// Redefine |
| 116 | +#define PIN_FEATHER_MISO PIN_SPI_MISO |
| 117 | +#define PIN_FEATHER_MOSI PIN_SPI_MOSI |
| 118 | +#define PIN_FEATHER_SCK PIN_SPI_SCK |
| 119 | + |
| 120 | +static const uint8_t SS = (5); |
| 121 | +static const uint8_t MOSI = PIN_SPI_MOSI ; |
| 122 | +static const uint8_t MISO = PIN_SPI_MISO ; |
| 123 | +static const uint8_t SCK = PIN_SPI_SCK ; |
| 124 | + |
| 125 | +// Feather I2C Interface //// |
| 126 | +#define WIRE_INTERFACES_COUNT 2 |
| 127 | + |
| 128 | +#define PIN_WIRE_SDA (22) |
| 129 | +#define PIN_WIRE_SCL (23) |
| 130 | +// Redefine |
| 131 | +#define PIN_FEATHER_SDA PIN_WIRE_SDA |
| 132 | +#define PIN_FEATHER_SCL PIN_WIRE_SCL |
| 133 | + |
| 134 | +// mikroBUS Pins //////////// |
| 135 | +#define PIN_mikroBUS_PWM (10) |
| 136 | +#define PIN_mikroBUS_INT (9) |
| 137 | +#define PIN_mikroBUS_RX (6) |
| 138 | +#define PIN_mikroBUS_TX (5) |
| 139 | +#define PIN_mikroBUS_SCL (23) |
| 140 | +#define PIN_mikroBUS_SDA (22) |
| 141 | + |
| 142 | +#define PIN_mikroBUS_AN (21) |
| 143 | +#define PIN_mikroBUS_RST (25) |
| 144 | +#define PIN_mikroBUS_CS (24) |
| 145 | +#define PIN_mikroBUS_SCK (1) |
| 146 | +#define PIN_mikroBUS_MISO (0) |
| 147 | +#define PIN_mikroBUS_MOSI (2) |
| 148 | + |
| 149 | +// Redefine |
| 150 | +#define mikroBUS_PWM PIN_mikroBUS_PWM |
| 151 | +#define mikroBUS_INT PIN_mikroBUS_INT |
| 152 | +#define mikroBUS_RX PIN_mikroBUS_RX |
| 153 | +#define mikroBUS_TX PIN_mikroBUS_TX |
| 154 | +#define mikroBUS_SCL PIN_mikroBUS_SCL |
| 155 | +#define mikroBUS_SDA PIN_mikroBUS_SDA |
| 156 | + |
| 157 | +#define mikroBUS_AN PIN_mikroBUS_AN |
| 158 | +#define mikroBUS_RST PIN_mikroBUS_RST |
| 159 | +#define mikroBUS_CS PIN_mikroBUS_CS |
| 160 | +#define mikroBUS_SCK PIN_mikroBUS_SCK |
| 161 | +#define mikroBUS_MISO PIN_mikroBUS_MISO |
| 162 | +#define mikroBUS_MOSI PIN_mikroBUS_MOSI |
| 163 | + |
| 164 | +// PMOD Pins //////////////// |
| 165 | +#define PIN_PMOD1 (17) |
| 166 | +#define PIN_PMOD2 (16) |
| 167 | +#define PIN_PMOD3 (15) |
| 168 | +#define PIN_PMOD4 (14) |
| 169 | +#define PIN_PMOD5 (39) |
| 170 | +#define PIN_PMOD6 (40) |
| 171 | +#define PIN_PMOD7 (41) |
| 172 | +#define PIN_PMOD8 (42) |
| 173 | +// Redefine |
| 174 | +#define PMOD1 PIN_PMOD1 |
| 175 | +#define PMOD2 PIN_PMOD2 |
| 176 | +#define PMOD3 PIN_PMOD3 |
| 177 | +#define PMOD4 PIN_PMOD4 |
| 178 | +#define PMOD5 PIN_PMOD5 |
| 179 | +#define PMOD6 PIN_PMOD6 |
| 180 | +#define PMOD7 PIN_PMOD7 |
| 181 | +#define PMOD8 PIN_PMOD8 |
| 182 | + |
| 183 | +// Qwiic Pins /////////////// |
| 184 | +#define PIN_QWIIC_SCL (35) |
| 185 | +#define PIN_QWIIC_SDA (36) |
| 186 | +// Redefine |
| 187 | +#define QWIIC_SCL PIN_QWIIC_SCL |
| 188 | +#define QWIIC_SDA PIN_QWIIC_SDA |
| 189 | + |
| 190 | +// QSPI Pins //////////////// |
| 191 | +#define PIN_QSPI_SCK 27 |
| 192 | +#define PIN_QSPI_CS 28 |
| 193 | +#define PIN_QSPI_IO0 29 |
| 194 | +#define PIN_QSPI_IO1 30 |
| 195 | +#define PIN_QSPI_IO2 31 |
| 196 | +#define PIN_QSPI_IO3 32 |
| 197 | + |
| 198 | +// On-board QSPI Flash ////// |
| 199 | +#define EXTERNAL_FLASH_DEVICES GD25Q16C |
| 200 | +#define EXTERNAL_FLASH_USE_QSPI |
| 201 | + |
| 202 | +#ifdef __cplusplus |
| 203 | +} |
| 204 | +#endif |
| 205 | + |
| 206 | +/*---------------------------------------------------------------------------- |
| 207 | + * Arduino objects - C++ only |
| 208 | + *----------------------------------------------------------------------------*/ |
| 209 | + |
| 210 | +#endif |
0 commit comments