Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 2796fe1

Browse files
authored
Variant update for Adafruit nRF52 NINA_B302_UBLOX
1 parent 48a88f8 commit 2796fe1

File tree

6 files changed

+138
-234
lines changed

6 files changed

+138
-234
lines changed

Packages_Patches/adafruit/hardware/nrf52/0.19.0/variants/NINA_B302_ublox/variant.cpp

Lines changed: 31 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -27,74 +27,53 @@
2727

2828
const uint32_t g_ADigitalPinMap[] =
2929
{
30-
// D0 .. D13
30+
// D0 .. D13
3131
29, // D0 is P0.29 (UART TX)
3232
45, // D1 is P1.13 (UART RX
3333
44, // D2 is P1.12 (NFC2)
3434
31, // D3 is P0.31 (LED1)
3535
13, // D4 is P0.13 (LED2)
3636
11, // D5 is P0.11
37-
9, // D6 is P0.09
37+
9, // D6 is P0.09
3838
10, // D7 is P0.10 (Button)
39-
41, // D8 is P1.09 (NeoPixel)
39+
41, // D8 is P1.09
4040
12, // D9 is P0.12
4141
14, // D10 is P0.14
4242
15, // D11 is P0.15
4343
32, // D12 is P1.00
44-
7, // D13 is P0.07
44+
7, // D13 is P0.07
4545

46-
// D14 .. D21 (aka A0 .. A7)
47-
4, // D14 is P0.04 (A0)
46+
// D14 .. D21 (aka A0 .. A5)
47+
4, // D14 is P0.04 (A0)
4848
30, // D15 is P0.30 (A1)
49-
5, // D16 is P0.05 (A2)
50-
2, // D17 is P0.02 (A3)
49+
5, // D16 is P0.05 (A2)
50+
2, // D17 is P0.02 (A3)
5151
28, // D18 is P0.28 (A4)
52-
3, // D19 is P0.03 (A5)
53-
29, // D20 is P0.29 (A6, Battery) ????
54-
31, // D21 is P0.31 (A7, ARef) ????
55-
56-
// D22 .. D23 (aka I2C pins)
57-
16, // D22 is P0.16 (SDA)
58-
24, // D23 is P0.24 (SCL)
59-
60-
// D24 .. D26 (aka SPI pins)
61-
32, // D24 is P1.00 (SPI MISO)
62-
15, // D25 is P0.15 (SPI MOSI)
63-
7, // D26 is P0.07 (SPI SCK )
52+
3, // D19 is P0.03 (A5)
6453

54+
// D20 .. D21 (aka I2C pins)
55+
16, // D20 is P0.16 (SDA)
56+
24, // D21 is P0.24 (SCL)
57+
6558
// QSPI pins (not exposed via any header / test point)
66-
19, // D27 is P0.19 (QSPI CLK)
67-
17, // D28 is P0.17 (QSPI CS)
68-
20, // D29 is P0.20 (QSPI Data 0)
69-
21, // D30 is P0.21 (QSPI Data 1)
70-
22, // D31 is P0.22 (QSPI Data 2)
71-
23, // D32 is P0.23 (QSPI Data 3)
72-
73-
// The remaining NFC pin
74-
9, // D33 is P0.09 (NFC1, exposed only via test point on bottom of board)
75-
76-
// Thus, there are 34 defined pins
77-
78-
// The remaining pins are not usable:
79-
//
80-
//
81-
// The following pins were never listed as they were considered unusable
82-
// 0, // P0.00 is XL1 (attached to 32.768kHz crystal)
83-
// 1, // P0.01 is XL2 (attached to 32.768kHz crystal)
84-
// 18, // P0.18 is RESET (attached to switch)
85-
// 32, // P1.00 is SWO (attached to debug header)
86-
//
87-
// The remaining pins are not connected (per schematic)
88-
// 33, // P1.01 is not connected per schematic
89-
// 35, // P1.03 is not connected per schematic
90-
// 36, // P1.04 is not connected per schematic
91-
// 37, // P1.05 is not connected per schematic
92-
// 38, // P1.06 is not connected per schematic
93-
// 39, // P1.07 is not connected per schematic
94-
// 43, // P1.11 is not connected per schematic
95-
// 44, // P1.12 is not connected per schematic
96-
// 45, // P1.13 is not connected per schematic
97-
// 46, // P1.14 is not connected per schematic
59+
19, // D22 is P0.19 (QSPI CLK)
60+
17, // D23 is P0.17 (QSPI CS)
61+
20, // D24 is P0.20 (QSPI Data 0)
62+
21, // D25 is P0.21 (QSPI Data 1)
63+
22, // D26 is P0.22 (QSPI Data 2)
64+
26, // D27 is P0.23 (QSPI Data 3)
65+
66+
40, // D28 is P1.08 - IO34
67+
41, // D29 is P1.01 - IO35
68+
44, // D30 is P1.02 - IO36
69+
45, // D31 is P1.03 - IO37
70+
42, // D32 is P1.10 - IO38
71+
43, // D33 is P1.11 - IO39
72+
47, // D34 is P1.15 - IO40
73+
46, // D35 is P1.14 - IO41
74+
26, // D36 is P0.26 - IO42
75+
6, // D37 is P0.6 - IO43
76+
27, // D38 is P0.27 - IO44
9877
};
9978

