Skip to content

Commit e47aafb

Browse files
author
Ladyada
committed
rev A design - tested!
1 parent f67f7b7 commit e47aafb

File tree

3 files changed

+296
-0
lines changed

3 files changed

+296
-0
lines changed

boards.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,60 @@ feather52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
112112
feather52840.menu.debug.l3=Level 3 (Segger SystemView)
113113
feather52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
114114

115+
116+
# ----------------------------------
117+
# Bluefruit ItsyBitsy nRF52840 Express
118+
# ----------------------------------
119+
itsybitsy52840.name=Adafruit ItsyBitsy nRF52840 Express
120+
121+
# VID/PID for bootloader with/without UF2, Arduino + Circuitpython App
122+
itsybitsy52840.vid.0=0x239A
123+
itsybitsy52840.pid.0=0x8051
124+
itsybitsy52840.vid.1=0x239A
125+
itsybitsy52840.pid.1=0x0051
126+
itsybitsy52840.vid.2=0x239A
127+
itsybitsy52840.pid.2=0x0052
128+
itsybitsy52840.vid.3=0x239A
129+
itsybitsy52840.pid.3=0x8052
130+
131+
# Upload
132+
itsybitsy52840.bootloader.tool=bootburn
133+
itsybitsy52840.upload.tool=nrfutil
134+
itsybitsy52840.upload.protocol=nrfutil
135+
itsybitsy52840.upload.use_1200bps_touch=true
136+
itsybitsy52840.upload.wait_for_upload_port=true
137+
itsybitsy52840.upload.maximum_size=815104
138+
itsybitsy52840.upload.maximum_data_size=248832
139+
140+
# Build
141+
itsybitsy52840.build.mcu=cortex-m4
142+
itsybitsy52840.build.f_cpu=64000000
143+
itsybitsy52840.build.board=NRF52840_ITSYBITSY
144+
itsybitsy52840.build.core=nRF5
145+
itsybitsy52840.build.variant=itsybitsy_nrf52840_express
146+
itsybitsy52840.build.usb_manufacturer="Adafruit LLC"
147+
itsybitsy52840.build.usb_product="ItsyBitsy nRF52840 Express"
148+
itsybitsy52840.build.extra_flags=-DNRF52840_XXAA -DARDUINO_NRF52_ITSYBITSY {build.flags.usb}
149+
itsybitsy52840.build.ldscript=nrf52840_s140_v6.ld
150+
itsybitsy52840.build.vid=0x239A
151+
itsybitsy52840.build.pid=0x8051
152+
153+
# SofDevice Menu
154+
itsybitsy52840.menu.softdevice.s140v6=0.2.11 SoftDevice s140 6.1.1
155+
itsybitsy52840.menu.softdevice.s140v6.build.sd_name=s140
156+
itsybitsy52840.menu.softdevice.s140v6.build.sd_version=6.1.1
157+
itsybitsy52840.menu.softdevice.s140v6.build.sd_fwid=0x00B6
158+
159+
# Debug Menu
160+
itsybitsy52840.menu.debug.l0=Level 0 (Release)
161+
itsybitsy52840.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0
162+
itsybitsy52840.menu.debug.l1=Level 1 (Error Message)
163+
itsybitsy52840.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
164+
itsybitsy52840.menu.debug.l2=Level 2 (Full Debug)
165+
itsybitsy52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
166+
itsybitsy52840.menu.debug.l3=Level 3 (Segger SystemView)
167+
itsybitsy52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
168+
115169
# ----------------------------------
116170
# Bluefruit Metro nRF52840 Express
117171
# ----------------------------------
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
See the GNU Lesser General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public
17+
License along with this library; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
*/
20+
21+
#include "variant.h"
22+
#include "wiring_constants.h"
23+
#include "wiring_digital.h"
24+
#include "nrf.h"
25+
26+
const uint32_t g_ADigitalPinMap[] =
27+
{
28+
// D0 .. D13
29+
25, // D0 is P0.25 (UART RX)
30+
24, // D1 is P0.24 (UART TX)
31+
34, // D2 is P1.02
32+
6, // D3 is P0.06 LED
33+
29, // D4 is P0.29 Button
34+
40, // D5 is P1.08
35+
41, // D6 is P1.09 (DotStar Clock)
36+
7, // D7 is P0.07
37+
8, // D8 is P0.08 (DotStar Data)
38+
5, // D9 is P0.05
39+
26, // D10 is P0.26
40+
27, // D11 is P0.27
41+
11, // D12 is P0.11
42+
12, // D13 is P0.12
43+
44+
// D14 .. D20 (aka A0 .. A7)
45+
4, // D14 is P0.04 (A0)
46+
31, // D15 is P0.31 (A1)
47+
30, // D16 is P0.30 (A2)
48+
28, // D17 is P0.28 (A3)
49+
2, // D18 is P0.02 (A4)
50+
3, // D19 is P0.03 (A5)
51+
52+
// Extra Analog pin #20
53+
5, // D20 is P0.05 (A6/A9)
54+
55+
// D21 .. D22 (aka I2C pins)
56+
16, // D21 is P0.16 (SDA)
57+
14, // D22 is P0.14 (SCL)
58+
59+
// D23 .. D25 (aka SPI pins)
60+
20, // D23 is P0.20 (SPI MISO)
61+
15, // D24 is P0.15 (SPI MOSI)
62+
13, // D25 is P0.13 (SPI SCK )
63+
64+
// QSPI pins (not exposed via any header / test point)
65+
19, // D26 is P0.19 (QSPI CLK)
66+
23, // D27 is P0.23 (QSPI CS)
67+
21, // D28 is P0.21 (QSPI Data 0)
68+
22, // D29 is P0.22 (QSPI Data 1)
69+
32, // D30 is P1.00 (QSPI Data 2)
70+
17, // D31 is P0.17 (QSPI Data 3)
71+
72+
// Thus, there are 32 defined pins
73+
74+
// The remaining pins are not usable:
75+
//
76+
//
77+
// The following pins were never listed as they were considered unusable
78+
// 0, // P0.00 is XL1 (attached to 32.768kHz crystal)
79+
// 1, // P0.01 is XL2 (attached to 32.768kHz crystal)
80+
// 18, // P0.18 is RESET (attached to switch)
81+
//
82+
// The remaining pins are not connected (per schematic)
83+
// 9, // P0.09 is not connected per schematic
84+
// 10, // P0.10 is not connected per schematic
85+
// 33, // P1.01 is not connected per schematic
86+
// 35, // P1.03 is not connected per schematic
87+
// 36, // P1.04 is not connected per schematic
88+
// 37, // P1.05 is not connected per schematic
89+
// 38, // P1.06 is not connected per schematic
90+
// 39, // P1.07 is not connected per schematic
91+
// 43, // P1.11 is not connected per schematic
92+
// 44, // P1.12 is not connected per schematic
93+
// 45, // P1.13 is not connected per schematic
94+
// 46, // P1.14 is not connected per schematic
95+
// 47, // P1.15 is not connected per schematic
96+
};
97+
98+
void initVariant()
99+
{
100+
// LED1 & LED2
101+
pinMode(PIN_LED1, OUTPUT);
102+
ledOff(PIN_LED1);
103+
}
104+
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
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_FEATHER52840_
20+
#define _VARIANT_FEATHER52840_
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 (32)
41+
#define NUM_DIGITAL_PINS (32)
42+
#define NUM_ANALOG_INPUTS (7)
43+
#define NUM_ANALOG_OUTPUTS (0)
44+
45+
// LEDs
46+
#define PIN_LED1 (3)
47+
#define PIN_DOTSTAR_DATA (8)
48+
#define PIN_DOTSTAR_CLOCK (6)
49+
50+
#define LED_BUILTIN PIN_LED1
51+
#define LED_CONN PIN_LED1
52+
53+
#define LED_RED PIN_LED1
54+
55+
#define LED_STATE_ON 1 // State when LED is litted
56+
57+
// Buttons
58+
#define PIN_BUTTON1 (4)
59+
/*
60+
#define PIN_BUTTON2 (3)
61+
#define PIN_BUTTON3 (4)
62+
#define PIN_BUTTON4 (5)
63+
*/
64+
65+
/*
66+
* Analog pins
67+
*/
68+
#define PIN_A0 (14)
69+
#define PIN_A1 (15)
70+
#define PIN_A2 (16)
71+
#define PIN_A3 (17)
72+
#define PIN_A4 (18)
73+
#define PIN_A5 (19)
74+
#define PIN_A6 (20)
75+
76+
static const uint8_t A0 = PIN_A0 ;
77+
static const uint8_t A1 = PIN_A1 ;
78+
static const uint8_t A2 = PIN_A2 ;
79+
static const uint8_t A3 = PIN_A3 ;
80+
static const uint8_t A4 = PIN_A4 ;
81+
static const uint8_t A5 = PIN_A5 ;
82+
static const uint8_t A6 = PIN_A6 ;
83+
#define ADC_RESOLUTION 14
84+
85+
//static const uint8_t AREF = PIN_AREF;
86+
87+
/*
88+
* Serial interfaces
89+
*/
90+
// Serial
91+
#define PIN_SERIAL_RX (1)
92+
#define PIN_SERIAL_TX (0)
93+
94+
/*
95+
* SPI Interfaces
96+
*/
97+
#define SPI_INTERFACES_COUNT 1
98+
99+
#define PIN_SPI_MISO (23)
100+
#define PIN_SPI_MOSI (24)
101+
#define PIN_SPI_SCK (25)
102+
103+
static const uint8_t SS = (5);
104+
static const uint8_t MOSI = PIN_SPI_MOSI ;
105+
static const uint8_t MISO = PIN_SPI_MISO ;
106+
static const uint8_t SCK = PIN_SPI_SCK ;
107+
108+
/*
109+
* Wire Interfaces
110+
*/
111+
#define WIRE_INTERFACES_COUNT 1
112+
113+
#define PIN_WIRE_SDA (21)
114+
#define PIN_WIRE_SCL (22)
115+
116+
// QSPI Pins
117+
#define PIN_QSPI_SCK 26
118+
#define PIN_QSPI_CS 27
119+
#define PIN_QSPI_IO0 28
120+
#define PIN_QSPI_IO1 29
121+
#define PIN_QSPI_IO2 30
122+
#define PIN_QSPI_IO3 31
123+
124+
// On-board QSPI Flash
125+
#define EXTERNAL_FLASH_DEVICES GD25Q16C
126+
127+
#define USB_MSC_BLOCK_SIZE 512
128+
#define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE)
129+
130+
#ifdef __cplusplus
131+
}
132+
#endif
133+
134+
/*----------------------------------------------------------------------------
135+
* Arduino objects - C++ only
136+
*----------------------------------------------------------------------------*/
137+
138+
#endif

0 commit comments

Comments
 (0)