Skip to content

Commit e21d4f1

Browse files
committed
first commit
1 parent 89652eb commit e21d4f1

Some content is hidden

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

94 files changed

+14846
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# arduino-loraboard
2+
Arduino board files for loraboard

index.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import json
2+
import os
3+
4+
with open('package_loranodes_index.json', 'r') as file:
5+
data = json.load(file)
6+
7+
toInsert = {}
8+
9+
# user input version number
10+
toInsert['version'] = input('file version? ')
11+
12+
toInsert['boards'] = []
13+
toInsert['boards'].append({'name': 'microNode'})
14+
15+
toInsert['archiveFileName'] = 'microNode-' + toInsert['version'] + '.tar.bz2'
16+
17+
toInsert['checksum'] = 'SHA-256:' + input('sha256 sum? ')
18+
19+
toInsert['url'] = 'https://github.com/loranodes/arduino-core/' \
20+
+ toInsert['version'] + '/' + toInsert['archiveFileName']
21+
22+
cmd = toInsert['archiveFileName']
23+
toInsert['size'] = os.path.getsize(cmd)
24+
25+
26+
toInsert['architecture'] = 'samd'
27+
toInsert['name'] = 'LoRaNodes M0 Boards'
28+
toInsert['category'] = 'LoRaNodes'
29+
30+
toInsert['help'] = {'online': 'https://github.com/loranodes'}
31+
32+
toInsert['toolsDependencies'] = []
33+
34+
tool1 = {"name": "arm-none-eabi-gcc", "packager": "arduino", "version": "4.8.3-2014q1"}
35+
tool2 = {"name": "bossac", "packager": "arduino", "version": "1.6.1-arduino"}
36+
tool3 = {"name": "openocd", "packager": "arduino", "version": "0.9.0-arduino"}
37+
tool4 = {"name": "CMSIS", "packager": "arduino", "version": "4.0.0-atmel"}
38+
39+
toInsert['toolsDependencies'].append(tool1)
40+
toInsert['toolsDependencies'].append(tool2)
41+
toInsert['toolsDependencies'].append(tool3)
42+
toInsert['toolsDependencies'].append(tool4)
43+
44+
45+
data['packages'][0]['platforms'].append(toInsert)
46+
47+
with open('package_loranodes_index.json', 'w') as file:
48+
json.dump(data, file, indent="\t")
49+
50+
print('\n\nNow commit this and tag the release with the tag "' + toInsert['version'] + '"')

