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

Commit 753c359

Browse files
authored
Update Packages' Patches
1 parent ba70e00 commit 753c359

File tree

27 files changed

+4262
-0
lines changed

27 files changed

+4262
-0
lines changed

Diff for: Packages_Patches/adafruit/hardware/nrf52/0.22.0/boards.txt

+650
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Udp.cpp: Library to send/receive UDP packets.
3+
*
4+
* NOTE: UDP is fast, but has some important limitations (thanks to Warren Gray for mentioning these)
5+
* 1) UDP does not guarantee the order in which assembled UDP packets are received. This
6+
* might not happen often in practice, but in larger network topologies, a UDP
7+
* packet can be received out of sequence.
8+
* 2) UDP does not guard against lost packets - so packets *can* disappear without the sender being
9+
* aware of it. Again, this may not be a concern in practice on small local networks.
10+
* For more information, see http://www.cafeaulait.org/course/week12/35.html
11+
*
12+
* MIT License:
13+
* Copyright (c) 2008 Bjoern Hartmann
14+
* Permission is hereby granted, free of charge, to any person obtaining a copy
15+
* of this software and associated documentation files (the "Software"), to deal
16+
* in the Software without restriction, including without limitation the rights
17+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
* copies of the Software, and to permit persons to whom the Software is
19+
* furnished to do so, subject to the following conditions:
20+
*
21+
* The above copyright notice and this permission notice shall be included in
22+
* all copies or substantial portions of the Software.
23+
*
24+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30+
* THE SOFTWARE.
31+
*
32+
* [email protected] 12/30/2008
33+
*/
34+
35+
#ifndef udp_h
36+
#define udp_h
37+
38+
#include <Stream.h>
39+
#include <IPAddress.h>
40+
41+
class UDP : public Stream {
42+
43+
public:
44+
virtual uint8_t begin(uint16_t) =0; // initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use
45+
46+
// KH, add virtual function to support Multicast, necessary for many services (MDNS, UPnP, etc.)
47+
virtual uint8_t beginMulticast(IPAddress, uint16_t) { return 0; } // initialize, start listening on specified multicast IP address and port. Returns 1 if successful, 0 on failure
48+
49+
virtual void stop() =0; // Finish with the UDP socket
50+
51+
// Sending UDP packets
52+
53+
// Start building up a packet to send to the remote host specific in ip and port
54+
// Returns 1 if successful, 0 if there was a problem with the supplied IP address or port
55+
virtual int beginPacket(IPAddress ip, uint16_t port) =0;
56+
// Start building up a packet to send to the remote host specific in host and port
57+
// Returns 1 if successful, 0 if there was a problem resolving the hostname or port
58+
virtual int beginPacket(const char *host, uint16_t port) =0;
59+
// Finish off this packet and send it
60+
// Returns 1 if the packet was sent successfully, 0 if there was an error
61+
virtual int endPacket() =0;
62+
// Write a single byte into the packet
63+
virtual size_t write(uint8_t) =0;
64+
// Write size bytes from buffer into the packet
65+
virtual size_t write(const uint8_t *buffer, size_t size) =0;
66+
67+
// Start processing the next available incoming packet
68+
// Returns the size of the packet in bytes, or 0 if no packets are available
69+
virtual int parsePacket() =0;
70+
// Number of bytes remaining in the current packet
71+
virtual int available() =0;
72+
// Read a single byte from the current packet
73+
virtual int read() =0;
74+
// Read up to len bytes from the current packet and place them into buffer
75+
// Returns the number of bytes read, or 0 if none are available
76+
virtual int read(unsigned char* buffer, size_t len) =0;
77+
// Read up to len characters from the current packet and place them into buffer
78+
// Returns the number of characters read, or 0 if none are available
79+
virtual int read(char* buffer, size_t len) =0;
80+
// Return the next byte from the current packet without moving on to the next byte
81+
virtual int peek() =0;
82+
virtual void flush() =0; // Finish reading the current packet
83+
84+
// Return the IP address of the host who sent the current incoming packet
85+
virtual IPAddress remoteIP() =0;
86+
// Return the port of the host who sent the current incoming packet
87+
virtual uint16_t remotePort() =0;
88+
protected:
89+
uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); };
90+
};
91+
92+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
2+
# Copyright (c) 2016 Sandeep Mistry All right reserved.
3+
# Copyright (c) 2017 Adafruit Industries. All rights reserved.
4+
#
5+
# This library is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Lesser General Public
7+
# License as published by the Free Software Foundation; either
8+
# version 2.1 of the License, or (at your option) any later version.
9+
#
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+
#
15+
# You should have received a copy of the GNU Lesser General Public
16+
# License along with this library; if not, write to the Free Software
17+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
19+
name=Adafruit nRF52 Boards
20+
version=0.22.0
21+
22+
# Compile variables
23+
# -----------------
24+
25+
compiler.warning_flags=-w
26+
compiler.warning_flags.none=-w
27+
compiler.warning_flags.default=
28+
compiler.warning_flags.more=-Wall
29+
compiler.warning_flags.all=-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-pointer-arith
30+
31+
# Allow changing optimization settings via platform.local.txt / boards.local.txt
32+
compiler.optimization_flag=-Ofast
33+
34+
compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
35+
compiler.c.cmd=arm-none-eabi-gcc
36+
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.warning_flags} {build.float_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD
37+
38+
# KH, Error here to use gcc, must use g++
39+
#compiler.c.elf.cmd=arm-none-eabi-gcc
40+
compiler.c.elf.cmd=arm-none-eabi-g++
41+
42+
compiler.c.elf.flags={compiler.optimization_flag} -Wl,--gc-sections -save-temps
43+
compiler.S.cmd=arm-none-eabi-gcc
44+
compiler.S.flags=-mcpu={build.mcu} -mthumb -mabi=aapcs {compiler.optimization_flag} -g -c {build.float_flags} -x assembler-with-cpp
45+
46+
compiler.cpp.cmd=arm-none-eabi-g++
47+
compiler.cpp.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.warning_flags} {build.float_flags} -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD
48+
compiler.ar.cmd=arm-none-eabi-ar
49+
compiler.ar.flags=rcs
50+
compiler.objcopy.cmd=arm-none-eabi-objcopy
51+
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
52+
compiler.elf2bin.flags=-O binary
53+
compiler.elf2bin.cmd=arm-none-eabi-objcopy
54+
compiler.elf2hex.flags=-O ihex
55+
compiler.elf2hex.cmd=arm-none-eabi-objcopy
56+
compiler.ldflags=-mcpu={build.mcu} -mthumb {build.float_flags} -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align --specs=nano.specs --specs=nosys.specs
57+
compiler.size.cmd=arm-none-eabi-size
58+
59+
# this can be overriden in boards.txt
60+
build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float
61+
build.debug_flags=-DCFG_DEBUG=0
62+
build.logger_flags=-DCFG_LOGGER=1
63+
build.sysview_flags=-DCFG_SYSVIEW=0
64+
65+
# common compiler for nrf
66+
rtos.path={build.core.path}/freertos
67+
nordic.path={build.core.path}/nordic
68+
69+
# build.logger_flags and build.sysview_flags are intentionally empty,
70+
# to allow modification via a user's own boards.local.txt or platform.local.txt files.
71+
build.flags.nrf= -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 {compiler.optimization_flag} {build.debug_flags} {build.logger_flags} {build.sysview_flags} "-I{build.core.path}/cmsis/Core/Include" "-I{nordic.path}" "-I{nordic.path}/nrfx" "-I{nordic.path}/nrfx/hal" "-I{nordic.path}/nrfx/mdk" "-I{nordic.path}/nrfx/soc" "-I{nordic.path}/nrfx/drivers/include" "-I{nordic.path}/nrfx/drivers/src" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include/nrf52" "-I{rtos.path}/Source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52" "-I{build.core.path}/sysview/SEGGER" "-I{build.core.path}/sysview/Config" "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"
72+
73+
# usb flags
74+
build.flags.usb= -DUSBCON -DUSE_TINYUSB -DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
75+
76+
# These can be overridden in platform.local.txt
77+
compiler.c.extra_flags=
78+
compiler.c.elf.extra_flags=
79+
compiler.cpp.extra_flags=
80+
compiler.S.extra_flags=
81+
compiler.ar.extra_flags=
82+
compiler.libraries.ldflags=
83+
compiler.elf2bin.extra_flags=
84+
compiler.elf2hex.extra_flags=
85+
86+
87+
# Compile patterns
88+
# ----------------
89+
90+
## Compile c files
91+
## KH Add -DBOARD_NAME="{build.board}"
92+
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} '-DARDUINO_BSP_VERSION="{version}"' {compiler.c.extra_flags} {build.extra_flags} {build.flags.nrf} {includes} "{source_file}" -o "{object_file}"
93+
94+
## Compile c++ files
95+
## KH Add -DBOARD_NAME="{build.board}"
96+
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} '-DARDUINO_BSP_VERSION="{version}"' {compiler.cpp.extra_flags} {build.extra_flags} {build.flags.nrf} {includes} "{source_file}" -o "{object_file}"
97+
98+
## Compile S files
99+
## KH Add -DBOARD_NAME="{build.board}"
100+
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.flags.nrf} {includes} "{source_file}" -o "{object_file}"
101+
102+
## Create archives
103+
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
104+
105+
## Combine gc-sections, archives, and objects
106+
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-L{build.core.path}/linker" "-T{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} -Wl,--start-group -lm "{build.path}/{archive_file}" {compiler.libraries.ldflags} -Wl,--end-group
107+
108+
## Create output (bin file)
109+
#recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2bin.cmd}" {compiler.elf2bin.flags} {compiler.elf2bin.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
110+
111+
## Create output (hex file)
112+
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
113+
114+
## Create dfu package zip file
115+
recipe.objcopy.zip.pattern="{tools.nrfutil.cmd}" dfu genpkg --dev-type 0x0052 --sd-req {build.sd_fwid} --application "{build.path}/{build.project_name}.hex" "{build.path}/{build.project_name}.zip"
116+
117+
## Create uf2 file
118+
#recipe.objcopy.uf2.pattern=python "{runtime.platform.path}/tools/uf2conv/uf2conv.py" -f 0xADA52840 -c -o "{build.path}/{build.project_name}.uf2" "{build.path}/{build.project_name}.hex"
119+
120+
## Save bin
121+
recipe.output.tmp_file_bin={build.project_name}.bin
122+
recipe.output.save_file_bin={build.project_name}.save.bin
123+
124+
## Save hex
125+
recipe.output.tmp_file_hex={build.project_name}.hex
126+
recipe.output.save_file_hexu={build.project_name}.save.hex
127+
128+
## Compute size
129+
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
130+
recipe.size.regex=^(?:\.text|\.data|)\s+([0-9]+).*
131+
recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).*
132+
133+
## Export Compiled Binary
134+
recipe.output.tmp_file={build.project_name}.hex
135+
recipe.output.save_file={build.project_name}.{build.variant}.hex
136+
137+
#***************************************************
138+
# adafruit-nrfutil for uploading
139+
# https://github.com/adafruit/Adafruit_nRF52_nrfutil
140+
# pre-built binaries are provided for macos and windows
141+
#***************************************************
142+
tools.nrfutil.cmd=adafruit-nrfutil
143+
tools.nrfutil.cmd.windows={runtime.platform.path}/tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe
144+
tools.nrfutil.cmd.macosx={runtime.platform.path}/tools/adafruit-nrfutil/macos/adafruit-nrfutil
145+
146+
tools.nrfutil.upload.params.verbose=--verbose
147+
tools.nrfutil.upload.params.quiet=
148+
tools.nrfutil.upload.pattern="{cmd}" {upload.verbose} dfu serial -pkg "{build.path}/{build.project_name}.zip" -p {serial.port} -b 115200 --singlebank
149+
150+
#***************************************************
151+
# Burning bootloader with either jlink or nrfutil
152+
#***************************************************
153+
154+
# Bootloader version
155+
tools.bootburn.bootloader.file={runtime.platform.path}/bootloader/{build.variant}/{build.variant}_bootloader-0.3.2_{build.sd_name}_{build.sd_version}
156+
157+
tools.bootburn.bootloader.params.verbose=
158+
tools.bootburn.bootloader.params.quiet=
159+
tools.bootburn.bootloader.pattern={program.burn_pattern}
160+
161+
# erase flash page while programming
162+
tools.bootburn.erase.params.verbose=
163+
tools.bootburn.erase.params.quiet=
164+
tools.bootburn.erase.pattern=
165+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
This library is free software; you can redistribute it and/or
4+
modify it under the terms of the GNU Lesser General Public
5+
License as published by the Free Software Foundation; either
6+
version 2.1 of the License, or (at your option) any later version.
7+
This library is distributed in the hope that it will be useful,
8+
but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10+
See the GNU Lesser General Public License for more details.
11+
You should have received a copy of the GNU Lesser General Public
12+
License along with this library; if not, write to the Free Software
13+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
14+
*/
15+
16+
// API compatibility
17+
#include "variant.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
// 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)
22+
23+
#include "variant.h"
24+
#include "wiring_constants.h"
25+
#include "wiring_digital.h"
26+
#include "nrf.h"
27+
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+
};
62+

0 commit comments

Comments
 (0)