Skip to content

Commit 91b4bdb

Browse files
authored
Adds Challenger RP2040 NFC board (#846)
1 parent d662897 commit 91b4bdb

File tree

6 files changed

+748
-0
lines changed

6 files changed

+748
-0
lines changed

boards.txt

Lines changed: 589 additions & 0 deletions
Large diffs are not rendered by default.

package/package_pico_index.template.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
{
8787
"name": "iLabs Challenger 2040 SD/RTC"
8888
},
89+
{
90+
"name": "iLabs Challenger 2040 NFC"
91+
},
8992
{
9093
"name": "iLabs RPICO32"
9194
},

tools/json/challenger_2040_nfc.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"earlephilhower": {
5+
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
6+
"usb_vid": "0x2E8A",
7+
"usb_pid": "0x1036"
8+
}
9+
},
10+
"core": "earlephilhower",
11+
"cpu": "cortex-m0plus",
12+
"extra_flags": "-D ARDUINO_CHALLENGER_NB_2040_NFC_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
13+
"f_cpu": "133000000L",
14+
"hwids": [
15+
[
16+
"0x2E8A",
17+
"0x00C0"
18+
],
19+
[
20+
"0x2E8A",
21+
"0x1036"
22+
]
23+
],
24+
"mcu": "rp2040",
25+
"variant": "challenger_2040_nfc"
26+
},
27+
"debug": {
28+
"jlink_device": "RP2040_M0_0",
29+
"openocd_target": "rp2040.cfg",
30+
"svd_path": "rp2040.svd"
31+
},
32+
"frameworks": [
33+
"arduino"
34+
],
35+
"name": "Challenger 2040 NFC",
36+
"upload": {
37+
"maximum_ram_size": 270336,
38+
"maximum_size": 8388608,
39+
"require_upload_port": true,
40+
"native_usb": true,
41+
"use_1200bps_touch": true,
42+
"wait_for_upload_port": false,
43+
"protocol": "picotool",
44+
"protocols": [
45+
"cmsis-dap",
46+
"jlink",
47+
"raspberrypi-swd",
48+
"picotool",
49+
"picoprobe"
50+
]
51+
},
52+
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
53+
"vendor": "iLabs"
54+
}

tools/makeboards.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ def MakeBoardJSON(name, vendor_name, product_name, vid, pid, pwr, boarddefine, f
326326
MakeBoard("challenger_2040_wifi_ble", "iLabs", "Challenger 2040 WiFi/BLE", "0x2e8a", "0x102C", 500, "CHALLENGER_2040_WIFI_BLE_RP2040", 8, "boot2_w25q080_2_padded_checksum", ["WIFIESPAT2"])
327327
MakeBoard("challenger_nb_2040_wifi", "iLabs", "Challenger NB 2040 WiFi", "0x2e8a", "0x100d", 500, "CHALLENGER_NB_2040_WIFI_RP2040", 8, "boot2_w25q080_2_padded_checksum", ["WIFIESPAT2"])
328328
MakeBoard("challenger_2040_sdrtc", "iLabs", "Challenger 2040 SD/RTC", "0x2e8a", "0x102d", 250, "CHALLENGER_NB_2040_SDRTC_RP2040", 8, "boot2_w25q080_2_padded_checksum")
329+
MakeBoard("challenger_2040_nfc", "iLabs", "Challenger 2040 NFC", "0x2e8a", "0x1036", 250, "CHALLENGER_NB_2040_NFC_RP2040", 8, "boot2_w25q080_2_padded_checksum")
329330
MakeBoard("ilabs_rpico32", "iLabs", "RPICO32", "0x2e8a", "0x1010", 250, "ILABS_2040_RPICO32_RP2040", 8, "boot2_w25q080_2_padded_checksum")
330331

331332
# Melopera
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
Board init for the Challenger RP2040 NFC
3+
4+
Copyright (c) 2022 P. Oldberg <[email protected]>
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. See the GNU
14+
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+
#include <Arduino.h>
21+
22+
/**
23+
* Setup control pins for the NFC chip.
24+
*/
25+
void initVariant() {
26+
// Initialize the interrupt pin to be an input.
27+
// Setting it to an interrupt and connecting a call back is up to the app.
28+
pinMode(PIN_PN7150_IRQ_B, INPUT);
29+
30+
// Initialize the reset pin to an output and hold the device in reset.
31+
// It is up to the application to release it.
32+
pinMode(PIN_PN7150_RST_B, OUTPUT);
33+
digitalWrite(PIN_PN7150_RST_B, LOW);
34+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#pragma once
2+
3+
#define PINS_COUNT (26u)
4+
#define NUM_DIGITAL_PINS (26u)
5+
#define NUM_ANALOG_INPUTS (4u)
6+
#define NUM_ANALOG_OUTPUTS (0u)
7+
#define ADC_RESOLUTION (12u)
8+
9+
// LEDs
10+
#define PIN_LED (24u)
11+
#define NEOPIXEL (14u)
12+
#define PIN_NEOPIXEL NEOPIXEL
13+
14+
// Serial
15+
#define PIN_SERIAL1_TX (16u)
16+
#define PIN_SERIAL1_RX (17u)
17+
18+
// SPI
19+
#define PIN_SPI0_MISO (20u)
20+
#define PIN_SPI0_MOSI (23u)
21+
#define PIN_SPI0_SCK (22u)
22+
#define PIN_SPI0_SS (21u)
23+
24+
// Wire
25+
#define PIN_WIRE0_SDA (0u)
26+
#define PIN_WIRE0_SCL (1u)
27+
28+
// Connected to PN7150 NFC controller on I2C channel 2
29+
#define PIN_WIRE1_SDA (10u)
30+
#define PIN_WIRE1_SCL (11u)
31+
#define PIN_PN7150_IRQ_B (9u)
32+
#define PIN_PN7150_RST_B (12u)
33+
#define PN7150_I2C_ADDR (0x28)
34+
35+
// Not pinned out
36+
#define PIN_SERIAL2_RX (31u)
37+
#define PIN_SERIAL2_TX (31u)
38+
39+
#define SERIAL_HOWMANY (1u)
40+
#define SPI_HOWMANY (1u)
41+
#define WIRE_HOWMANY (2u)
42+
43+
#define LED_BUILTIN PIN_LED
44+
45+
static const uint8_t D0 = (16u);
46+
static const uint8_t D1 = (17u);
47+
static const uint8_t D2 = (20u);
48+
static const uint8_t D3 = (23u);
49+
static const uint8_t D4 = (22u);
50+
static const uint8_t D5 = (2u);
51+
static const uint8_t D6 = (3u);
52+
static const uint8_t D7 = (0u);
53+
static const uint8_t D8 = (1u);
54+
static const uint8_t D9 = (4u);
55+
static const uint8_t D10 = (5u);
56+
static const uint8_t D11 = (6u);
57+
static const uint8_t D12 = (7u);
58+
static const uint8_t D13 = (8u);
59+
static const uint8_t D14 = (13u);
60+
static const uint8_t D18 = (24u);
61+
62+
static const uint8_t A0 = (26u);
63+
static const uint8_t A1 = (27u);
64+
static const uint8_t A2 = (28u);
65+
static const uint8_t A3 = (29u);
66+
static const uint8_t A4 = (19u);
67+
static const uint8_t A5 = (21u);

0 commit comments

Comments
 (0)