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

Commit 2f496ef

Browse files
authored
Update Packages_Patches
1 parent 0dcd8fa commit 2f496ef

File tree

54 files changed

+5373
-666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+5373
-666
lines changed

Packages_Patches/adafruit/hardware/nrf52/0.19.0/cores/nRF5/Print.cpp

Lines changed: 420 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*
2+
Copyright (c) 2016 Arduino LLC. All right reserved.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
13+
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+
#pragma once
20+
21+
#include <inttypes.h>
22+
#include <stdio.h> // for size_t
23+
24+
#include "WString.h"
25+
#include "Printable.h"
26+
27+
#define DEC 10
28+
#define HEX 16
29+
#define OCT 8
30+
#define BIN 2
31+
32+
class Print
33+
{
34+
private:
35+
int write_error;
36+
size_t printNumber(unsigned long, uint8_t);
37+
size_t printULLNumber(unsigned long long, uint8_t);
38+
size_t printFloat(double, int);
39+
protected:
40+
void setWriteError(int err = 1) { write_error = err; }
41+
public:
42+
Print() : write_error(0) {}
43+
44+
int getWriteError() { return write_error; }
45+
void clearWriteError() { setWriteError(0); }
46+
47+
virtual size_t write(uint8_t) = 0;
48+
size_t write(const char *str) {
49+
if (str == NULL) return 0;
50+
return write((const uint8_t *)str, strlen(str));
51+
}
52+
virtual size_t write(const uint8_t *buffer, size_t size);
53+
size_t write(const char *buffer, size_t size) {
54+
return write((const uint8_t *)buffer, size);
55+
}
56+
57+
// default to zero, meaning "a single write may block"
58+
// should be overridden by subclasses with buffering
59+
virtual int availableForWrite() { return 0; }
60+
61+
size_t print(const __FlashStringHelper *);
62+
size_t print(const String &);
63+
size_t print(const char[]);
64+
size_t print(char);
65+
size_t print(unsigned char, int = DEC);
66+
size_t print(int, int = DEC);
67+
size_t print(unsigned int, int = DEC);
68+
size_t print(long, int = DEC);
69+
size_t print(unsigned long, int = DEC);
70+
size_t print(long long, int = DEC);
71+
size_t print(unsigned long long, int = DEC);
72+
size_t print(double, int = 2);
73+
size_t print(const Printable&);
74+
75+
size_t println(const __FlashStringHelper *);
76+
size_t println(const String &s);
77+
size_t println(const char[]);
78+
size_t println(char);
79+
size_t println(unsigned char, int = DEC);
80+
size_t println(int, int = DEC);
81+
size_t println(unsigned int, int = DEC);
82+
size_t println(long, int = DEC);
83+
size_t println(unsigned long, int = DEC);
84+
size_t println(long long, int = DEC);
85+
size_t println(unsigned long long, int = DEC);
86+
size_t println(double, int = 2);
87+
size_t println(const Printable&);
88+
size_t println(void);
89+
90+
size_t printf(const char * format, ...);
91+
92+
size_t printBuffer(uint8_t const buffer[], int len, char delim=' ', int byteline = 0);
93+
size_t printBuffer(char const buffer[], int size, char delim=' ', int byteline = 0)
94+
{
95+
return printBuffer((uint8_t const*) buffer, size, delim, byteline);
96+
}
97+
98+
size_t printBufferReverse(uint8_t const buffer[], int len, char delim=' ', int byteline = 0);
99+
size_t printBufferReverse(char const buffer[], int size, char delim=' ', int byteline = 0)
100+
{
101+
return printBufferReverse((uint8_t const*) buffer, size, delim, byteline);
102+
}
103+
104+
virtual void flush() { /* Empty implementation for backward compatibility */ }
105+
};
106+
107+

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

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,43 @@
1717
License along with this library; if not, write to the Free Software
1818
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
*/
20-
// Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip).
21-
// See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1)
2220

2321
#include "variant.h"
22+
2423
#include "wiring_constants.h"
2524
#include "wiring_digital.h"
2625
#include "nrf.h"
2726

