Skip to content

Commit 5e7c152

Browse files
committed
add feather sense tft variant definition
1 parent 5e284a1 commit 5e7c152

File tree

6 files changed

+325
-2
lines changed

6 files changed

+325
-2
lines changed

.github/workflows/githubci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- 'feather52832'
2020
- 'feather52840'
2121
- 'feather52840sense'
22+
- 'feather_nrf52840_sense_tft'
2223
- 'itsybitsy52840'
2324
- 'ledglasses_nrf52840'
2425

@@ -29,7 +30,7 @@ jobs:
2930
python-version: '3.x'
3031

3132
- name: Checkout code
32-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3334
with:
3435
submodules: 'true'
3536

boards.txt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,69 @@ feather52840sense.menu.debug_output.serial1.build.logger_flags=-DCFG_LOGGER=1 -D
182182
feather52840sense.menu.debug_output.rtt=Segger RTT
183183
feather52840sense.menu.debug_output.rtt.build.logger_flags=-DCFG_LOGGER=2 -DCFG_TUSB_DEBUG=CFG_DEBUG -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
184184

185+
# -----------------------------------
186+
# Adafruit Feather nRF52840 Sense TFT
187+
# -----------------------------------
188+
feather_nrf52840_sense_tft.name=Adafruit Feather nRF52840 Sense TFT
189+
190+
# VID/PID for Bootloader, Arduino & CircuitPython
191+
feather_nrf52840_sense_tft.vid.0=0x239A
192+
feather_nrf52840_sense_tft.pid.0=0x8087
193+
feather_nrf52840_sense_tft.vid.1=0x239A
194+
feather_nrf52840_sense_tft.pid.1=0x0087
195+
feather_nrf52840_sense_tft.vid.2=0x239A
196+
feather_nrf52840_sense_tft.pid.2=0x0088
197+
feather_nrf52840_sense_tft.vid.3=0x239A
198+
feather_nrf52840_sense_tft.pid.3=0x8088
199+
200+
# Upload
201+
feather_nrf52840_sense_tft.bootloader.tool=bootburn
202+
feather_nrf52840_sense_tft.upload.tool=nrfutil
203+
feather_nrf52840_sense_tft.upload.protocol=nrfutil
204+
feather_nrf52840_sense_tft.upload.use_1200bps_touch=true
205+
feather_nrf52840_sense_tft.upload.wait_for_upload_port=true
206+
feather_nrf52840_sense_tft.upload.maximum_size=815104
207+
feather_nrf52840_sense_tft.upload.maximum_data_size=237568
208+
209+
# Build
210+
feather_nrf52840_sense_tft.build.mcu=cortex-m4
211+
feather_nrf52840_sense_tft.build.f_cpu=64000000
212+
feather_nrf52840_sense_tft.build.board=NRF52840_FEATHER_SENSE_TFT
213+
feather_nrf52840_sense_tft.build.core=nRF5
214+
feather_nrf52840_sense_tft.build.variant=feather_nrf52840_sense_tft
215+
feather_nrf52840_sense_tft.build.usb_manufacturer="Adafruit"
216+
feather_nrf52840_sense_tft.build.usb_product="Feather nRF52840 Sense TFT"
217+
feather_nrf52840_sense_tft.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
218+
feather_nrf52840_sense_tft.build.ldscript=nrf52840_s140_v6.ld
219+
feather_nrf52840_sense_tft.build.openocdscript=scripts/openocd/daplink_nrf52.cfg
220+
feather_nrf52840_sense_tft.build.vid=0x239A
221+
feather_nrf52840_sense_tft.build.pid=0x8087
222+
223+
# Menu: SoftDevice
224+
feather_nrf52840_sense_tft.menu.softdevice.s140v6=S140 6.1.1
225+
feather_nrf52840_sense_tft.menu.softdevice.s140v6.build.sd_name=s140
226+
feather_nrf52840_sense_tft.menu.softdevice.s140v6.build.sd_version=6.1.1
227+
feather_nrf52840_sense_tft.menu.softdevice.s140v6.build.sd_fwid=0x00B6
228+
229+
# Menu: Debug Level
230+
feather_nrf52840_sense_tft.menu.debug.l0=Level 0 (Release)
231+
feather_nrf52840_sense_tft.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0
232+
feather_nrf52840_sense_tft.menu.debug.l1=Level 1 (Error Message)
233+
feather_nrf52840_sense_tft.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
234+
feather_nrf52840_sense_tft.menu.debug.l2=Level 2 (Full Debug)
235+
feather_nrf52840_sense_tft.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
236+
feather_nrf52840_sense_tft.menu.debug.l3=Level 3 (Segger SystemView)
237+
feather_nrf52840_sense_tft.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
238+
feather_nrf52840_sense_tft.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
239+
240+
# Menu: Debug Port
241+
feather_nrf52840_sense_tft.menu.debug_output.serial=Serial
242+
feather_nrf52840_sense_tft.menu.debug_output.serial.build.logger_flags=-DCFG_LOGGER=0
243+
feather_nrf52840_sense_tft.menu.debug_output.serial1=Serial1
244+
feather_nrf52840_sense_tft.menu.debug_output.serial1.build.logger_flags=-DCFG_LOGGER=1 -DCFG_TUSB_DEBUG=CFG_DEBUG
245+
feather_nrf52840_sense_tft.menu.debug_output.rtt=Segger RTT
246+
feather_nrf52840_sense_tft.menu.debug_output.rtt.build.logger_flags=-DCFG_LOGGER=2 -DCFG_TUSB_DEBUG=CFG_DEBUG -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
247+
185248
# -----------------------------------
186249
# Adafruit ItsyBitsy nRF52840 Express
187250
# -----------------------------------