make.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
if [ -z "$1" ]
4+
then
5+
echo "No version number supplied"
6+
exit
7+
fi
8+
9+
rm ./*.tar.bz2
10+
11+
tar -jcvf microNode-$1.tar.bz2 microNode/
12+
13+
a=$(openssl dgst -sha256 microNode-$1.tar.bz2 | cut -d ' ' -f 2)
14+
15+
echo -e "\nDone\n"
16+
echo -e "version number = $1"
17+
echo -e "SHA256 sum = $a"

microNode-1.0.0.tar.bz2

1.1 MB
Binary file not shown.

microNode/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Arduino Core for SAMD21 and SAMD51 CPU
2+
3+
This repository contains the source code and configuration files of the Arduino Core
4+
for Atmel's SAMD21 and SAMD51 processor (used on the Arduino/Genuino Zero, MKR1000 and MKRZero boards).
5+
6+
In particular, this adds support for the Adafruit SAMD Boards such as the Feather M0
7+
8+
## ATSAMD51 Installation on Arduino IDE
9+
10+
The ATSAMD51 is a significantly new chip, so this is a detailed process for now! For the SAMD21, please install via the board manager (no extra steps required)
11+
12+
1. Install Arduino IDE 1.8.5 or greater
13+
2. Install/update the Adafruit SAMD board support package if you have installed it
14+
3. Now we need to update CMSIS! Download https://github.com/adafruit/ArduinoModule-CMSIS-Atmel/archive/master.zip and unzip
15+
4. Find your Arduino CMSIS, in Mac its "~/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS" version # may vary, you'll need "Go to folder..." feature in the Finder to get to " ~/Library/Arduino15" as it is hidden. In Windows it is "C:\Users\yourusername\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.1.0\CMSIS" Inside is a folder named Device
16+
17+
For Linux: the Arduino stuff is located in ~/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS
18+
19+
5. Inside the downloaded CMSIS zip, go into the CMSIS-Atmel/CMSIS folder, you should see a folder named Device. *DRAG THE DEVICE FOLDER ONLY* from the zip to your arduino Library folder so that Device is merged with Device. It will replace a bunch of files.
20+
21+
For Linux, it may be better to just delete the original Device Folder then copy over the new one - the drag/drop worked ok on MACOS, but not so well on my Linux box.
22+
23+
6. You will also need to replace bossac. For Windows or Mac: Go here https://github.com/adafruit/BOSSA/releases and download either windows exe or mac app of latest bossac. unzip. Go to Step 12.
24+
25+
For Linux users it is best to build a copy of bossac locally -
26+
clone the Adafruit Repostitory to somewhere on your local machine.
27+
```
28+
git clone https://github.com/adafruit/BOSSA.git
29+
change to the arduino branch
30+
git checkout arduino
31+
```
32+
Follow the instructions to build bossac in README.md or at https://github.com/adafruit/BOSSA/tree/arduino.
33+
34+
7. Replace the binary at ".../Library/Arduino15/packages/arduino/tools/bossac/1.7.0/bossac" or "...\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0\bossac"
35+
8. On Windows 7 you will also need to install the updated serial driver, download https://github.com/adafruit/Adafruit_Windows_Drivers/archive/master.zip to get all the drivers, and point the Device Manager to the unzipped folder. It isn't signed, so just approve the installation manually.
36+
13. That's it!
37+
38+
## Bugs or Issues
39+
40+
## Known Issues for SAMD51:
41+
* AREF must be tied to 3.3V for dac to work. This is a bug in the SAMD51 silicon.
42+
* USB host mode doesn't work yet
43+
44+
If you find a bug you can submit an issue here on github:
45+
46+
https://github.com/adafruit/ArduinoCore-samd
47+
48+
or if it is an issue with the upstream:
49+
50+
https://github.com/arduino/ArduinoCore-samd/issues
51+
52+
Before posting a new issue, please check if the same problem has been already reported by someone else
53+
to avoid duplicates.
54+
55+
## License and credits
56+
57+
This core has been developed by Arduino LLC in collaboration with Atmel.
58+
59+
```
60+
Copyright (c) 2015 Arduino LLC. All right reserved.
61+
62+
This library is free software; you can redistribute it and/or
63+
modify it under the terms of the GNU Lesser General Public
64+
License as published by the Free Software Foundation; either
65+
version 2.1 of the License, or (at your option) any later version.
66+
67+
This library is distributed in the hope that it will be useful,
68+
but WITHOUT ANY WARRANTY; without even the implied warranty of
69+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
70+
See the GNU Lesser General Public License for more details.
71+
72+
You should have received a copy of the GNU Lesser General Public
73+
License along with this library; if not, write to the Free Software
74+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
75+
```

microNode/boards.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
2+
#
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+
#
8+
# This library is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
# See the GNU Lesser General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU Lesser General Public
14+
# License along with this library; if not, write to the Free Software
15+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16+
17+
menu.cache=Cache
18+
19+
# microNode
20+
# ------------------------------
21+
microNode.name=microNode
22+
microNode.vid.0=0x1bda
23+
microNode.pid.0=0xe185
24+
microNode.vid.1=0x1bda
25+
microNode.pid.1=0xe185
26+
microNode.upload.tool=bossac
27+
microNode.upload.protocol=sam-ba
28+
microNode.upload.maximum_size=262144
29+
microNode.upload.offset=0x2000
30+
microNode.upload.use_1200bps_touch=true
31+
microNode.upload.wait_for_upload_port=true
32+
microNode.upload.native_usb=true
33+
microNode.build.mcu=cortex-m0plus
34+
microNode.build.f_cpu=48000000L
35+
microNode.build.usb_product="microNode"
36+
microNode.build.usb_manufacturer="UoS"
37+
microNode.build.board=SAMD_CIRCUITPLAYGROUND_EXPRESS
38+
microNode.build.core=arduino
39+
microNode.build.extra_flags=-DCRYSTALLESS -DARDUINO_SAMD_ZERO -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DADAFRUIT_CIRCUITPLAYGROUND_M0 {build.usb_flags}
40+
microNode.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
41+
microNode.build.openocdscript=openocd_scripts/arduino_zero.cfg
42+
microNode.build.variant=micronode
43+
microNode.build.variant_system_lib=
44+
microNode.build.vid=0x1bda
45+
microNode.build.pid=0xe185
46+
microNode.bootloader.tool=openocd

microNode/cores/arduino/Arduino.h

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/*
2+
Arduino.h - Main include file for the Arduino SDK
3+
Copyright (c) 2014 Arduino LLC. All right 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. See the GNU
13+
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+
20+
#ifndef Arduino_h
21+
#define Arduino_h
22+
23+
#include <stdbool.h>
24+
#include <stdint.h>
25+
#include <stdlib.h>
26+
#include <string.h>
27+
#include <math.h>
28+
29+
typedef bool boolean;
30+
typedef uint8_t byte;
31+
typedef uint16_t word;
32+
33+
// some libraries and sketches depend on this AVR stuff,
34+
// assuming Arduino.h or WProgram.h automatically includes it...
35+
//
36+
#include "avr/pgmspace.h"
37+
#include "avr/interrupt.h"
38+
#include "avr/io.h"
39+
40+
#include "binary.h"
41+
#include "itoa.h"
42+
43+
#ifdef __cplusplus
44+
extern "C"{
45+
#endif // __cplusplus
46+
47+
// Include Atmel headers
48+
#include "sam.h"
49+
50+
#include "wiring_constants.h"
51+
52+
#define clockCyclesPerMicrosecond() ( SystemCoreClock / 1000000L )
53+
#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (SystemCoreClock / 1000L) )
54+
#define microsecondsToClockCycles(a) ( (a) * (SystemCoreClock / 1000000L) )
55+
56+
void yield( void ) ;
57+
58+
/* system functions */
59+
int main( void );
60+
void init( void );
61+
62+
/* sketch */
63+
void setup( void ) ;
64+
void loop( void ) ;
65+
66+
#include "WVariant.h"
67+
68+
#ifdef __cplusplus
69+
} // extern "C"
70+
#endif
71+
72+
// The following headers are for C++ only compilation
73+
#ifdef __cplusplus
74+
#include "WCharacter.h"
75+
#include "WString.h"
76+
#include "Tone.h"
77+
#include "WMath.h"
78+
#include "HardwareSerial.h"
79+
#include "pulse.h"
80+
#endif
81+
#include "delay.h"
82+
#ifdef __cplusplus
83+
#include "Uart.h"
84+
#endif
85+
86+
// Include board variant
87+
#include "variant.h"
88+
89+
#include "wiring.h"
90+
#include "wiring_digital.h"
91+
#include "wiring_analog.h"
92+
#include "wiring_shift.h"
93+
#include "WInterrupts.h"
94+
95+
// undefine stdlib's abs if encountered
96+
#ifdef abs
97+
#undef abs
98+
#endif // abs
99+
100+
#define min(a,b) ((a)<(b)?(a):(b))
101+
#define max(a,b) ((a)>(b)?(a):(b))
102+
#define abs(x) ((x)>0?(x):-(x))
103+
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
104+
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
105+
#define radians(deg) ((deg)*DEG_TO_RAD)
106+
#define degrees(rad) ((rad)*RAD_TO_DEG)
107+
#define sq(x) ((x)*(x))
108+
109+
#define interrupts() __enable_irq()
110+
#define noInterrupts() __disable_irq()
111+
112+
#define lowByte(w) ((uint8_t) ((w) & 0xff))
113+
#define highByte(w) ((uint8_t) ((w) >> 8))
114+
115+
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
116+
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
117+
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
118+
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
119+
120+
#define bit(b) (1UL << (b))
121+
122+
#if (ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10606)
123+
// Interrupts
124+
#define digitalPinToInterrupt(P) ( P )
125+
#endif
126+
127+
// USB Device
128+
#include "USB/USBDesc.h"
129+
#include "USB/USBCore.h"
130+
#include "USB/USBAPI.h"
131+
#include "USB/USB_host.h"
132+
133+
#endif // Arduino_h

microNode/cores/arduino/Client.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
Client.h - Base class that provides Client
3+
Copyright (c) 2011 Adrian McEwen. All right 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. See the GNU
13+
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+
20+
#ifndef client_h
21+
#define client_h
22+
#include "Print.h"
23+
#include "Stream.h"
24+
#include "IPAddress.h"
25+
26+
class Client : public Stream {
27+
28+
public:
29+
virtual int connect(IPAddress ip, uint16_t port) =0;
30+
virtual int connect(const char *host, uint16_t port) =0;
31+
virtual size_t write(uint8_t) =0;
32+
virtual size_t write(const uint8_t *buf, size_t size) =0;
33+
virtual int available() = 0;
34+
virtual int read() = 0;
35+
virtual int read(uint8_t *buf, size_t size) = 0;
36+
virtual int peek() = 0;
37+
virtual void flush() = 0;
38+
virtual void stop() = 0;
39+
virtual uint8_t connected() = 0;
40+
virtual operator bool() = 0;
41+
protected:
42+
uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); };
43+
};
44+
45+
#endif

0 commit comments

Comments
 (0)