28-
const uint32_t g_ADigitalPinMap[] = {
29-
0,
30-
1,
31-
2,
32-
3,
33-
4,
34-
5,
35-
6,
36-
7,
37-
8,
38-
9,
39-
10,
40-
11,
41-
12,
42-
13,
43-
14,
44-
15,
45-
16,
46-
17,
47-
18,
48-
19,
49-
20,
50-
21,
51-
22,
52-
23,
53-
24,
54-
25,
55-
26,
56-
27,
57-
28,
58-
29,
59-
30,
60-
31
61-
};
27+
//https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf
28+
//https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf
6229

30+
const uint32_t g_ADigitalPinMap[] = {
31+
// D0 .. D13
32+
5, // D0 is P0.05 (UART RX)
33+
6, // D1 is P0.06 (UART TX)
34+
7, // D2 is P0.07
35+
31, // D3 is P0.31
36+
18, // D4 is P0.18 (LED Blue)
37+
99, // D5 (NC)
38+
9, // D6 is P0.09 NFC1
39+
10, // D7 is P0.10 (Button) NFC2
40+
99, // D8 (NC)
41+
8, // D9 is P0.08
42+
11, // D10 is P0.11 CS
43+
13, // D11 is P0.13 MOSI
44+
12, // D12 is P0.12 MISO
45+
14, // D13 is P0.14 SCK
46+
//I2C
47+
2, // D14 is P0.2 (SDA)
48+
3, // D15 is P0.3 (SCL)
49+
// D16 .. D21 (aka A0 .. A5)
50+
3, // D16 is P0.03 (A0)
51+
2, // D17 is P0.02 (A1)
52+
4, // D18 is P0.04 (A2)
53+
30, // D19 is P0.30 (A3) SW2
54+
29, // D20 is P0.29 (A4)
55+
28, // D21 is P0.28 (A5)
56+
9, // P0.09 NFC
57+
10, // P0.10 NFC
58+
16, // SW1 (LED Green)
59+
};

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

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1717
*/
1818

19+
//https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf
20+
//https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf
21+
1922
#ifndef _VARIANT_NINA_B112_UBLOX_
2023
#define _VARIANT_NINA_B112_UBLOX_
2124

@@ -52,30 +55,29 @@ extern "C"
5255
#define LED_BUILTIN PIN_LED
5356

5457
//LEDs onboard
55-
#define LED1 (8) // Red
56-
#define LED2 (16) // Green/SW1
57-
#define LED3 (18) // Blue
58+
#define LED1 (0) // Red
59+
#define LED2 (24) // Green/SW1
60+
#define LED3 (4) // Blue
5861

5962
#define LED_STATE_ON 1 // State when LED is litted
6063

6164
//Switch
62-
63-
#define SW1 (16)
64-
#define SW2 (30)
65+
#define SW1 (24)
66+
#define SW2 (19)
6567

6668
// NFC
67-
#define PIN_NFC_1 (9) // P0.9
68-
#define PIN_NFC_2 (10) // P0.10
69+
#define PIN_NFC_1 (6) // P0.9
70+
#define PIN_NFC_2 (7) // P0.10
6971

7072
/*
7173
* Analog pins
7274
*/
73-
#define PIN_A0 (3) // P0.03
74-
#define PIN_A1 (2) // P0.02
75-
#define PIN_A2 (4) // P0.04
76-
#define PIN_A3 (30) // P0.30
77-
#define PIN_A4 (29) // P0.29
78-
#define PIN_A5 (28) // P0.28
75+
#define PIN_A0 (16) // P0.03
76+
#define PIN_A1 (17) // P0.02
77+
#define PIN_A2 (18) // P0.04
78+
#define PIN_A3 (19) // P0.30
79+
#define PIN_A4 (20) // P0.29
80+
#define PIN_A5 (21) // P0.28
7981

8082
static const uint8_t A0 = PIN_A0 ;
8183
static const uint8_t A1 = PIN_A1 ;
@@ -86,14 +88,14 @@ static const uint8_t A5 = PIN_A5 ;
8688

8789
#define ADC_RESOLUTION 14
8890