tools/makeboards.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ def make_board(name, variant, vendor_name, product_name, boarddefine, vid, pid_l
145145
["feather52840sense", "feather_nrf52840_sense", "Adafruit", "Feather nRF52840 Sense", "NRF52840_FEATHER_SENSE",
146146
"0x239A", ["0x8087", "0x0087", "0x0088", "0x8088"]],
147147

148+
["feather_nrf52840_sense_tft", "feather_nrf52840_sense_tft", "Adafruit", "Feather nRF52840 Sense TFT", "NRF52840_FEATHER_SENSE_TFT",
149+
"0x239A", ["0x8087", "0x0087", "0x0088", "0x8088"]], # TODO shared VID with sense for now
150+
148151
["itsybitsy52840", "itsybitsy_nrf52840_express", "Adafruit", "ItsyBitsy nRF52840 Express", "NRF52840_ITSYBITSY -DARDUINO_NRF52_ITSYBITSY",
149152
"0x239A", ["0x8051", "0x0051", "0x0052", "0x8052"]],
150153

variants/feather_nrf52840_sense/variant.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ extern "C"
5858
/*
5959
* Buttons
6060
*/
61-
#define PIN_BUTTON1 (7)
61+
#define PIN_BUTTON1 (7)
6262

6363
// Microphone
6464
#define PIN_PDM_DIN 34
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+
#define PINNUM(port, pin) ((port)*32 + (pin))
27+
28+
const uint32_t g_ADigitalPinMap[] = {
29+
// D0 .. D13
30+
PINNUM(1, 11), // D0 is P1.11 (UART TX)
31+
PINNUM(1, 13), // D1 is P1.13 (UART RX)
32+
PINNUM(1, 10), // D2 is P1.10 (DFU)
33+
PINNUM(1, 6), // D3 is P1.06 (Button)
34+
PINNUM(0, 6), // D4 is P0.06 (LSM6DS3 IRQ)
35+
PINNUM(0, 20), // D5 is P0.20
36+
PINNUM(0, 16), // D6 is P0.16
37+
PINNUM(1, 2), // D7 is P1.02 (Neopixel Power)
38+
PINNUM(1, 8), // D8 is P1.08 (NeoPixel)
39+
PINNUM(0, 15), // D9 is P0.15
40+
PINNUM(0, 13), // D10 is P0.13
41+
PINNUM(0, 14), // D11 is P0.14
42+
PINNUM(0, 12), // D12 is P0.12
43+
PINNUM(0, 11), // D13 is P0.11 (LED1)
44+
45+
// D14 .. D20 (aka A0 .. A6)
46+
PINNUM(0, 3), // D14 is P0.03 (A0)
47+
PINNUM(0, 2), // D15 is P0.02 (A1)
48+
PINNUM(0, 28), // D16 is P0.28 (A2)
49+
PINNUM(0, 30), // D17 is P0.30 (A3)
50+
PINNUM(0, 31), // D18 is P0.31 (A4)
51+
PINNUM(0, 29), // D19 is P0.29 (A5)
52+
PINNUM(0, 4), // D20 is P0.04 (A6, Battery)
53+
54+
PINNUM(1, 7), // D21 is P1.07 (Sensor Power)
55+
56+
// D22 .. D23 (aka I2C pins)
57+
PINNUM(0, 25), // D22 is P0.25 (SDA)
58+
PINNUM(0, 24), // D23 is P0.24 (SCL)
59+
60+
// D24 .. D26 (aka SPI pins)
61+
PINNUM(0, 7), // D24 is P0.07 (SPI MISO)
62+
PINNUM(0, 5), // D25 is P0.05 (SPI MOSI)
63+
PINNUM(0, 26), // D26 is P0.26 (SPI SCK )
64+
65+
// D27 .. D32 QSPI pins (not exposed via any header / test point)
66+
PINNUM(0, 19), // D27 is P0.19 (QSPI CLK)
67+
PINNUM(0, 23), // D28 is P0.23 (QSPI CS)
68+
PINNUM(0, 21), // D29 is P0.21 (QSPI Data 0)
69+
PINNUM(0, 22), // D30 is P0.22 (QSPI Data 1)
70+
PINNUM(1, 0), // D31 is P1.00 (QSPI Data 2)
71+
PINNUM(0, 17), // D32 is P0.17 (QSPI Data 3)
72+
73+
// D33 .. D34 PDM pins
74+
PINNUM(0, 8), // D33 P0.08 is PDM Data
75+
PINNUM(1, 9), // D34 P1.09 is PDM Clock
76+
77+
// D35 .. D38 TFT
78+
PINNUM(1, 5), // D35 P1.05 is TFT CS
79+
PINNUM(1, 1), // D36 P1.01 is TFT DC
80+
PINNUM(1, 3), // D37 P1.03 is TFT Reset
81+
PINNUM(0, 27), // D38 P0.27 is TFT Backlight
82+
83+
// D39 .. D40 NFC
84+
PINNUM(0, 9), // D39 is P0.09 (NFC1)
85+
PINNUM(0, 10), // D40 is P0.10 (NFC2)
86+
};
87+
88+
void initVariant()
89+
{
90+
// power off LED, neopixel, sensor, tft backlight
91+
pinMode(PIN_LED1, OUTPUT);
92+
pinMode(PIN_NEOPIXEL_POWER, OUTPUT);
93+
pinMode(PIN_SENSOR_POWER, OUTPUT);
94+
pinMode(PIN_TFT_LITE, OUTPUT);
95+
96+
ledOff(PIN_LED1);
97+
digitalWrite(PIN_NEOPIXEL_POWER, LOW);
98+
digitalWrite(PIN_SENSOR_POWER, LOW);
99+
digitalWrite(PIN_TFT_LITE, LOW);
100+
}
101+
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
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_CLUE52840_
20+
#define _VARIANT_CLUE52840_
21+
22+
/** Master clock frequency */
23+
#define VARIANT_MCK (64000000ul)
24+
#define USE_LFXO // Board uses 32khz crystal for LF
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 (47)
40+
#define NUM_DIGITAL_PINS (47)
41+
#define NUM_ANALOG_INPUTS (6) // A6 is for battery
42+
#define NUM_ANALOG_OUTPUTS (0)
43+
44+
// LEDs
45+
#define PIN_LED1 (13)
46+
#define PIN_NEOPIXEL_POWER (7)
47+
#define PIN_NEOPIXEL (8)
48+
#define NEOPIXEL_NUM 1
49+
50+
#define LED_BUILTIN PIN_LED1
51+
#define LED_RED PIN_LED1
52+
#define LED_BLUE PIN_LED1
53+
54+
#define LED_STATE_ON 1 // State when LED is litted
55+
56+
// Buttons
57+
#define PIN_BUTTON1 (3)
58+
59+
/*
60+
* Analog pins
61+
*/
62+
#define PIN_A0 (14)
63+
#define PIN_A1 (15)
64+
#define PIN_A2 (16)
65+
#define PIN_A3 (17)
66+
#define PIN_A4 (18)
67+
#define PIN_A5 (19)
68+
#define PIN_A6 (20)
69+
#define PIN_A7 (0xff) // to compile with Firmata library
70+
71+
static const uint8_t A0 = PIN_A0 ;
72+
static const uint8_t A1 = PIN_A1 ;
73+
static const uint8_t A2 = PIN_A2 ;
74+
static const uint8_t A3 = PIN_A3 ;
75+
static const uint8_t A4 = PIN_A4 ;
76+
static const uint8_t A5 = PIN_A5 ;
77+
static const uint8_t A6 = PIN_A6 ;
78+
static const uint8_t A7 = PIN_A7 ;
79+
#define ADC_RESOLUTION 14
80+
81+
#define PIN_VBAT PIN_A6
82+
83+
/*
84+
* Serial interfaces
85+
*/
86+
#define PIN_SERIAL1_RX (0)
87+
#define PIN_SERIAL1_TX (1)
88+
89+
/*
90+
* SPI Interfaces
91+
*/
92+
#define SPI_INTERFACES_COUNT 1
93+
94+
// nRF52840 has only one SPIM3 runing at highspeed 32Mhz
95+
// This assign SPIM3 to either: SPI (0), SPI1 (1).
96+
// If not defined, default to 0 or SPI.
97+
#define SPI_32MHZ_INTERFACE 0
98+
99+
// SPI
100+
#define PIN_SPI_MISO (24)
101+
#define PIN_SPI_MOSI (25)
102+
#define PIN_SPI_SCK (26)
103+
104+
static const uint8_t SS = (5);
105+
static const uint8_t MOSI = PIN_SPI_MOSI ;
106+
static const uint8_t MISO = PIN_SPI_MISO ;
107+
static const uint8_t SCK = PIN_SPI_SCK ;
108+
109+
/*
110+
* Wire Interfaces
111+
*/
112+
#define WIRE_INTERFACES_COUNT 1
113+
114+
#define PIN_WIRE_SDA (22)
115+
#define PIN_WIRE_SCL (23)
116+
117+
// QSPI Pins
118+
#define PIN_QSPI_SCK 27
119+
#define PIN_QSPI_CS 28
120+
#define PIN_QSPI_IO0 29
121+
#define PIN_QSPI_IO1 30
122+
#define PIN_QSPI_IO2 31
123+
#define PIN_QSPI_IO3 32
124+
125+
// On-board QSPI Flash
126+
#define EXTERNAL_FLASH_DEVICES GD25Q16C
127+
#define EXTERNAL_FLASH_USE_QSPI
128+
129+
// Microphone
130+
#define PIN_PDM_DIN 33
131+
#define PIN_PDM_CLK 34
132+
#define PIN_PDM_PWR PIN_SENSOR_POWER
133+
134+
135+
// On-board TFT display
136+
#define PIN_TFT_CS 35
137+
#define PIN_TFT_DC 36
138+
#define PIN_TFT_RST 37
139+
#define PIN_TFT_LITE 38
140+
141+
// Other pins
142+
#define PIN_LSM6DS3_IRQ (4)
143+
#define PIN_SENSOR_POWER (21)
144+
#define PIN_NFC1 (39)
145+
#define PIN_NFC2 (40)
146+
147+
#ifdef __cplusplus
148+
}
149+
#endif
150+
151+
/*----------------------------------------------------------------------------
152+
* Arduino objects - C++ only
153+
*----------------------------------------------------------------------------*/
154+
155+
#endif

0 commit comments

Comments
 (0)