10079
void initVariant()
@@ -106,4 +85,3 @@ void initVariant()
10685
pinMode(PIN_LED2, OUTPUT);
10786
ledOff(PIN_LED2);
10887
}
109-

Packages_Patches/adafruit/hardware/nrf52/0.19.0/variants/NINA_B302_ublox/variant.h

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,15 @@
3838
extern "C"
3939
{
4040
#endif // __cplusplus
41-
// (XX) = TABLE INDEX
4241
// Number of pins defined in PinDescription array
43-
#define PINS_COUNT (34)
42+
#define PINS_COUNT (40)
4443
#define NUM_DIGITAL_PINS (34)
45-
#define NUM_ANALOG_INPUTS (6) // A6 is used for battery, A7 is analog reference
44+
#define NUM_ANALOG_INPUTS (6)
4645
#define NUM_ANALOG_OUTPUTS (0)
4746

4847
// LEDs
4948
#define PIN_LED1 (3)
5049
#define PIN_LED2 (4)
51-
#define PIN_NEOPIXEL (8)
5250

5351
#define LED_BUILTIN PIN_LED1
5452
#define LED_CONN PIN_LED2
@@ -72,8 +70,6 @@ extern "C"
7270
#define PIN_A3 (17)
7371
#define PIN_A4 (18)
7472
#define PIN_A5 (19)
75-
#define PIN_A6 (20)
76-
#define PIN_A7 (21)
7773

7874
#define D0 (0)
7975
#define D1 (1)
@@ -96,18 +92,12 @@ static const uint8_t A2 = PIN_A2 ;
9692
static const uint8_t A3 = PIN_A3 ;
9793
static const uint8_t A4 = PIN_A4 ;
9894
static const uint8_t A5 = PIN_A5 ;
99-
static const uint8_t A6 = PIN_A6 ;
100-
static const uint8_t A7 = PIN_A7 ;
95+
10196
#define ADC_RESOLUTION 14
10297

103-
// Other pins
104-
#define PIN_AREF PIN_A7
105-
#define PIN_VBAT PIN_A6
106-
#define PIN_NFC1 (33)
98+
#define PIN_NFC1 (31)
10799
#define PIN_NFC2 (2)
108100

109-
static const uint8_t AREF = PIN_AREF;
110-
111101
/*
112102
* Serial interfaces
113103
*/
@@ -119,9 +109,9 @@ static const uint8_t AREF = PIN_AREF;
119109
*/
120110
#define SPI_INTERFACES_COUNT 1
121111

122-
#define PIN_SPI_MISO (24) //24 original
123-
#define PIN_SPI_MOSI (25) //25 original
124-
#define PIN_SPI_SCK (26) //26 original
112+
#define PIN_SPI_MISO (22) //24 original
113+
#define PIN_SPI_MOSI (23) //25 original
114+
#define PIN_SPI_SCK (24) //26 original
125115

126116
static const uint8_t SS = (13);
127117
static const uint8_t MOSI = PIN_SPI_MOSI;
@@ -133,16 +123,16 @@ static const uint8_t SCK = PIN_SPI_SCK;
133123
*/
134124
#define WIRE_INTERFACES_COUNT 1
135125

136-
#define PIN_WIRE_SDA (22)
137-
#define PIN_WIRE_SCL (23)
126+
#define PIN_WIRE_SDA (20)
127+
#define PIN_WIRE_SCL (21)
138128

139129
// QSPI Pins
140-
#define PIN_QSPI_SCK 27
141-
#define PIN_QSPI_CS 28
142-
#define PIN_QSPI_IO0 29
143-
#define PIN_QSPI_IO1 30
144-
#define PIN_QSPI_IO2 31
145-
#define PIN_QSPI_IO3 32
130+
#define PIN_QSPI_SCK 22
131+
#define PIN_QSPI_CS 23
132+
#define PIN_QSPI_IO0 24
133+
#define PIN_QSPI_IO1 25
134+
#define PIN_QSPI_IO2 26
135+
#define PIN_QSPI_IO3 27
146136

147137
// On-board QSPI Flash
148138
#define EXTERNAL_FLASH_DEVICES GD25Q16C

Packages_Patches/adafruit/hardware/nrf52/0.20.1/variants/NINA_B302_ublox/variant.cpp

Lines changed: 31 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -27,74 +27,53 @@
2727

2828
const uint32_t g_ADigitalPinMap[] =
2929
{
30-
// D0 .. D13
30+
// D0 .. D13
3131
29, // D0 is P0.29 (UART TX)
3232
45, // D1 is P1.13 (UART RX
3333
44, // D2 is P1.12 (NFC2)
3434
31, // D3 is P0.31 (LED1)
3535
13, // D4 is P0.13 (LED2)
3636
11, // D5 is P0.11
37-
9, // D6 is P0.09
37+
9, // D6 is P0.09
3838
10, // D7 is P0.10 (Button)
39-
41, // D8 is P1.09 (NeoPixel)
39+
41, // D8 is P1.09
4040
12, // D9 is P0.12
4141
14, // D10 is P0.14
4242
15, // D11 is P0.15
4343
32, // D12 is P1.00
44-
7, // D13 is P0.07
44+
7, // D13 is P0.07
4545

46-
// D14 .. D21 (aka A0 .. A7)
47-
4, // D14 is P0.04 (A0)
46+
// D14 .. D21 (aka A0 .. A5)
47+
4, // D14 is P0.04 (A0)
4848
30, // D15 is P0.30 (A1)
49-
5, // D16 is P0.05 (A2)
50-
2, // D17 is P0.02 (A3)
49+
5, // D16 is P0.05 (A2)
50+
2, // D17 is P0.02 (A3)
5151
28, // D18 is P0.28 (A4)
52-
3, // D19 is P0.03 (A5)
53-
29, // D20 is P0.29 (A6, Battery) ????
54-
31, // D21 is P0.31 (A7, ARef) ????
55-
56-
// D22 .. D23 (aka I2C pins)
57-
16, // D22 is P0.16 (SDA)
58-
24, // D23 is P0.24 (SCL)
59-
60-
// D24 .. D26 (aka SPI pins)
61-
32, // D24 is P1.00 (SPI MISO)
62-
15, // D25 is P0.15 (SPI MOSI)
63-
7, // D26 is P0.07 (SPI SCK )
52+
3, // D19 is P0.03 (A5)
6453

54+
// D20 .. D21 (aka I2C pins)
55+
16, // D20 is P0.16 (SDA)
56+
24, // D21 is P0.24 (SCL)
57+
6558
// QSPI pins (not exposed via any header / test point)
66-
19, // D27 is P0.19 (QSPI CLK)
67-
17, // D28 is P0.17 (QSPI CS)
68-
20, // D29 is P0.20 (QSPI Data 0)
69-
21, // D30 is P0.21 (QSPI Data 1)
70-
22, // D31 is P0.22 (QSPI Data 2)
71-
23, // D32 is P0.23 (QSPI Data 3)
72-
73-
// The remaining NFC pin
74-
9, // D33 is P0.09 (NFC1, exposed only via test point on bottom of board)
75-
76-
// Thus, there are 34 defined pins
77-
78-
// The remaining pins are not usable:
79-
//
80-
//
81-
// The following pins were never listed as they were considered unusable
82-
// 0, // P0.00 is XL1 (attached to 32.768kHz crystal)
83-
// 1, // P0.01 is XL2 (attached to 32.768kHz crystal)
84-
// 18, // P0.18 is RESET (attached to switch)
85-
// 32, // P1.00 is SWO (attached to debug header)
86-
//
87-
// The remaining pins are not connected (per schematic)
88-
// 33, // P1.01 is not connected per schematic
89-
// 35, // P1.03 is not connected per schematic
90-
// 36, // P1.04 is not connected per schematic
91-
// 37, // P1.05 is not connected per schematic
92-
// 38, // P1.06 is not connected per schematic
93-
// 39, // P1.07 is not connected per schematic
94-
// 43, // P1.11 is not connected per schematic
95-
// 44, // P1.12 is not connected per schematic
96-
// 45, // P1.13 is not connected per schematic
97-
// 46, // P1.14 is not connected per schematic
59+
19, // D22 is P0.19 (QSPI CLK)
60+
17, // D23 is P0.17 (QSPI CS)
61+
20, // D24 is P0.20 (QSPI Data 0)
62+
21, // D25 is P0.21 (QSPI Data 1)
63+
22, // D26 is P0.22 (QSPI Data 2)
64+
26, // D27 is P0.23 (QSPI Data 3)
65+
66+
40, // D28 is P1.08 - IO34
67+
41, // D29 is P1.01 - IO35
68+
44, // D30 is P1.02 - IO36
69+
45, // D31 is P1.03 - IO37
70+
42, // D32 is P1.10 - IO38
71+
43, // D33 is P1.11 - IO39
72+
47, // D34 is P1.15 - IO40
73+
46, // D35 is P1.14 - IO41
74+
26, // D36 is P0.26 - IO42
75+
6, // D37 is P0.6 - IO43
76+
27, // D38 is P0.27 - IO44
9877
};
9978

10079
void initVariant()
@@ -106,4 +85,3 @@ void initVariant()
10685
pinMode(PIN_LED2, OUTPUT);
10786
ledOff(PIN_LED2);
10887
}
109-

