Skip to content

Commit 05bc2a0

Browse files
committed
Shorten feather names and add nrf sense variant
1 parent 0757478 commit 05bc2a0

File tree

3 files changed

+307
-2
lines changed

3 files changed

+307
-2
lines changed

boards.txt

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ menu.debug=Debug
2222
# ----------------------------------
2323
# Bluefruit Feather nRF52832
2424
# ----------------------------------
25-
feather52832.name=Adafruit Bluefruit Feather nRF52832
25+
feather52832.name=Adafruit Feather nRF52832
2626
feather52832.bootloader.tool=bootburn
2727

2828
# Upload
@@ -62,7 +62,7 @@ feather52832.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
6262
# ----------------------------------
6363
# Bluefruit Feather nRF52840 Express
6464
# ----------------------------------
65-
feather52840.name=Adafruit Bluefruit Feather nRF52840 Express
65+
feather52840.name=Adafruit Feather nRF52840 Express
6666

6767
# VID/PID for bootloader with/without UF2, Arduino + Circuitpython App
6868
feather52840.vid.0=0x239A
@@ -113,6 +113,60 @@ feather52840.menu.debug.l3=Level 3 (Segger SystemView)
113113
feather52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
114114

115115

116+
# ----------------------------------
117+
# Bluefruit Feather nRF52840 sense
118+
# ----------------------------------
119+
feather52840sense.name=Adafruit Feather nRF52840 Sense
120+
121+
# VID/PID for bootloader with/without UF2, Arduino + Circuitpython App
122+
feather52840sense.vid.0=0x239A
123+
feather52840sense.pid.0=0x8087
124+
feather52840sense.vid.1=0x239A
125+
feather52840sense.pid.1=0x0087
126+
feather52840sense.vid.2=0x239A
127+
feather52840sense.pid.2=0x0088
128+
feather52840sense.vid.3=0x239A
129+
feather52840sense.pid.3=0x8088
130+
131+
# Upload
132+
feather52840sense.bootloader.tool=bootburn
133+
feather52840sense.upload.tool=nrfutil
134+
feather52840sense.upload.protocol=nrfutil
135+
feather52840sense.upload.use_1200bps_touch=true
136+
feather52840sense.upload.wait_for_upload_port=true
137+
feather52840sense.upload.maximum_size=815104
138+
feather52840sense.upload.maximum_data_size=237568
139+
140+
# Build
141+
feather52840sense.build.mcu=cortex-m4
142+
feather52840sense.build.f_cpu=64000000
143+
feather52840sense.build.board=NRF52840_FEATHER_SENSE
144+
feather52840sense.build.core=nRF5
145+
feather52840sense.build.variant=feather_nrf52840_sense
146+
feather52840sense.build.usb_manufacturer="Adafruit LLC"
147+
feather52840sense.build.usb_product="Feather nRF52840 Sense"
148+
feather52840sense.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
149+
feather52840sense.build.ldscript=nrf52840_s140_v6.ld
150+
feather52840sense.build.vid=0x239A
151+
feather52840sense.build.pid=0x8087
152+
153+
# SofDevice Menu
154+
feather52840sense.menu.softdevice.s140v6=0.3.0 SoftDevice s140 6.1.1
155+
feather52840sense.menu.softdevice.s140v6.build.sd_name=s140
156+
feather52840sense.menu.softdevice.s140v6.build.sd_version=6.1.1
157+
feather52840sense.menu.softdevice.s140v6.build.sd_fwid=0x00B6
158+
159+
# Debug Menu
160+
feather52840sense.menu.debug.l0=Level 0 (Release)
161+
feather52840sense.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0
162+
feather52840sense.menu.debug.l1=Level 1 (Error Message)
163+
feather52840sense.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
164+
feather52840sense.menu.debug.l2=Level 2 (Full Debug)
165+
feather52840sense.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
166+
feather52840sense.menu.debug.l3=Level 3 (Segger SystemView)
167+
feather52840sense.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
168+
169+
116170
# ----------------------------------
117171
# Bluefruit ItsyBitsy nRF52840 Express
118172
# ----------------------------------
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 TX)
30+
24, // D1 is P0.24 (UART RX
31+
10, // D2 is P0.10 (NFC2)
32+
43, // D3 is P1.11 (LED1)
33+
42, // D4 is P1.10 (LED2)
34+
40, // D5 is P1.08
35+
7, // D6 is P0.07
36+
34, // D7 is P1.02 (Button)
37+
16, // D8 is P0.16 (NeoPixel)
38+
26, // D9 is P0.26
39+
27, // D10 is P0.27
40+
6, // D11 is P0.06
41+
8, // D12 is P0.08
42+
41, // D13 is P1.09
43+
44+
// D14 .. D21 (aka A0 .. A7)
45+
4, // D14 is P0.04 (A0)
46+
5, // D15 is P0.05 (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+
29, // D20 is P0.29 (A6, Battery)
52+
31, // D21 is P0.31 (A7, ARef)
53+
54+
// D22 .. D23 (aka I2C pins)
55+
12, // D22 is P0.12 (SDA)
56+
11, // D23 is P0.11 (SCL)
57+
58+
// D24 .. D26 (aka SPI pins)
59+
15, // D24 is P0.15 (SPI MISO)
60+
13, // D25 is P0.13 (SPI MOSI)
61+
14, // D26 is P0.14 (SPI SCK )
62+
63+
// QSPI pins (not exposed via any header / test point)
64+
19, // D27 is P0.19 (QSPI CLK)
65+
20, // D28 is P0.20 (QSPI CS)
66+
17, // D29 is P0.17 (QSPI Data 0)
67+
22, // D30 is P0.22 (QSPI Data 1)
68+
23, // D31 is P0.23 (QSPI Data 2)
69+
21, // D32 is P0.21 (QSPI Data 3)
70+
71+
// The remaining NFC pin
72+
9, // D33 is P0.09 (NFC1, exposed only via test point on bottom of board)
73+
74+
0, // D34 P0.00 is PDM Data
75+
1, // D35 P0.01 is PDM Clock
76+
32, // D36 P1.00 is APDS IRQ
77+
78+
// The remaining pins are not usable:
79+
// The following pins were never listed as they were considered unusable
80+
// 18, // P0.18 is RESET (attached to switch)
81+
//
82+
// The remaining pins are not connected (per schematic)
83+
// 33, // P1.01 is not connected per schematic
84+
// 35, // P1.03 is not connected per schematic
85+
// 36, // P1.04 is not connected per schematic
86+
// 37, // P1.05 is not connected per schematic
87+
// 38, // P1.06 is not connected per schematic
88+
// 39, // P1.07 is not connected per schematic
89+
// 43, // P1.11 is not connected per schematic
90+
// 44, // P1.12 is not connected per schematic
91+
// 45, // P1.13 is not connected per schematic
92+
// 46, // P1.14 is not connected per schematic
93+
};
94+
95+
void initVariant()
96+
{
97+
// LED1 & LED2
98+
pinMode(PIN_LED1, OUTPUT);
99+
ledOff(PIN_LED1);
100+
101+
pinMode(PIN_LED2, OUTPUT);
102+
ledOff(PIN_LED2);
103+
}
104+
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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_SENSE_
20+
#define _VARIANT_FEATHER52840_SENSE_
21+
22+
/** Master clock frequency */
23+
#define VARIANT_MCK (64000000ul)
24+
25+
#define USE_LFRC // Board uses RC for LF
26+
27+
/*----------------------------------------------------------------------------
28+
* Headers
29+
*----------------------------------------------------------------------------*/
30+
31+
#include "WVariant.h"
32+
33+
#ifdef __cplusplus
34+
extern "C"
35+
{
36+
#endif // __cplusplus
37+
38+
// Number of pins defined in PinDescription array
39+
#define PINS_COUNT (37)
40+
#define NUM_DIGITAL_PINS (37)
41+
#define NUM_ANALOG_INPUTS (6) // A6 is used for battery, A7 is analog reference
42+
#define NUM_ANALOG_OUTPUTS (0)
43+
44+
// LEDs
45+
#define PIN_LED1 (3)
46+
#define PIN_LED2 (4)
47+
#define PIN_NEOPIXEL (8)
48+
49+
#define LED_BUILTIN PIN_LED1
50+
#define LED_CONN PIN_LED2
51+
52+
#define LED_RED PIN_LED1
53+
#define LED_BLUE PIN_LED2
54+
55+
#define LED_STATE_ON 1 // State when LED is litted
56+
57+
/*
58+
* Buttons
59+
*/
60+
#define PIN_BUTTON1 (7)
61+
62+
// Microphone
63+
#define PIN_PDM_DIN 34
64+
#define PIN_PDM_CLK 35
65+
#define PIN_PDM_PWR -1 // not used
66+
67+
/*
68+
* Analog pins
69+
*/
70+
#define PIN_A0 (14)
71+
#define PIN_A1 (15)
72+
#define PIN_A2 (16)
73+
#define PIN_A3 (17)
74+
#define PIN_A4 (18)
75+
#define PIN_A5 (19)
76+
#define PIN_A6 (20)
77+
#define PIN_A7 (21)
78+
79+
static const uint8_t A0 = PIN_A0 ;
80+
static const uint8_t A1 = PIN_A1 ;
81+
static const uint8_t A2 = PIN_A2 ;
82+
static const uint8_t A3 = PIN_A3 ;
83+
static const uint8_t A4 = PIN_A4 ;
84+
static const uint8_t A5 = PIN_A5 ;
85+
static const uint8_t A6 = PIN_A6 ;
86+
static const uint8_t A7 = PIN_A7 ;
87+
#define ADC_RESOLUTION 14
88+
89+
// Other pins
90+
#define PIN_AREF PIN_A7
91+
#define PIN_VBAT PIN_A6
92+
#define PIN_NFC1 (33)
93+
#define PIN_NFC2 (2)
94+
95+
static const uint8_t AREF = PIN_AREF;
96+
97+
/*
98+
* Serial interfaces
99+
*/
100+
#define PIN_SERIAL1_RX (1)
101+
#define PIN_SERIAL1_TX (0)
102+
103+
/*
104+
* SPI Interfaces
105+
*/
106+
#define SPI_INTERFACES_COUNT 1
107+
108+
#define PIN_SPI_MISO (24)
109+
#define PIN_SPI_MOSI (25)
110+
#define PIN_SPI_SCK (26)
111+
112+
static const uint8_t SS = (5);
113+
static const uint8_t MOSI = PIN_SPI_MOSI ;
114+
static const uint8_t MISO = PIN_SPI_MISO ;
115+
static const uint8_t SCK = PIN_SPI_SCK ;
116+
117+
/*
118+
* Wire Interfaces
119+
*/
120+
#define WIRE_INTERFACES_COUNT 1
121+
122+
#define PIN_WIRE_SDA (22)
123+
#define PIN_WIRE_SCL (23)
124+
125+
// QSPI Pins
126+
#define PIN_QSPI_SCK 27
127+
#define PIN_QSPI_CS 28
128+
#define PIN_QSPI_IO0 29
129+
#define PIN_QSPI_IO1 30
130+
#define PIN_QSPI_IO2 31
131+
#define PIN_QSPI_IO3 32
132+
133+
// On-board QSPI Flash
134+
#define EXTERNAL_FLASH_DEVICES GD25Q16C
135+
136+
#define USB_MSC_BLOCK_SIZE 512
137+
#define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE)
138+
139+
#ifdef __cplusplus
140+
}
141+
#endif
142+
143+
/*----------------------------------------------------------------------------
144+
* Arduino objects - C++ only
145+
*----------------------------------------------------------------------------*/
146+
147+
#endif

0 commit comments

Comments
 (0)