89-
#define PIN_D0 (5) // P0.05
90-
#define PIN_D1 (6) // P0.06
91-
#define PIN_D2 (7) // P0.07
92-
#define PIN_D3 (31) // P0.31
93-
#define PIN_D4 (18) // P0.18
94-
#define PIN_D6 (9) // P0.09
95-
#define PIN_D7 (10) // P0.10
96-
#define PIN_D9 (8) // P0.8
91+
#define PIN_D0 (0) // P0.05
92+
#define PIN_D1 (1) // P0.06
93+
#define PIN_D2 (2) // P0.07
94+
#define PIN_D3 (4) // P0.31
95+
#define PIN_D4 (5) // P0.18
96+
#define PIN_D6 (6) // P0.09
97+
#define PIN_D7 (7) // P0.10
98+
#define PIN_D9 (9) // P0.08
9799
#define PIN_D10 (11) // P0.11
98100
#define PIN_D11 (13) // P0.13
99101
#define PIN_D12 (12) // P0.12
@@ -125,13 +127,10 @@ static const uint8_t D15 = PIN_D15 ;
125127
/*
126128
* Serial interfaces
127129
*/
128-
//#define PIN_SERIAL_RX (8) //used for original Adafruit Bootloader
129-
//#define PIN_SERIAL_TX (6) //used for original Adafruit Bootloader
130-
131-
#define PIN_SERIAL_RX (5) // P0.05
132-
#define PIN_SERIAL_TX (6) // P0.06
133-
#define PIN_SERIAL_CTS (7) // P0.07
134-
#define PIN_SERIAL_RTS (31) // P0.31
130+
#define PIN_SERIAL_RX (0) // P0.05
131+
#define PIN_SERIAL_TX (1) // P0.06
132+
#define PIN_SERIAL_CTS (2) // P0.07
133+
#define PIN_SERIAL_RTS (3) // P0.31
135134
#define PIN_SERIAL_DTR (28) // P0.28
136135
#define PIN_SERIAL_DSR (29) // P0.29
137136

@@ -141,10 +140,10 @@ static const uint8_t D15 = PIN_D15 ;
141140
#define SPI_INTERFACES_COUNT 1
142141

143142
#define PIN_SPI_MISO (12) // P0.12
144-
#define PIN_SPI_MOSI (13) // P0.13
145-
#define PIN_SPI_SCK (14) // P0.14
143+
#define PIN_SPI_MOSI (11) // P0.13
144+
#define PIN_SPI_SCK (13) // P0.14
146145

147-
static const uint8_t SS = 11 ; // P0.11
146+
static const uint8_t SS = 10 ; // P0.11
148147
static const uint8_t MOSI = PIN_SPI_MOSI ;
149148
static const uint8_t MISO = PIN_SPI_MISO ;
150149
static const uint8_t SCK = PIN_SPI_SCK ;
@@ -154,8 +153,8 @@ static const uint8_t SCK = PIN_SPI_SCK ;
154153
*/
155154
#define WIRE_INTERFACES_COUNT 1
156155

157-
#define PIN_WIRE_SDA (2) // P0.02
158-
#define PIN_WIRE_SCL (3) // P0.03
156+
#define PIN_WIRE_SDA (14) // P0.02
157+
#define PIN_WIRE_SCL (15) // P0.03
159158

160159
static const uint8_t SDA = PIN_WIRE_SDA;
161160
static const uint8_t SCL = PIN_WIRE_SCL;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
const uint32_t g_ADigitalPinMap[] =
2929
{
3030
// D0 .. D13
31-
29, // D0 is P0.29 (UART TX)
32-
45, // D1 is P1.13 (UART RX
31+
29, // D0 is P0.29 (UART RX)
32+
45, // D1 is P1.13 (UART TX)
3333
44, // D2 is P1.12 (NFC2)
3434
31, // D3 is P0.31 (LED1)
3535
13, // D4 is P0.13 (LED2)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ static const uint8_t A5 = PIN_A5 ;
101101
/*
102102
* Serial interfaces
103103
*/
104-
#define PIN_SERIAL1_RX (1)
105-
#define PIN_SERIAL1_TX (0)
104+
#define PIN_SERIAL1_RX (0)
105+
#define PIN_SERIAL1_TX (1)
106106

107107
/*
108108
* SPI Interfaces

0 commit comments

Comments
 (0)