Packages_Patches/adafruit/hardware/nrf52/0.20.1/variants/NINA_B302_ublox/variant.h

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,15 @@
3838
extern "C"
3939
{
4040
#endif // __cplusplus
41-
// (XX) = TABLE INDEX
4241
// Number of pins defined in PinDescription array
43-
#define PINS_COUNT (34)
42+
#define PINS_COUNT (40)
4443
#define NUM_DIGITAL_PINS (34)
45-
#define NUM_ANALOG_INPUTS (6) // A6 is used for battery, A7 is analog reference
44+
#define NUM_ANALOG_INPUTS (6)
4645
#define NUM_ANALOG_OUTPUTS (0)
4746

4847
// LEDs
4948
#define PIN_LED1 (3)
5049
#define PIN_LED2 (4)
51-
#define PIN_NEOPIXEL (8)
5250

5351
#define LED_BUILTIN PIN_LED1
5452
#define LED_CONN PIN_LED2
@@ -72,8 +70,6 @@ extern "C"
7270
#define PIN_A3 (17)
7371
#define PIN_A4 (18)
7472
#define PIN_A5 (19)
75-
#define PIN_A6 (20)
76-
#define PIN_A7 (21)
7773

7874
#define D0 (0)
7975
#define D1 (1)
@@ -96,18 +92,12 @@ static const uint8_t A2 = PIN_A2 ;
9692
static const uint8_t A3 = PIN_A3 ;
9793
static const uint8_t A4 = PIN_A4 ;
9894
static const uint8_t A5 = PIN_A5 ;
99-
static const uint8_t A6 = PIN_A6 ;
100-
static const uint8_t A7 = PIN_A7 ;
95+
10196
#define ADC_RESOLUTION 14
10297

103-
// Other pins
104-
#define PIN_AREF PIN_A7
105-
#define PIN_VBAT PIN_A6
106-
#define PIN_NFC1 (33)
98+
#define PIN_NFC1 (31)
10799
#define PIN_NFC2 (2)
108100

109-
static const uint8_t AREF = PIN_AREF;
110-
111101
/*
112102
* Serial interfaces
113103
*/
@@ -119,9 +109,9 @@ static const uint8_t AREF = PIN_AREF;
119109
*/
120110
#define SPI_INTERFACES_COUNT 1
121111

122-
#define PIN_SPI_MISO (24) //24 original
123-
#define PIN_SPI_MOSI (25) //25 original
124-
#define PIN_SPI_SCK (26) //26 original
112+
#define PIN_SPI_MISO (22) //24 original
113+
#define PIN_SPI_MOSI (23) //25 original
114+
#define PIN_SPI_SCK (24) //26 original
125115

126116
static const uint8_t SS = (13);
127117
static const uint8_t MOSI = PIN_SPI_MOSI;
@@ -133,16 +123,16 @@ static const uint8_t SCK = PIN_SPI_SCK;
133123
*/
134124
#define WIRE_INTERFACES_COUNT 1
135125

136-
#define PIN_WIRE_SDA (22)
137-
#define PIN_WIRE_SCL (23)
126+
#define PIN_WIRE_SDA (20)
127+
#define PIN_WIRE_SCL (21)
138128

139129
// QSPI Pins
140-
#define PIN_QSPI_SCK 27
141-
#define PIN_QSPI_CS 28
142-
#define PIN_QSPI_IO0 29
143-
#define PIN_QSPI_IO1 30
144-
#define PIN_QSPI_IO2 31
145-
#define PIN_QSPI_IO3 32
130+
#define PIN_QSPI_SCK 22
131+
#define PIN_QSPI_CS 23
132+
#define PIN_QSPI_IO0 24
133+
#define PIN_QSPI_IO1 25
134+
#define PIN_QSPI_IO2 26
135+
#define PIN_QSPI_IO3 27
146136

147137
// On-board QSPI Flash
148138
#define EXTERNAL_FLASH_DEVICES GD25Q16C

0 commit comments

Comments
 (0)