|
| 1 | +/* |
| 2 | + * The MIT License (MIT) |
| 3 | + * |
| 4 | + * Copyright (c) 2018 Ha Thach for Adafruit Industries |
| 5 | + * |
| 6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | + * of this software and associated documentation files (the "Software"), to deal |
| 8 | + * in the Software without restriction, including without limitation the rights |
| 9 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | + * copies of the Software, and to permit persons to whom the Software is |
| 11 | + * furnished to do so, subject to the following conditions: |
| 12 | + * |
| 13 | + * The above copyright notice and this permission notice shall be included in |
| 14 | + * all copies or substantial portions of the Software. |
| 15 | + * |
| 16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 | + * THE SOFTWARE. |
| 23 | + */ |
| 24 | + |
| 25 | +#ifndef _ARCARDE_FEATHER_NRF52840_H |
| 26 | +#define _ARCARDE_FEATHER_NRF52840_H |
| 27 | + |
| 28 | +#define _PINNUM(port, pin) ((port)*32 + (pin)) |
| 29 | + |
| 30 | +/*------------------------------------------------------------------*/ |
| 31 | +/* LED |
| 32 | + *------------------------------------------------------------------*/ |
| 33 | +#define LEDS_NUMBER 2 |
| 34 | +#define LED_PRIMARY_PIN _PINNUM(1, 15) |
| 35 | +#define LED_SECONDARY_PIN _PINNUM(1, 10) |
| 36 | +#define LED_STATE_ON 1 |
| 37 | + |
| 38 | +#define LED_NEOPIXEL _PINNUM(0, 16) |
| 39 | +#define NEOPIXELS_NUMBER 1 |
| 40 | +#define BOARD_RGB_BRIGHTNESS 0x040404 |
| 41 | + |
| 42 | +/*------------------------------------------------------------------*/ |
| 43 | +/* BUTTON |
| 44 | + *------------------------------------------------------------------*/ |
| 45 | +#define BUTTONS_NUMBER 2 |
| 46 | +#define BUTTON_1 _PINNUM(1, 02) |
| 47 | +#define BUTTON_2 _PINNUM(0, 10) |
| 48 | +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP |
| 49 | + |
| 50 | +/*------------------------------------------------------------------*/ |
| 51 | +/* UART (only used by nRF52832) |
| 52 | + *------------------------------------------------------------------*/ |
| 53 | +#define RX_PIN_NUMBER 8 |
| 54 | +#define TX_PIN_NUMBER 6 |
| 55 | +#define CTS_PIN_NUMBER 0 |
| 56 | +#define RTS_PIN_NUMBER 0 |
| 57 | +#define HWFC false |
| 58 | + |
| 59 | +//--------------------------------------------------------------------+ |
| 60 | +// BLE OTA |
| 61 | +//--------------------------------------------------------------------+ |
| 62 | +#define BLEDIS_MANUFACTURER "Adafruit Industries" |
| 63 | +#define BLEDIS_MODEL "Feather nRF52840 Express" |
| 64 | + |
| 65 | +//--------------------------------------------------------------------+ |
| 66 | +// USB |
| 67 | +//--------------------------------------------------------------------+ |
| 68 | +#define USB_DESC_VID 0x239A |
| 69 | +#define USB_DESC_UF2_PID 0x0029 |
| 70 | +#define USB_DESC_CDC_ONLY_PID 0x002A |
| 71 | + |
| 72 | +//------------- UF2 -------------// |
| 73 | +#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express" |
| 74 | +#define UF2_VOLUME_LABEL "ARCADE-N4" |
| 75 | +#define UF2_BOARD_ID "nRF52840-Feather-revD" |
| 76 | +#define UF2_INDEX_URL "https://www.adafruit.com/product/4062" |
| 77 | + |
| 78 | +#define BOOTLOADER_CONFIG_CF2 \ |
| 79 | + /* CF2 START */ \ |
| 80 | + 513675505, 539130489, /* magic */ \ |
| 81 | + 49 , 100 , /* used entries, total entries */ \ |
| 82 | + 4 , 0x18 , /* PIN_BTN_A = PIN_RX */ \ |
| 83 | + 5 , 0xa , /* PIN_BTN_B = PIN_D2 */ \ |
| 84 | + 13 , 0x29 , /* PIN_LED = PIN_D13 */ \ |
| 85 | + 18 , 0xf , /* PIN_MISO = PA15 */ \ |
| 86 | + 19 , 0xd , /* PIN_MOSI = PA13 */ \ |
| 87 | + 20 , 0x23 , /* PIN_NEOPIXEL = PB03 */ \ |
| 88 | + 21 , 0x18 , /* PIN_RX = PA24 */ \ |
| 89 | + 23 , 0xe , /* PIN_SCK = PA14 */ \ |
| 90 | + 24 , 0xb , /* PIN_SCL = PA11 */ \ |
| 91 | + 25 , 0xc , /* PIN_SDA = PA12 */ \ |
| 92 | + 28 , 0x19 , /* PIN_TX = PA25 */ \ |
| 93 | + 32 , 0xe , /* PIN_DISPLAY_SCK = PIN_SCK */ \ |
| 94 | + 34 , 0xd , /* PIN_DISPLAY_MOSI = PIN_MOSI */ \ |
| 95 | + 35 , 0x1e , /* PIN_DISPLAY_CS = PIN_A2 */ \ |
| 96 | + 36 , 0x1c , /* PIN_DISPLAY_DC = PIN_A3 */ \ |
| 97 | + 37 , 0xa0 , /* DISPLAY_WIDTH = 160 */ \ |
| 98 | + 38 , 0x80 , /* DISPLAY_HEIGHT = 128 */ \ |
| 99 | + 39 , 0x80 , /* DISPLAY_CFG0 = 0x80 */ \ |
| 100 | + 40 , 0x603 , /* DISPLAY_CFG1 = 0x603 */ \ |
| 101 | + 41 , 0x20 , /* DISPLAY_CFG2 = 0x20 */ \ |
| 102 | + 43 , 0x2 , /* PIN_DISPLAY_RST = PIN_A4 */ \ |
| 103 | + 44 , 0x3 , /* PIN_DISPLAY_BL = PIN_A5 */ \ |
| 104 | + 47 , 0x6 , /* PIN_BTN_LEFT = PIN_D11 */ \ |
| 105 | + 48 , 0x1a , /* PIN_BTN_RIGHT = PIN_D9 */ \ |
| 106 | + 49 , 0x1b , /* PIN_BTN_UP = PIN_D10 */ \ |
| 107 | + 50 , 0x7 , /* PIN_BTN_DOWN = PIN_D6 */ \ |
| 108 | + 51 , 0x8 , /* PIN_BTN_MENU = PIN_D12 */ \ |
| 109 | + 56 , 0x2a , /* PIN_LED2 = PB10 */ \ |
| 110 | + 60 , 0x19 , /* PIN_JACK_TX = PIN_TX */ \ |
| 111 | + 100, 0x4 , /* PIN_A0 = PA04 */ \ |
| 112 | + 101, 0x5 , /* PIN_A1 = PA05 */ \ |
| 113 | + 102, 0x1e , /* PIN_A2 = PA30 */ \ |
| 114 | + 103, 0x1c , /* PIN_A3 = PA28 */ \ |
| 115 | + 104, 0x2 , /* PIN_A4 = PA02 */ \ |
| 116 | + 105, 0x3 , /* PIN_A5 = PA03 */ \ |
| 117 | + 152, 0xa , /* PIN_D2 = PA10 */ \ |
| 118 | + 155, 0x28 , /* PIN_D5 = PB08 */ \ |
| 119 | + 156, 0x7 , /* PIN_D6 = PA07 */ \ |
| 120 | + 159, 0x1a , /* PIN_D9 = PA26 */ \ |
| 121 | + 160, 0x1b , /* PIN_D10 = PA27 */ \ |
| 122 | + 161, 0x6 , /* PIN_D11 = PA06 */ \ |
| 123 | + 162, 0x8 , /* PIN_D12 = PA08 */ \ |
| 124 | + 163, 0x29 , /* PIN_D13 = PB09 */ \ |
| 125 | + 200, 0x1 , /* NUM_NEOPIXELS = 1 */ \ |
| 126 | + 204, 0x100000 , /* FLASH_BYTES = 0x100000 */ \ |
| 127 | + 205, 0x40000 , /* RAM_BYTES = 0x40000 */ \ |
| 128 | + 208, 0xd7688ea1, /* BOOTLOADER_BOARD_ID = 0xd7688ea1 */ \ |
| 129 | + 209, 0xada52840, /* UF2_FAMILY = 0xada52840 */ \ |
| 130 | + 210, 0x20 , /* PINS_PORT_SIZE = PA_32 */ \ |
| 131 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
| 132 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
| 133 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
| 134 | + 0, 0, 0, 0, 0, 0 \ |
| 135 | + /* CF2 END */ |
| 136 | + |
| 137 | + |
| 138 | +#endif // _ARCARDE_FEATHER_NRF52840_H |
| 139 | + |
0 commit comments