BertOS wiped
|
@ -1,7 +0,0 @@
|
||||||
obj
|
|
||||||
*.project
|
|
||||||
*.workspace
|
|
||||||
resources
|
|
||||||
images/*.bin
|
|
||||||
images/*.s19
|
|
||||||
images/*.map
|
|
28
COMPILING
|
@ -1,28 +0,0 @@
|
||||||
-= Compiling with make =-
|
|
||||||
|
|
||||||
To compile you need a the gcc-avr toolchain and standard make utilities.
|
|
||||||
On Ubuntu/Debian this can be installed with:
|
|
||||||
|
|
||||||
apt-get install build-essential gcc-avr avr-libc binutils-avr avrdude
|
|
||||||
|
|
||||||
After that execute "make" in the main directory, and the modem firmware should compile.
|
|
||||||
|
|
||||||
You can use avrdude to flash to an Arduino compatible board. Have a look at the "flash" script, it makes this easy. If your board is connected to /dev/ttyUSB0, simply run:
|
|
||||||
|
|
||||||
./flash USB0
|
|
||||||
|
|
||||||
And avrdude should upload the firmware to the board.
|
|
||||||
|
|
||||||
|
|
||||||
-= Eclipse =-
|
|
||||||
|
|
||||||
If you want to use the Eclipse IDE, follow these steps:
|
|
||||||
|
|
||||||
- Install the AVR-eclipse plugin from http://avr-eclipse.sourceforge.net/wiki/index.php/Plugin_Download
|
|
||||||
- In eclipse, create a new project (File -> New -> Project…)
|
|
||||||
- In the new project box, select C/C++ -> “Makefile Project with Existing Code”
|
|
||||||
- Select a name, and locate the MicroModem folder for “Existing Code Location”
|
|
||||||
- Select “AVR-GCC Toolchain” in “Toolchain for indexer settings”
|
|
||||||
- Click “Finish”
|
|
||||||
|
|
||||||
|
|
|
@ -1,108 +0,0 @@
|
||||||
w = 47.5;
|
|
||||||
h = 25;
|
|
||||||
d = 28.5;
|
|
||||||
t=1.5;
|
|
||||||
|
|
||||||
usbw = 8;
|
|
||||||
usbh = 3.5;
|
|
||||||
usbl = 1;
|
|
||||||
|
|
||||||
mdw = 25.7;
|
|
||||||
|
|
||||||
ss = 4;
|
|
||||||
ps = 4;
|
|
||||||
|
|
||||||
module box() {
|
|
||||||
difference() {
|
|
||||||
cube([w+2*t, d+2*t, h+2*t], center=true);
|
|
||||||
cube([w, d, h], center=true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module topSlice() { translate([0,0,h/2]) cube([w+2*t+1, d+2*t+2, h], center=true); }
|
|
||||||
module bottomSlice() { translate([0,0,-h/2]) cube([w+2*t+1, d+2*t+2, h], center=true); }
|
|
||||||
|
|
||||||
module ports() {
|
|
||||||
module usb() {
|
|
||||||
// cube([usbw, usbh, t+2], center = true);
|
|
||||||
d1 = 11;
|
|
||||||
d2 = 9;
|
|
||||||
difference() {
|
|
||||||
cube([usbw, t+2, usbh], center = true);
|
|
||||||
translate([(usbw/2+usbw/d1), 0, (usbh/2+usbw/d1)]) rotate([0, 45, 0]) cube([3, t+2, usbh], center = true);
|
|
||||||
translate([-(usbw/2+usbw/d1), 0, (usbh/2+usbw/d1)]) rotate([0, -45, 0]) cube([3, t+2, usbh], center = true);
|
|
||||||
translate([(usbw/2+usbw/d2), 0, -(usbh/2+usbw/d2)]) rotate([0, -45, 0]) cube([3, t+2, usbh], center = true);
|
|
||||||
translate([-(usbw/2+usbw/d2), 0, -(usbh/2+usbw/d2)]) rotate([0, 45, 0]) cube([3, t+2, usbh], center = true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
translate([w/2-1, d/6, -8]) rotate([0, 90, 0]) cylinder(r=6.2/2, h=t+2, $fn=32);
|
|
||||||
translate([w/2-1, -d/6, -8]) rotate([0, 90, 0]) cylinder(r=6.2/2, h=t+2, $fn=32);
|
|
||||||
translate([-(w/2-mdw/2), d/2+t/2, -(h/2-(usbh/2)-usbl)]) usb();
|
|
||||||
}
|
|
||||||
|
|
||||||
module divider() {
|
|
||||||
translate([mdw-(w/2-t/2), 0, -(h/2-(h/6))]) cube([t, d, h/3], center=true);
|
|
||||||
}
|
|
||||||
|
|
||||||
module pegs() {
|
|
||||||
translate([(w/2-ps/2), (d/2-ps/2), -h/10]) cube([ps, ps, h-h/10], center=true);
|
|
||||||
translate([(w/2-ps/2), -(d/2-ps/2), -h/10]) cube([ps, ps, h-h/10], center=true);
|
|
||||||
|
|
||||||
translate([mdw-(w/2-t/2)+t/2+ps/2, (d/2-ps/2), -h/10]) cube([ps, ps, h-h/10], center=true);
|
|
||||||
translate([mdw-(w/2-t/2)+t/2+ps/2, -(d/2-ps/2), -h/10]) cube([ps, ps, h-h/10], center=true);
|
|
||||||
}
|
|
||||||
|
|
||||||
module indicators() {
|
|
||||||
translate([w/2+t/2, 0, 8]) slit();
|
|
||||||
translate([w/2+t/2, -2, 8]) slit();
|
|
||||||
translate([w/2+t/2, 2, 8]) slit();
|
|
||||||
}
|
|
||||||
|
|
||||||
module symbols() {
|
|
||||||
translate([w/2+t, -(d/2-(d/10)), -8]) one();
|
|
||||||
translate([w/2+t, (d/2-(d/10)), -8]) zero();
|
|
||||||
}
|
|
||||||
|
|
||||||
module zero() {
|
|
||||||
rotate([0, 90, 0]) linear_extrude(height=1, center=true) circle(r=ss/2, $fn=32);
|
|
||||||
}
|
|
||||||
|
|
||||||
module one() {
|
|
||||||
cube([1, 1, ss], center=true);
|
|
||||||
}
|
|
||||||
|
|
||||||
module slit() {
|
|
||||||
cube([2*t, 1, ss], center=true);
|
|
||||||
}
|
|
||||||
|
|
||||||
module top() {
|
|
||||||
difference() {
|
|
||||||
box();
|
|
||||||
bottomSlice();
|
|
||||||
indicators();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module bottom() {
|
|
||||||
union() {
|
|
||||||
difference() {
|
|
||||||
box();
|
|
||||||
topSlice();
|
|
||||||
ports();
|
|
||||||
symbols();
|
|
||||||
}
|
|
||||||
pegs();
|
|
||||||
divider();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module enclosure() {
|
|
||||||
translate([0,-(d/2+(d/6)),(h/2+t)]) rotate([180, 0, 0]) top();
|
|
||||||
translate([0,(d/2+(d/6)),(h/2+t)]) bottom();
|
|
||||||
|
|
||||||
//translate([0,0,(h/2+t)]) rotate([180, 0, 0]) top();
|
|
||||||
//bottom
|
|
||||||
}
|
|
||||||
|
|
||||||
enclosure();
|
|
||||||
|
|
|
@ -1,618 +0,0 @@
|
||||||
solid Default
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
vertex -2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
vertex -2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.000000e+00 -1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex -2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
vertex 2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
vertex -2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.000000e+00 -1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex -2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
vertex 2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
vertex 2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
vertex 2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex -2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
vertex 2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
vertex -2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
vertex 2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.000000e+00 1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.000000e+00 1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.224650e-16 -1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
vertex 2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.224650e-16 -1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
vertex 2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
vertex 2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.250000e+01 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
vertex 2.525000e+01 5.750000e+00 1.400000e+01
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
vertex 2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
vertex 2.525000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.928820e-15
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.250000e+01 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -2.575000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 5.750000e+00 -1.928820e-15
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex -2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
vertex -2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.000000e+00 1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.000000e+00 1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.000000e+00 -1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex -2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.000000e+00 -1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex -2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex -2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.400000e+01
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal -1.000000e+00 0.000000e+00 0.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.400000e+01
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.224650e-16 -1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.224650e-16 -1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.000000e+00 1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.000000e+00 1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.000000e+00 -1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.000000e+00 -1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -8.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -7.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.224650e-16 -1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.224650e-16 -1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.000000e+00 1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.000000e+00 1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.000000e+00 -1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.000000e+00 -1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.050000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -9.500000e+00 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.224650e-16 -1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.250000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 8.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.224650e-16 -1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.000000e+00 1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 -1.000000e+00 1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.000000e+00 -1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.250000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.000000e+00 -1.224650e-16
|
|
||||||
outer loop
|
|
||||||
vertex 2.525000e+01 -1.250000e+01 8.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 8.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex 2.375000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
vertex 2.375000e+01 -1.250000e+01 4.000000e+00
|
|
||||||
vertex 2.525000e+01 -1.150000e+01 4.000000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex 2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
facet normal 0.000000e+00 1.224650e-16 1.000000e+00
|
|
||||||
outer loop
|
|
||||||
vertex -2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
vertex -2.375000e+01 -2.425000e+01 1.500000e+00
|
|
||||||
vertex 2.375000e+01 4.250000e+00 1.500000e+00
|
|
||||||
endloop
|
|
||||||
endfacet
|
|
||||||
endsolid Default
|
|
|
@ -1,191 +0,0 @@
|
||||||
G75*
|
|
||||||
%MOIN*%
|
|
||||||
%OFA0B0*%
|
|
||||||
%FSLAX24Y24*%
|
|
||||||
%IPPOS*%
|
|
||||||
%LPD*%
|
|
||||||
%AMOC8*
|
|
||||||
5,1,8,0,0,1.08239X$1,22.5*
|
|
||||||
%
|
|
||||||
%ADD10C,0.0000*%
|
|
||||||
%ADD11OC8,0.0520*%
|
|
||||||
%ADD12OC8,0.0630*%
|
|
||||||
%ADD13C,0.0630*%
|
|
||||||
%ADD14OC8,0.0700*%
|
|
||||||
%ADD15C,0.0600*%
|
|
||||||
%ADD16OC8,0.0760*%
|
|
||||||
%ADD17C,0.0160*%
|
|
||||||
%ADD18R,0.0356X0.0356*%
|
|
||||||
D10*
|
|
||||||
X000100Y000100D02*
|
|
||||||
X000100Y009596D01*
|
|
||||||
X010470Y009596D01*
|
|
||||||
X010470Y000100D01*
|
|
||||||
X000100Y000100D01*
|
|
||||||
D11*
|
|
||||||
X003350Y003850D03*
|
|
||||||
X004350Y003850D03*
|
|
||||||
X005100Y002850D03*
|
|
||||||
X005100Y001850D03*
|
|
||||||
X006350Y001850D03*
|
|
||||||
X006350Y002850D03*
|
|
||||||
X006100Y004100D03*
|
|
||||||
X007100Y004100D03*
|
|
||||||
X007850Y004100D03*
|
|
||||||
X008850Y004100D03*
|
|
||||||
X008850Y003100D03*
|
|
||||||
X007850Y003100D03*
|
|
||||||
X008850Y001850D03*
|
|
||||||
X009850Y001850D03*
|
|
||||||
X008850Y006850D03*
|
|
||||||
X008850Y007850D03*
|
|
||||||
X007850Y007850D03*
|
|
||||||
X006850Y007850D03*
|
|
||||||
X006850Y006850D03*
|
|
||||||
X007850Y006850D03*
|
|
||||||
X005850Y006850D03*
|
|
||||||
X004850Y006850D03*
|
|
||||||
X004850Y007850D03*
|
|
||||||
X005850Y007850D03*
|
|
||||||
X003600Y007850D03*
|
|
||||||
X002850Y007350D03*
|
|
||||||
X003600Y006850D03*
|
|
||||||
X003350Y005850D03*
|
|
||||||
X003350Y004850D03*
|
|
||||||
D12*
|
|
||||||
X002850Y002850D03*
|
|
||||||
X002850Y001850D03*
|
|
||||||
X006350Y005350D03*
|
|
||||||
X007850Y005350D03*
|
|
||||||
X008850Y005350D03*
|
|
||||||
D13*
|
|
||||||
X005350Y005350D03*
|
|
||||||
D14*
|
|
||||||
X004850Y008850D03*
|
|
||||||
X003850Y008850D03*
|
|
||||||
X002850Y008850D03*
|
|
||||||
X001850Y008850D03*
|
|
||||||
X000850Y008850D03*
|
|
||||||
X000850Y007850D03*
|
|
||||||
X000850Y006850D03*
|
|
||||||
X000850Y005850D03*
|
|
||||||
X000850Y004850D03*
|
|
||||||
X000850Y003850D03*
|
|
||||||
X000850Y002850D03*
|
|
||||||
X000850Y001850D03*
|
|
||||||
X000850Y000850D03*
|
|
||||||
X001850Y000850D03*
|
|
||||||
X002850Y000850D03*
|
|
||||||
X003850Y000850D03*
|
|
||||||
X004850Y000850D03*
|
|
||||||
X005850Y000850D03*
|
|
||||||
X006850Y000850D03*
|
|
||||||
X007850Y000850D03*
|
|
||||||
X008850Y000850D03*
|
|
||||||
X009850Y000850D03*
|
|
||||||
X009850Y008850D03*
|
|
||||||
X008850Y008850D03*
|
|
||||||
X007850Y008850D03*
|
|
||||||
X006850Y008850D03*
|
|
||||||
X005850Y008850D03*
|
|
||||||
D15*
|
|
||||||
X001850Y004850D03*
|
|
||||||
X001850Y003850D03*
|
|
||||||
X001850Y002850D03*
|
|
||||||
D16*
|
|
||||||
X001850Y005850D03*
|
|
||||||
X001850Y006850D03*
|
|
||||||
D17*
|
|
||||||
X002350Y007350D01*
|
|
||||||
X002850Y007350D01*
|
|
||||||
X003600Y006850D02*
|
|
||||||
X001850Y005850D01*
|
|
||||||
X001850Y004850D01*
|
|
||||||
X002350Y004350D01*
|
|
||||||
X004350Y004350D01*
|
|
||||||
X004350Y003850D01*
|
|
||||||
X005850Y003850D01*
|
|
||||||
X005880Y003852D01*
|
|
||||||
X005910Y003857D01*
|
|
||||||
X005939Y003866D01*
|
|
||||||
X005966Y003879D01*
|
|
||||||
X005992Y003894D01*
|
|
||||||
X006016Y003913D01*
|
|
||||||
X006037Y003934D01*
|
|
||||||
X006056Y003958D01*
|
|
||||||
X006071Y003984D01*
|
|
||||||
X006084Y004011D01*
|
|
||||||
X006093Y004040D01*
|
|
||||||
X006098Y004070D01*
|
|
||||||
X006100Y004100D01*
|
|
||||||
X006600Y004600D01*
|
|
||||||
X008100Y004600D01*
|
|
||||||
X008850Y005350D01*
|
|
||||||
X008850Y006100D01*
|
|
||||||
X009350Y006100D01*
|
|
||||||
X009350Y007350D01*
|
|
||||||
X008850Y007850D01*
|
|
||||||
X009850Y008850D01*
|
|
||||||
X007850Y008850D02*
|
|
||||||
X007850Y007850D01*
|
|
||||||
X006850Y007850D02*
|
|
||||||
X006850Y008850D01*
|
|
||||||
X005850Y008850D02*
|
|
||||||
X005850Y007850D01*
|
|
||||||
X004850Y007850D02*
|
|
||||||
X003600Y007850D01*
|
|
||||||
X003600Y006850D02*
|
|
||||||
X004850Y006850D01*
|
|
||||||
X004850Y007850D02*
|
|
||||||
X004850Y008850D01*
|
|
||||||
X007850Y006850D02*
|
|
||||||
X008850Y006850D01*
|
|
||||||
X008100Y004600D02*
|
|
||||||
X008600Y004100D01*
|
|
||||||
X008850Y004100D01*
|
|
||||||
X008850Y003100D02*
|
|
||||||
X008850Y001850D01*
|
|
||||||
X009850Y001850D02*
|
|
||||||
X009850Y000850D01*
|
|
||||||
X007850Y000850D02*
|
|
||||||
X007850Y003100D01*
|
|
||||||
X007350Y002350D02*
|
|
||||||
X004100Y002350D01*
|
|
||||||
X004098Y002306D01*
|
|
||||||
X004092Y002263D01*
|
|
||||||
X004083Y002221D01*
|
|
||||||
X004070Y002179D01*
|
|
||||||
X004053Y002139D01*
|
|
||||||
X004033Y002100D01*
|
|
||||||
X004010Y002063D01*
|
|
||||||
X003983Y002029D01*
|
|
||||||
X003954Y001996D01*
|
|
||||||
X003921Y001967D01*
|
|
||||||
X003887Y001940D01*
|
|
||||||
X003850Y001917D01*
|
|
||||||
X003811Y001897D01*
|
|
||||||
X003771Y001880D01*
|
|
||||||
X003729Y001867D01*
|
|
||||||
X003687Y001858D01*
|
|
||||||
X003644Y001852D01*
|
|
||||||
X003600Y001850D01*
|
|
||||||
X002850Y001850D01*
|
|
||||||
X000850Y001850D01*
|
|
||||||
X001850Y002850D02*
|
|
||||||
X002850Y002850D01*
|
|
||||||
X003350Y003850D02*
|
|
||||||
X001850Y003850D01*
|
|
||||||
X005100Y002850D02*
|
|
||||||
X006350Y002850D01*
|
|
||||||
X007100Y003600D01*
|
|
||||||
X007100Y004100D01*
|
|
||||||
X006350Y001850D02*
|
|
||||||
X006350Y001350D01*
|
|
||||||
X005850Y000850D01*
|
|
||||||
X005100Y001100D02*
|
|
||||||
X004850Y000850D01*
|
|
||||||
X005100Y001100D02*
|
|
||||||
X005100Y001850D01*
|
|
||||||
D18*
|
|
||||||
X007350Y002350D03*
|
|
||||||
M02*
|
|
|
@ -1,17 +0,0 @@
|
||||||
G75*
|
|
||||||
%MOIN*%
|
|
||||||
%OFA0B0*%
|
|
||||||
%FSLAX24Y24*%
|
|
||||||
%IPPOS*%
|
|
||||||
%LPD*%
|
|
||||||
%AMOC8*
|
|
||||||
5,1,8,0,0,1.08239X$1,22.5*
|
|
||||||
%
|
|
||||||
%ADD10C,0.0000*%
|
|
||||||
D10*
|
|
||||||
X000100Y000100D02*
|
|
||||||
X000100Y009596D01*
|
|
||||||
X010470Y009596D01*
|
|
||||||
X010470Y000100D01*
|
|
||||||
X000100Y000100D01*
|
|
||||||
M02*
|
|
|
@ -1,17 +0,0 @@
|
||||||
G75*
|
|
||||||
%MOIN*%
|
|
||||||
%OFA0B0*%
|
|
||||||
%FSLAX24Y24*%
|
|
||||||
%IPPOS*%
|
|
||||||
%LPD*%
|
|
||||||
%AMOC8*
|
|
||||||
5,1,8,0,0,1.08239X$1,22.5*
|
|
||||||
%
|
|
||||||
%ADD10C,0.0000*%
|
|
||||||
D10*
|
|
||||||
X000100Y000100D02*
|
|
||||||
X000100Y009596D01*
|
|
||||||
X010470Y009596D01*
|
|
||||||
X010470Y000100D01*
|
|
||||||
X000100Y000100D01*
|
|
||||||
M02*
|
|
|
@ -1,96 +0,0 @@
|
||||||
G75*
|
|
||||||
%MOIN*%
|
|
||||||
%OFA0B0*%
|
|
||||||
%FSLAX24Y24*%
|
|
||||||
%IPPOS*%
|
|
||||||
%LPD*%
|
|
||||||
%AMOC8*
|
|
||||||
5,1,8,0,0,1.08239X$1,22.5*
|
|
||||||
%
|
|
||||||
%ADD10C,0.0000*%
|
|
||||||
%ADD11OC8,0.0560*%
|
|
||||||
%ADD12OC8,0.0670*%
|
|
||||||
%ADD13C,0.0670*%
|
|
||||||
%ADD14OC8,0.0740*%
|
|
||||||
%ADD15C,0.0640*%
|
|
||||||
%ADD16OC8,0.0800*%
|
|
||||||
D10*
|
|
||||||
X000100Y000100D02*
|
|
||||||
X000100Y009596D01*
|
|
||||||
X010470Y009596D01*
|
|
||||||
X010470Y000100D01*
|
|
||||||
X000100Y000100D01*
|
|
||||||
D11*
|
|
||||||
X003350Y003850D03*
|
|
||||||
X004350Y003850D03*
|
|
||||||
X005100Y002850D03*
|
|
||||||
X005100Y001850D03*
|
|
||||||
X006350Y001850D03*
|
|
||||||
X006350Y002850D03*
|
|
||||||
X006100Y004100D03*
|
|
||||||
X007100Y004100D03*
|
|
||||||
X007850Y004100D03*
|
|
||||||
X008850Y004100D03*
|
|
||||||
X008850Y003100D03*
|
|
||||||
X007850Y003100D03*
|
|
||||||
X008850Y001850D03*
|
|
||||||
X009850Y001850D03*
|
|
||||||
X008850Y006850D03*
|
|
||||||
X008850Y007850D03*
|
|
||||||
X007850Y007850D03*
|
|
||||||
X006850Y007850D03*
|
|
||||||
X006850Y006850D03*
|
|
||||||
X007850Y006850D03*
|
|
||||||
X005850Y006850D03*
|
|
||||||
X004850Y006850D03*
|
|
||||||
X004850Y007850D03*
|
|
||||||
X005850Y007850D03*
|
|
||||||
X003600Y007850D03*
|
|
||||||
X002850Y007350D03*
|
|
||||||
X003600Y006850D03*
|
|
||||||
X003350Y005850D03*
|
|
||||||
X003350Y004850D03*
|
|
||||||
D12*
|
|
||||||
X002850Y002850D03*
|
|
||||||
X002850Y001850D03*
|
|
||||||
X006350Y005350D03*
|
|
||||||
X007850Y005350D03*
|
|
||||||
X008850Y005350D03*
|
|
||||||
D13*
|
|
||||||
X005350Y005350D03*
|
|
||||||
D14*
|
|
||||||
X004850Y008850D03*
|
|
||||||
X003850Y008850D03*
|
|
||||||
X002850Y008850D03*
|
|
||||||
X001850Y008850D03*
|
|
||||||
X000850Y008850D03*
|
|
||||||
X000850Y007850D03*
|
|
||||||
X000850Y006850D03*
|
|
||||||
X000850Y005850D03*
|
|
||||||
X000850Y004850D03*
|
|
||||||
X000850Y003850D03*
|
|
||||||
X000850Y002850D03*
|
|
||||||
X000850Y001850D03*
|
|
||||||
X000850Y000850D03*
|
|
||||||
X001850Y000850D03*
|
|
||||||
X002850Y000850D03*
|
|
||||||
X003850Y000850D03*
|
|
||||||
X004850Y000850D03*
|
|
||||||
X005850Y000850D03*
|
|
||||||
X006850Y000850D03*
|
|
||||||
X007850Y000850D03*
|
|
||||||
X008850Y000850D03*
|
|
||||||
X009850Y000850D03*
|
|
||||||
X009850Y008850D03*
|
|
||||||
X008850Y008850D03*
|
|
||||||
X007850Y008850D03*
|
|
||||||
X006850Y008850D03*
|
|
||||||
X005850Y008850D03*
|
|
||||||
D15*
|
|
||||||
X001850Y004850D03*
|
|
||||||
X001850Y003850D03*
|
|
||||||
X001850Y002850D03*
|
|
||||||
D16*
|
|
||||||
X001850Y005850D03*
|
|
||||||
X001850Y006850D03*
|
|
||||||
M02*
|
|
|
@ -1,17 +0,0 @@
|
||||||
G75*
|
|
||||||
%MOIN*%
|
|
||||||
%OFA0B0*%
|
|
||||||
%FSLAX24Y24*%
|
|
||||||
%IPPOS*%
|
|
||||||
%LPD*%
|
|
||||||
%AMOC8*
|
|
||||||
5,1,8,0,0,1.08239X$1,22.5*
|
|
||||||
%
|
|
||||||
%ADD10C,0.0000*%
|
|
||||||
D10*
|
|
||||||
X000100Y000100D02*
|
|
||||||
X000100Y009596D01*
|
|
||||||
X010470Y009596D01*
|
|
||||||
X010470Y000100D01*
|
|
||||||
X000100Y000100D01*
|
|
||||||
M02*
|
|
|
@ -1,116 +0,0 @@
|
||||||
G75*
|
|
||||||
%MOIN*%
|
|
||||||
%OFA0B0*%
|
|
||||||
%FSLAX24Y24*%
|
|
||||||
%IPPOS*%
|
|
||||||
%LPD*%
|
|
||||||
%AMOC8*
|
|
||||||
5,1,8,0,0,1.08239X$1,22.5*
|
|
||||||
%
|
|
||||||
%ADD10C,0.0000*%
|
|
||||||
%ADD11OC8,0.0520*%
|
|
||||||
%ADD12OC8,0.0630*%
|
|
||||||
%ADD13C,0.0630*%
|
|
||||||
%ADD14OC8,0.0700*%
|
|
||||||
%ADD15C,0.0600*%
|
|
||||||
%ADD16OC8,0.0760*%
|
|
||||||
%ADD17C,0.0160*%
|
|
||||||
%ADD18R,0.0356X0.0356*%
|
|
||||||
D10*
|
|
||||||
X000100Y000100D02*
|
|
||||||
X000100Y009596D01*
|
|
||||||
X010470Y009596D01*
|
|
||||||
X010470Y000100D01*
|
|
||||||
X000100Y000100D01*
|
|
||||||
D11*
|
|
||||||
X003350Y003850D03*
|
|
||||||
X004350Y003850D03*
|
|
||||||
X005100Y002850D03*
|
|
||||||
X005100Y001850D03*
|
|
||||||
X006350Y001850D03*
|
|
||||||
X006350Y002850D03*
|
|
||||||
X006100Y004100D03*
|
|
||||||
X007100Y004100D03*
|
|
||||||
X007850Y004100D03*
|
|
||||||
X008850Y004100D03*
|
|
||||||
X008850Y003100D03*
|
|
||||||
X007850Y003100D03*
|
|
||||||
X008850Y001850D03*
|
|
||||||
X009850Y001850D03*
|
|
||||||
X008850Y006850D03*
|
|
||||||
X008850Y007850D03*
|
|
||||||
X007850Y007850D03*
|
|
||||||
X006850Y007850D03*
|
|
||||||
X006850Y006850D03*
|
|
||||||
X007850Y006850D03*
|
|
||||||
X005850Y006850D03*
|
|
||||||
X004850Y006850D03*
|
|
||||||
X004850Y007850D03*
|
|
||||||
X005850Y007850D03*
|
|
||||||
X003600Y007850D03*
|
|
||||||
X002850Y007350D03*
|
|
||||||
X003600Y006850D03*
|
|
||||||
X003350Y005850D03*
|
|
||||||
X003350Y004850D03*
|
|
||||||
D12*
|
|
||||||
X002850Y002850D03*
|
|
||||||
X002850Y001850D03*
|
|
||||||
X006350Y005350D03*
|
|
||||||
X007850Y005350D03*
|
|
||||||
X008850Y005350D03*
|
|
||||||
D13*
|
|
||||||
X005350Y005350D03*
|
|
||||||
D14*
|
|
||||||
X004850Y008850D03*
|
|
||||||
X003850Y008850D03*
|
|
||||||
X002850Y008850D03*
|
|
||||||
X001850Y008850D03*
|
|
||||||
X000850Y008850D03*
|
|
||||||
X000850Y007850D03*
|
|
||||||
X000850Y006850D03*
|
|
||||||
X000850Y005850D03*
|
|
||||||
X000850Y004850D03*
|
|
||||||
X000850Y003850D03*
|
|
||||||
X000850Y002850D03*
|
|
||||||
X000850Y001850D03*
|
|
||||||
X000850Y000850D03*
|
|
||||||
X001850Y000850D03*
|
|
||||||
X002850Y000850D03*
|
|
||||||
X003850Y000850D03*
|
|
||||||
X004850Y000850D03*
|
|
||||||
X005850Y000850D03*
|
|
||||||
X006850Y000850D03*
|
|
||||||
X007850Y000850D03*
|
|
||||||
X008850Y000850D03*
|
|
||||||
X009850Y000850D03*
|
|
||||||
X009850Y008850D03*
|
|
||||||
X008850Y008850D03*
|
|
||||||
X007850Y008850D03*
|
|
||||||
X006850Y008850D03*
|
|
||||||
X005850Y008850D03*
|
|
||||||
D15*
|
|
||||||
X001850Y004850D03*
|
|
||||||
X001850Y003850D03*
|
|
||||||
X001850Y002850D03*
|
|
||||||
D16*
|
|
||||||
X001850Y005850D03*
|
|
||||||
X001850Y006850D03*
|
|
||||||
D17*
|
|
||||||
X003350Y005850D02*
|
|
||||||
X004850Y005850D01*
|
|
||||||
X005350Y005350D01*
|
|
||||||
X006350Y005350D02*
|
|
||||||
X007850Y005350D01*
|
|
||||||
X007850Y006850D01*
|
|
||||||
X006850Y006850D01*
|
|
||||||
X005850Y006850D01*
|
|
||||||
X007850Y005350D02*
|
|
||||||
X007850Y004100D01*
|
|
||||||
X007350Y002350D02*
|
|
||||||
X008350Y002350D01*
|
|
||||||
X008850Y001850D01*
|
|
||||||
X003350Y003850D02*
|
|
||||||
X003350Y004850D01*
|
|
||||||
D18*
|
|
||||||
X007350Y002350D03*
|
|
||||||
M02*
|
|
|
@ -1,17 +0,0 @@
|
||||||
G75*
|
|
||||||
%MOIN*%
|
|
||||||
%OFA0B0*%
|
|
||||||
%FSLAX24Y24*%
|
|
||||||
%IPPOS*%
|
|
||||||
%LPD*%
|
|
||||||
%AMOC8*
|
|
||||||
5,1,8,0,0,1.08239X$1,22.5*
|
|
||||||
%
|
|
||||||
%ADD10C,0.0000*%
|
|
||||||
D10*
|
|
||||||
X000100Y000100D02*
|
|
||||||
X000100Y009596D01*
|
|
||||||
X010470Y009596D01*
|
|
||||||
X010470Y000100D01*
|
|
||||||
X000100Y000100D01*
|
|
||||||
M02*
|
|
|
@ -1,96 +0,0 @@
|
||||||
G75*
|
|
||||||
%MOIN*%
|
|
||||||
%OFA0B0*%
|
|
||||||
%FSLAX24Y24*%
|
|
||||||
%IPPOS*%
|
|
||||||
%LPD*%
|
|
||||||
%AMOC8*
|
|
||||||
5,1,8,0,0,1.08239X$1,22.5*
|
|
||||||
%
|
|
||||||
%ADD10C,0.0000*%
|
|
||||||
%ADD11OC8,0.0560*%
|
|
||||||
%ADD12OC8,0.0670*%
|
|
||||||
%ADD13C,0.0670*%
|
|
||||||
%ADD14OC8,0.0740*%
|
|
||||||
%ADD15C,0.0640*%
|
|
||||||
%ADD16OC8,0.0800*%
|
|
||||||
D10*
|
|
||||||
X000100Y000100D02*
|
|
||||||
X000100Y009596D01*
|
|
||||||
X010470Y009596D01*
|
|
||||||
X010470Y000100D01*
|
|
||||||
X000100Y000100D01*
|
|
||||||
D11*
|
|
||||||
X003350Y003850D03*
|
|
||||||
X004350Y003850D03*
|
|
||||||
X005100Y002850D03*
|
|
||||||
X005100Y001850D03*
|
|
||||||
X006350Y001850D03*
|
|
||||||
X006350Y002850D03*
|
|
||||||
X006100Y004100D03*
|
|
||||||
X007100Y004100D03*
|
|
||||||
X007850Y004100D03*
|
|
||||||
X008850Y004100D03*
|
|
||||||
X008850Y003100D03*
|
|
||||||
X007850Y003100D03*
|
|
||||||
X008850Y001850D03*
|
|
||||||
X009850Y001850D03*
|
|
||||||
X008850Y006850D03*
|
|
||||||
X008850Y007850D03*
|
|
||||||
X007850Y007850D03*
|
|
||||||
X006850Y007850D03*
|
|
||||||
X006850Y006850D03*
|
|
||||||
X007850Y006850D03*
|
|
||||||
X005850Y006850D03*
|
|
||||||
X004850Y006850D03*
|
|
||||||
X004850Y007850D03*
|
|
||||||
X005850Y007850D03*
|
|
||||||
X003600Y007850D03*
|
|
||||||
X002850Y007350D03*
|
|
||||||
X003600Y006850D03*
|
|
||||||
X003350Y005850D03*
|
|
||||||
X003350Y004850D03*
|
|
||||||
D12*
|
|
||||||
X002850Y002850D03*
|
|
||||||
X002850Y001850D03*
|
|
||||||
X006350Y005350D03*
|
|
||||||
X007850Y005350D03*
|
|
||||||
X008850Y005350D03*
|
|
||||||
D13*
|
|
||||||
X005350Y005350D03*
|
|
||||||
D14*
|
|
||||||
X004850Y008850D03*
|
|
||||||
X003850Y008850D03*
|
|
||||||
X002850Y008850D03*
|
|
||||||
X001850Y008850D03*
|
|
||||||
X000850Y008850D03*
|
|
||||||
X000850Y007850D03*
|
|
||||||
X000850Y006850D03*
|
|
||||||
X000850Y005850D03*
|
|
||||||
X000850Y004850D03*
|
|
||||||
X000850Y003850D03*
|
|
||||||
X000850Y002850D03*
|
|
||||||
X000850Y001850D03*
|
|
||||||
X000850Y000850D03*
|
|
||||||
X001850Y000850D03*
|
|
||||||
X002850Y000850D03*
|
|
||||||
X003850Y000850D03*
|
|
||||||
X004850Y000850D03*
|
|
||||||
X005850Y000850D03*
|
|
||||||
X006850Y000850D03*
|
|
||||||
X007850Y000850D03*
|
|
||||||
X008850Y000850D03*
|
|
||||||
X009850Y000850D03*
|
|
||||||
X009850Y008850D03*
|
|
||||||
X008850Y008850D03*
|
|
||||||
X007850Y008850D03*
|
|
||||||
X006850Y008850D03*
|
|
||||||
X005850Y008850D03*
|
|
||||||
D15*
|
|
||||||
X001850Y004850D03*
|
|
||||||
X001850Y003850D03*
|
|
||||||
X001850Y002850D03*
|
|
||||||
D16*
|
|
||||||
X001850Y005850D03*
|
|
||||||
X001850Y006850D03*
|
|
||||||
M02*
|
|
|
@ -1,79 +0,0 @@
|
||||||
%
|
|
||||||
M48
|
|
||||||
M72
|
|
||||||
T01C0.0236
|
|
||||||
T02C0.0320
|
|
||||||
T03C0.0400
|
|
||||||
%
|
|
||||||
T01
|
|
||||||
X7350Y2350
|
|
||||||
T02
|
|
||||||
X7850Y3100
|
|
||||||
X8850Y3100
|
|
||||||
X8850Y4100
|
|
||||||
X7850Y4100
|
|
||||||
X7100Y4100
|
|
||||||
X6100Y4100
|
|
||||||
X6350Y2850
|
|
||||||
X6350Y1850
|
|
||||||
X5100Y1850
|
|
||||||
X5100Y2850
|
|
||||||
X4350Y3850
|
|
||||||
X3350Y3850
|
|
||||||
X2850Y2850
|
|
||||||
X2850Y1850
|
|
||||||
X3350Y4850
|
|
||||||
X3350Y5850
|
|
||||||
X3600Y6850
|
|
||||||
X2850Y7350
|
|
||||||
X3600Y7850
|
|
||||||
X4850Y7850
|
|
||||||
X5850Y7850
|
|
||||||
X5850Y6850
|
|
||||||
X4850Y6850
|
|
||||||
X5350Y5350
|
|
||||||
X6350Y5350
|
|
||||||
X7850Y5350
|
|
||||||
X8850Y5350
|
|
||||||
X8850Y6850
|
|
||||||
X8850Y7850
|
|
||||||
X7850Y7850
|
|
||||||
X6850Y7850
|
|
||||||
X6850Y6850
|
|
||||||
X7850Y6850
|
|
||||||
X8850Y1850
|
|
||||||
X9850Y1850
|
|
||||||
T03
|
|
||||||
X850Y850
|
|
||||||
X1850Y850
|
|
||||||
X2850Y850
|
|
||||||
X3850Y850
|
|
||||||
X4850Y850
|
|
||||||
X5850Y850
|
|
||||||
X6850Y850
|
|
||||||
X7850Y850
|
|
||||||
X8850Y850
|
|
||||||
X9850Y850
|
|
||||||
X1850Y2850
|
|
||||||
X1850Y3850
|
|
||||||
X850Y3850
|
|
||||||
X850Y2850
|
|
||||||
X850Y1850
|
|
||||||
X850Y4850
|
|
||||||
X850Y5850
|
|
||||||
X850Y6850
|
|
||||||
X850Y7850
|
|
||||||
X1850Y6850
|
|
||||||
X1850Y5850
|
|
||||||
X1850Y4850
|
|
||||||
X1850Y8850
|
|
||||||
X2850Y8850
|
|
||||||
X3850Y8850
|
|
||||||
X4850Y8850
|
|
||||||
X5850Y8850
|
|
||||||
X6850Y8850
|
|
||||||
X7850Y8850
|
|
||||||
X8850Y8850
|
|
||||||
X9850Y8850
|
|
||||||
X850Y8850
|
|
||||||
M30
|
|
|
@ -1,38 +0,0 @@
|
||||||
Generated by EAGLE CAM Processor 6.5.0
|
|
||||||
|
|
||||||
Drill Station Info File: /home/markqvist/Source/eagle/ModemMicroduino/Modem.dri
|
|
||||||
|
|
||||||
Date : 4/30/14 1:15 PM
|
|
||||||
Drills : generated
|
|
||||||
Device : Excellon drill station
|
|
||||||
|
|
||||||
Parameter settings:
|
|
||||||
|
|
||||||
Tolerance Drill + : 0.00 %
|
|
||||||
Tolerance Drill - : 0.00 %
|
|
||||||
Rotate : no
|
|
||||||
Mirror : no
|
|
||||||
Optimize : yes
|
|
||||||
Auto fit : yes
|
|
||||||
OffsetX : 0inch
|
|
||||||
OffsetY : 0inch
|
|
||||||
Layers : Drills Holes
|
|
||||||
|
|
||||||
Drill File Info:
|
|
||||||
|
|
||||||
Data Mode : Absolute
|
|
||||||
Units : 1/10000 Inch
|
|
||||||
|
|
||||||
Drills used:
|
|
||||||
|
|
||||||
Code Size used
|
|
||||||
|
|
||||||
T01 0.0236inch 1
|
|
||||||
T02 0.0320inch 35
|
|
||||||
T03 0.0400inch 32
|
|
||||||
|
|
||||||
Total number of drills: 68
|
|
||||||
|
|
||||||
Plotfiles:
|
|
||||||
|
|
||||||
/home/markqvist/Source/eagle/ModemMicroduino/Modem.TXT
|
|
|
@ -1,45 +0,0 @@
|
||||||
Generated by EAGLE CAM Processor 6.5.0
|
|
||||||
|
|
||||||
Photoplotter Info File: /home/markqvist/Source/eagle/ModemMicroduino/Modem.gpi
|
|
||||||
|
|
||||||
Date : 4/30/14 1:15 PM
|
|
||||||
Plotfile : /home/markqvist/Source/eagle/ModemMicroduino/Modem.GTL
|
|
||||||
Apertures : generated:
|
|
||||||
Device : Gerber RS-274-X photoplotter, coordinate format 2.4 inch
|
|
||||||
|
|
||||||
Parameter settings:
|
|
||||||
|
|
||||||
Emulate Apertures : no
|
|
||||||
Tolerance Draw + : 0.00 %
|
|
||||||
Tolerance Draw - : 0.00 %
|
|
||||||
Tolerance Flash + : 0.00 %
|
|
||||||
Tolerance Flash - : 0.00 %
|
|
||||||
Rotate : no
|
|
||||||
Mirror : no
|
|
||||||
Optimize : yes
|
|
||||||
Auto fit : yes
|
|
||||||
OffsetX : 0inch
|
|
||||||
OffsetY : 0inch
|
|
||||||
|
|
||||||
Plotfile Info:
|
|
||||||
|
|
||||||
Coordinate Format : 2.4
|
|
||||||
Coordinate Units : Inch
|
|
||||||
Data Mode : Absolute
|
|
||||||
Zero Suppression : None
|
|
||||||
End Of Block : *
|
|
||||||
|
|
||||||
Apertures used:
|
|
||||||
|
|
||||||
Code Shape Size used
|
|
||||||
|
|
||||||
D10 draw 0.0000inch 4
|
|
||||||
D11 octagon 0.0520inch 29
|
|
||||||
D12 octagon 0.0630inch 5
|
|
||||||
D13 round 0.0630inch 1
|
|
||||||
D14 octagon 0.0700inch 27
|
|
||||||
D15 round 0.0600inch 3
|
|
||||||
D16 octagon 0.0760inch 2
|
|
||||||
D17 draw 0.0160inch 10
|
|
||||||
D18 square 0.0356inch 1
|
|
||||||
|
|
13930
Design/Eagle/Modem.s#1
13928
Design/Eagle/Modem.s#2
13928
Design/Eagle/Modem.s#3
13924
Design/Eagle/Modem.s#4
13724
Design/Eagle/Modem.s#5
13724
Design/Eagle/Modem.s#6
10176
Design/Eagle/Modem.s#7
14098
Design/Eagle/Modem.sch
|
@ -1,457 +0,0 @@
|
||||||
[Eagle]
|
|
||||||
Version="06 05 00"
|
|
||||||
Platform="Linux"
|
|
||||||
Serial="62191E841E-LSR-WLM-1EL"
|
|
||||||
Globals="Globals"
|
|
||||||
Desktop="Desktop"
|
|
||||||
|
|
||||||
[Globals]
|
|
||||||
AutoSaveProject=1
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/19inch.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/40xx.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/41xx.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/45xx.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/74ac-logic.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/74ttl-din.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/74xx-eu.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/74xx-little-de.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/74xx-little-us.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/74xx-us.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/751xx.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/adafruit.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/advanced-test-technologies.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/agilent-technologies.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/allegro.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/altera-cyclone-II.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/altera-cyclone-III.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/altera-stratix-iv.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/altera.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/am29-memory.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/amd-mach.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/amd.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/amis.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/analog-devices.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/aplus.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/ase.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/atmel.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/austriamicrosystems.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/avago.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/axis.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/battery.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/belton-engineering.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/burr-brown.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/busbar.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/buzzer.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/c-trimm.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/california-micro-devices.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/capacitor-wima.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/chipcard-siemens.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/cirrus-logic.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-3m.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-4ucon.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-amp-champ.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-amp-micromatch.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-amp-mt.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-amp-mt6.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-amp-quick.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-amp-te.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-amp.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-amphenol.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-avx.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-berg.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-bosch.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-chipcard-iso7816.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-coax.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-commcon.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-conrad.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-cpci.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-cui.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-cypressindustries.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-deutsch.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-dil.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-ebyelectro.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-elco.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-erni.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-faston.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-fci.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-friwo.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-garry.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-harting-h.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-harting-ml.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-harting-v.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-harting.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-hirose.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-hirschmann.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-jack.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-jae.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-jst.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-kycon.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-kyocera-elco.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-lemo.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-leotronics.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-lsta.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-lstb.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-lumberg.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-ml.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-molex.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-neutrik_ag.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-omron.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-panasonic.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-panduit.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-pc.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-pc104.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-phoenix-254.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-phoenix-3.81.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-phoenix-350.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-phoenix-500.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-phoenix-508.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-phoenix-762.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-phoenix-me_max.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-phoenix-mkds_5.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-phoenix-smkdsp.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-ptr500.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-pulse.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-rib.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-samtec.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-shallin.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-shiua-chyuan.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-stewart.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-stocko.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-subd.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-sullinselectronics.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-thomas-betts.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-tyco.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-tycoelectronics.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-vg.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-wago-500.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-wago-508.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-wago.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-wago255.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-weidmueller-sl35.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-wenzhou-yihua.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-xmultiple.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/con-yamaichi.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/crystal.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/csr.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/cypress.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/davicom.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/dc-dc-converter.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/dimensions.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/diode.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/discrete.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/display-hp.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/display-kingbright.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/display-lcd.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/docu-dummy.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/eagle-ltspice.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/ecl.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/em-microelectronic.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/etx-board.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/exar.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/fairchild-semic.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/farnell.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/fiber-optic-hp.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/fiber-optic-siemens.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/fifo.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/flexipanel.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/fox-electronics.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/frames.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/freescale.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/ftdichip.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/fujitsu.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/fuse.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/gennum.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/halo-electronics.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/heatsink.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/holes.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/holtek.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/ic-package.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/inductor-coilcraft.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/inductor-neosid.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/inductor-nkl.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/inductors.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/infineon-tricore.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/infineon.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/intersil-techwell.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/intersil.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/ir.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/isd.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/johanson-technology.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/jump-0r-smd.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/jumper.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/lantronix.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/lattice.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/lc-filter.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/led-7-segment.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/led-citizen-electronics.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/led-lumiled.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/led.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/lem.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/linear-technology.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/linear.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/linx.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/logo.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/lprs.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/lsi-computer-systems.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/lumiled.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/marks.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/maxim.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/maxstream.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/melexis.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/memory-hitachi.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/memory-idt.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/memory-micron.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/memory-motorola-dram.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/memory-nec.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/memory-samsung.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/memory-sram.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/memory.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/mems.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micrel.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-cyrod.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-fujitsu.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-harris.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-hitachi.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-infineon.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-intel.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-mc68000.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-motorola.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-philips.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-renesas.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-samsung.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micro-siemens.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/microchip.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micron.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/micronas.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/microphon.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/microwave.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/midori-sensor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/minicircuits.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/mitsubishi-semiconductor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/motorola-sensor-driver.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/murata-filter.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/murata-sensor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/nanotec.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/national-instruments.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/national-semiconductor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/nec-lqfp100-pack.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/nec.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/nrj-semiconductor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/omnivision.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/on-semiconductor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/opto-honeywell-3000.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/opto-honeywell-4000.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/opto-honeywell.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/opto-micro-linear.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/opto-trans-siemens.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/opto-transmittter-hp.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/opto-vishay.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/optocoupler.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/pal.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/philips-semiconductors.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/photo-elements.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/piher.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/pinhead.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/plcc-socket.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/pld-intel.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/plxtech.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/pot-vitrohm.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/pot-xicor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/pot.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/ptc-ntc.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/quantum-research-group.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/rcl.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/recom-international.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/rectifier.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/ref-packages-longpad.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/ref-packages.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/relay.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/renesas.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/resistor-bourns.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/resistor-dil.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/resistor-net.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/resistor-power.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/resistor-ruf.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/resistor-shunt.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/resistor-sil.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/resistor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/rf-micro-devices.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/rf-solutions.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/rohm.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/semicon-smd-ipc.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/sensor-comus-group.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/sensor-heraeus.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/sensor-infratec.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/sharp.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/silabs.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/sim-technology.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/sipex.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/smd-ipc.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/smd-special.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/solomon-systech.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/solpad.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/special-drill.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/special.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/st-microelectronics.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/supertex.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/supply1.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/supply2.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/switch-alps.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/switch-coto.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/switch-dil.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/switch-misc.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/switch-omron.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/switch-raychem.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/switch-reed.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/switch.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/telcom.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/telecontrolli.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/telefunken.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/testpad.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/texas-sn55-sn75.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/texas.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/toshiba.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/traco-electronic.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/trafo-bei.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/trafo-hammondmfg.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/trafo-siemens.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/trafo-xicon.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/trafo.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/transformer-pulse.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/transistor-fet.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/transistor-neu-to92.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/transistor-npn.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/transistor-pnp.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/transistor-power.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/transistor-small-signal.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/transistor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/triac.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/trimble.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/tripas.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/u-blox.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/uln-udn.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/v-reg-micrel.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/v-reg.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/varistor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/wafer-scale-psd.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/wirepad.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/xicor.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/xilinx-virtex-v5.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/xilinx-xc18v.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/xilinx-xc9.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/xilinx-xcv.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/zetex.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/zilog.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/seeed/Connector .lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/seeed/Discrete.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/seeed/IC.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/seeed/Logo.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/seeed/OPL.lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/seeed/Power or GND .lbr"
|
|
||||||
UsedLibrary="/home/markqvist/.eagle/lbr/seeed/template.lbr"
|
|
||||||
|
|
||||||
[Win_1]
|
|
||||||
Type="Board Editor"
|
|
||||||
Loc="1419 129 3158 1545"
|
|
||||||
State=2
|
|
||||||
Number=1
|
|
||||||
File="Modem.brd"
|
|
||||||
View="16.6201 48.4106 44.2249 73.4954"
|
|
||||||
WireWidths=" 0 0.254 0.3048 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0.4064"
|
|
||||||
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
|
|
||||||
PadDrills=" 0.5 0.6 0.7 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.8"
|
|
||||||
ViaDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
|
|
||||||
ViaDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
|
|
||||||
HoleDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
|
|
||||||
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
|
|
||||||
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
|
|
||||||
PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
|
|
||||||
MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
|
|
||||||
DimensionWidths=" 0 0.127 0.254 0.1 0.26 0.13"
|
|
||||||
DimensionExtWidths=" 0.127 0.254 0.1 0.13 0.26 0"
|
|
||||||
DimensionExtLengths=" 1.27 2.54 1 2 3 0"
|
|
||||||
DimensionExtOffsets=" 1.27 2.54 1 2 3 0"
|
|
||||||
SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
|
|
||||||
WireBend=0
|
|
||||||
WireBendSet=0
|
|
||||||
WireCap=1
|
|
||||||
MiterStyle=0
|
|
||||||
PadShape=0
|
|
||||||
ViaShape=0
|
|
||||||
PolygonPour=0
|
|
||||||
PolygonRank=1
|
|
||||||
PolygonThermals=1
|
|
||||||
PolygonOrphans=0
|
|
||||||
TextRatio=8
|
|
||||||
DimensionUnit=1
|
|
||||||
DimensionPrecision=2
|
|
||||||
DimensionShowUnit=0
|
|
||||||
PinDirection=3
|
|
||||||
PinFunction=0
|
|
||||||
PinLength=2
|
|
||||||
PinVisible=3
|
|
||||||
SwapLevel=0
|
|
||||||
ArcDirection=0
|
|
||||||
AddLevel=2
|
|
||||||
PadsSameType=0
|
|
||||||
Layer=16
|
|
||||||
|
|
||||||
[Win_2]
|
|
||||||
Type="Schematic Editor"
|
|
||||||
Loc="174 580 1517 1623"
|
|
||||||
State=2
|
|
||||||
Number=2
|
|
||||||
File="Modem.sch"
|
|
||||||
View="-46.0901 17.4339 153.495 136.69"
|
|
||||||
WireWidths=" 0 0.3048 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0.4064 0.1524"
|
|
||||||
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
|
|
||||||
PadDrills=" 0.5 0.6 0.7 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.8"
|
|
||||||
ViaDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
|
|
||||||
ViaDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
|
|
||||||
HoleDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
|
|
||||||
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
|
|
||||||
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
|
|
||||||
PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
|
|
||||||
MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
|
|
||||||
DimensionWidths=" 0 0.127 0.254 0.1 0.26 0.13"
|
|
||||||
DimensionExtWidths=" 0.127 0.254 0.1 0.13 0.26 0"
|
|
||||||
DimensionExtLengths=" 1.27 2.54 1 2 3 0"
|
|
||||||
DimensionExtOffsets=" 1.27 2.54 1 2 3 0"
|
|
||||||
SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
|
|
||||||
WireBend=0
|
|
||||||
WireBendSet=31
|
|
||||||
WireCap=1
|
|
||||||
MiterStyle=0
|
|
||||||
PadShape=0
|
|
||||||
ViaShape=0
|
|
||||||
PolygonPour=0
|
|
||||||
PolygonRank=0
|
|
||||||
PolygonThermals=1
|
|
||||||
PolygonOrphans=0
|
|
||||||
TextRatio=8
|
|
||||||
DimensionUnit=1
|
|
||||||
DimensionPrecision=2
|
|
||||||
DimensionShowUnit=0
|
|
||||||
PinDirection=3
|
|
||||||
PinFunction=0
|
|
||||||
PinLength=2
|
|
||||||
PinVisible=3
|
|
||||||
SwapLevel=0
|
|
||||||
ArcDirection=0
|
|
||||||
AddLevel=2
|
|
||||||
PadsSameType=0
|
|
||||||
Layer=91
|
|
||||||
Views=" 1: -46.0901 17.4339 153.495 136.69"
|
|
||||||
Sheet=1
|
|
||||||
|
|
||||||
[Win_3]
|
|
||||||
Type="Control Panel"
|
|
||||||
Loc="42 77 1135 697"
|
|
||||||
State=2
|
|
||||||
Number=0
|
|
||||||
|
|
||||||
[Desktop]
|
|
||||||
Screen="3200 1800"
|
|
||||||
Window="Win_1"
|
|
||||||
Window="Win_2"
|
|
||||||
Window="Win_3"
|
|
Before Width: | Height: | Size: 422 KiB |
Before Width: | Height: | Size: 387 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 399 KiB |
Before Width: | Height: | Size: 450 KiB |
Before Width: | Height: | Size: 537 KiB |
Before Width: | Height: | Size: 702 KiB |
|
@ -1,137 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright 2014 Institute IRNAS Race - S56MC - Musti, musti@irnas.eu
|
|
||||||
|
|
||||||
MicroAprsNavspark is to be used with NavSpark Arduino environment, for more information visit http://navspark.com.tw
|
|
||||||
|
|
||||||
The MicroAprsNavspark is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by the
|
|
||||||
Free Software Foundation, either version 3 of the License, or (at your
|
|
||||||
option) any later version.
|
|
||||||
|
|
||||||
The MicroAprsNavspark is distributed in the hope that it will be useful, but
|
|
||||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
||||||
or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
See the GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along
|
|
||||||
with the MicroAprsNavspark. If not, see http://www.gnu.org/licenses/.
|
|
||||||
*/
|
|
||||||
#include "sti_gnss_lib.h"
|
|
||||||
#include "GNSS.h"
|
|
||||||
|
|
||||||
#define POSITIONRATE 60 // periodically send the location - in seconds
|
|
||||||
uint16_t delayer = 0;
|
|
||||||
uint8_t gpio_bit = 0;
|
|
||||||
|
|
||||||
// Generally, you shuould use "unsigned long" for variables that hold time
|
|
||||||
// The value will quickly become too large for an int to store
|
|
||||||
unsigned long previousMillis = 0; // will store last time LED was updated
|
|
||||||
float lla_deg=0;
|
|
||||||
float lla_min=0;
|
|
||||||
float llo_deg=0;
|
|
||||||
float llo_min=0;
|
|
||||||
float lla=0;
|
|
||||||
float llo=0;
|
|
||||||
|
|
||||||
void setup() {
|
|
||||||
// put your setup code here, to run once:
|
|
||||||
GnssConf.setNavMode(STGNSS_NAV_MODE_AUTO);
|
|
||||||
GnssConf.setUpdateRate(STGNSS_POSITION_UPDATE_RATE_1HZ);
|
|
||||||
GnssConf.setDopMaskMode(STGNSS_DOP_MASK_AUTO);
|
|
||||||
GnssConf.setPdopMask(30.0);
|
|
||||||
GnssConf.setHdopMask(30.0);
|
|
||||||
GnssConf.setGdopMask(30.0);
|
|
||||||
GnssConf.init(); /* do initialization for GNSS */
|
|
||||||
gnss_gpio_set_output(gpio_bit);
|
|
||||||
|
|
||||||
//set up the serail port to talk to MicroAPRS
|
|
||||||
Serial.config(STGNSS_UART_8BITS_WORD_LENGTH, STGNSS_UART_1STOP_BITS, STGNSS_UART_NOPARITY);
|
|
||||||
Serial.begin(9600);
|
|
||||||
//configure the reset pin and reset MicroAPRS
|
|
||||||
pinMode(14,OUTPUT);
|
|
||||||
digitalWrite(14,LOW);
|
|
||||||
delay(100);
|
|
||||||
digitalWrite(14,HIGH);
|
|
||||||
delay(100);
|
|
||||||
// send settings
|
|
||||||
configureMicroAPRS();
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
// put your main code here, to run repeatedly:
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void configureMicroAPRS(){
|
|
||||||
Serial.println("c<CALL>"); //callsign
|
|
||||||
Serial.println("sc7"); //SSID
|
|
||||||
Serial.println("S"); //save
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
NOTE: "task_called_after_GNSS_update()" will be called about every second
|
|
||||||
(for 1Hz update rate), so we display the info. here.
|
|
||||||
*/
|
|
||||||
void task_called_after_GNSS_update(void)
|
|
||||||
{
|
|
||||||
static uint8_t val = 0;
|
|
||||||
char buf[64];
|
|
||||||
|
|
||||||
//blinking the blue LED
|
|
||||||
if (val == 1) gnss_gpio_high(gpio_bit);
|
|
||||||
else gnss_gpio_low(gpio_bit);
|
|
||||||
val = 1 - val;
|
|
||||||
|
|
||||||
//triggering the position update on the defined interval
|
|
||||||
delayer++;
|
|
||||||
if(delayer>POSITIONRATE){
|
|
||||||
aprs_send();
|
|
||||||
delayer=0;
|
|
||||||
}
|
|
||||||
//send the counter state to PC serial port
|
|
||||||
int len = sprintf(buf, "Counter: %d\r\n",delayer);
|
|
||||||
gnss_uart_putline(0,(U08*)buf,len);
|
|
||||||
}
|
|
||||||
|
|
||||||
void aprs_send(){
|
|
||||||
char buf[64];
|
|
||||||
char lla_sign;
|
|
||||||
char llo_sign;
|
|
||||||
// first get the updated location
|
|
||||||
GnssInfo.update();
|
|
||||||
|
|
||||||
//check if the location has been updated - valid fix
|
|
||||||
if (GnssInfo.isUpdated() == true) {
|
|
||||||
//get location information
|
|
||||||
lla=GnssInfo.location.latitude();
|
|
||||||
llo=GnssInfo.location.longitude();
|
|
||||||
|
|
||||||
//determine hemisphere
|
|
||||||
if(lla>=0){
|
|
||||||
lla_sign=0x4e; //capital N
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
lla_sign=0x53; //capital S
|
|
||||||
lla*=-1;//make the number positive
|
|
||||||
}
|
|
||||||
if(llo>=0){
|
|
||||||
llo_sign=0x45; //capital E
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
llo_sign=0x57; //capital W
|
|
||||||
llo*=-1;//make the number positive
|
|
||||||
}
|
|
||||||
|
|
||||||
//convert it to deg, min format
|
|
||||||
lla_deg=(int)lla;
|
|
||||||
lla_min=(lla-lla_deg)*60;
|
|
||||||
llo_deg=(int)llo;
|
|
||||||
llo_min=(llo-llo_deg)*60;
|
|
||||||
|
|
||||||
//print to serial port
|
|
||||||
uint8_t len=sprintf(buf, "!=%02.0f%.2f%c/%03.0f%.2f%c-PHG2/3060/MicroAPRS+Navspark\r\n",lla_deg,lla_min,lla_sign,llo_deg,llo_min,llo_sign);
|
|
||||||
Serial.print(buf);
|
|
||||||
gnss_uart_putline(0,(U08*)buf,len);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
Standalone MicroAPRS + Navspark GPS
|
|
||||||
==========
|
|
||||||
|
|
||||||
Standalone MicroAPRS + Navspark GPS module is the is fork of [MicroAPRS](https://github.com/markqvist/MicroAPRS). It is a standalone arduino compatible board with modem circuitry acting as a daughter board for [NavSpark](http://navspark.com.tw/) GPS/Glonass/Beidu Arduino compatible modules.
|
|
||||||
|
|
||||||
Please read the Mcicro APRS documentation prior to continuing here.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- Arduino Pro Mini 5V 16MHz compatible hardware design
|
|
||||||
- MicroAPRS modem design, with some component values tweaked
|
|
||||||
- Compatible with Wouxun/Baofeng low-cost radios that have a 3.5mm+2.5mm jack connection. UV-5R is a good choice.
|
|
||||||
- Powered either from USB via Navspark or from battery via Navspark on-board regulator
|
|
||||||
- Support for use of DS18B20 temperature sensors
|
|
||||||
- ADC channel with a divider for reading the battery voltage level
|
|
||||||
|
|
||||||
![MicroAPRSNavspark](https://raw.githubusercontent.com/IRNAS/MicroAPRS/master/DesignMicroAPRSNavspark/photos/navspark-microaprs-1.jpg)
|
|
||||||
|
|
||||||
## Instructions
|
|
||||||
|
|
||||||
Get the PCB manufactured with your preferred source, gerber files are published here. Solder the circuit and upload MicroAPRS code. Program Navspark with the code published here, modify it to contain you callsign and SSID. Enjoy.
|
|
||||||
|
|
||||||
By default location updates will be sent out ever 60s when then location fix is obtained.
|
|
||||||
|
|
||||||
### ToDo
|
|
||||||
|
|
||||||
Currently this this tracking system is very simple and sends a location update at a fixed interval. With NavSpark library it is possible to get the distance and many other parameters, creating a smarter location update mechanism.
|
|
||||||
|
|
||||||
The code can be cleaned up and optimized.
|
|
||||||
|
|
||||||
Create a 3D printed enclosure that clips to a radio and powers the circuit from its charging contacts.
|
|
||||||
|
|
||||||
Optimize the Navspark Arduino applicaton for power consumption.
|
|
||||||
|
|
||||||
|
|
||||||
![MicroAPRSNavspark](https://raw.githubusercontent.com/IRNAS/MicroAPRS/master/DesignMicroAPRSNavspark/photos/navspark-microaprs-2.jpg)
|
|
||||||
![MicroAPRSNavspark](https://raw.githubusercontent.com/IRNAS/MicroAPRS/master/DesignMicroAPRSNavspark/photos/navspark-microaprs-3.jpg)
|
|
||||||
![MicroAPRSNavspark](https://raw.githubusercontent.com/IRNAS/MicroAPRS/master/DesignMicroAPRSNavspark/photos/navspark-microaprs-4.jpg)
|
|
Before Width: | Height: | Size: 284 KiB |
Before Width: | Height: | Size: 211 KiB |
Before Width: | Height: | Size: 278 KiB |
Before Width: | Height: | Size: 290 KiB |
BIN
Design/PCB.pdf
|
@ -1,18 +0,0 @@
|
||||||
Version 1.24: (courtesy of Nils Eilers)
|
|
||||||
-- fixed exit code on success to be 0 instead of EINVAL
|
|
||||||
-- added --self-powered flag
|
|
||||||
Version 1.23:
|
|
||||||
-- added GPLv2 licensing.
|
|
||||||
Version 1.22:
|
|
||||||
-- try again to preserve USB version from eeprom.
|
|
||||||
Version 1.21:
|
|
||||||
-- preserve USB version from eeprom; libusb no longer does this correctly (sigh).
|
|
||||||
Version 1.10:
|
|
||||||
-- now able to invert _all_ the serial and handshake lines (not just DTR).
|
|
||||||
(courtesy of Jonas Meyer, thanks!)
|
|
||||||
Version 1.09:
|
|
||||||
Version 1.08:
|
|
||||||
-- fix compiler warning from newer gcc
|
|
||||||
-- Makefile fixes for latest Ubuntu & binutils
|
|
||||||
Version 1.06:
|
|
||||||
-- fix libftdi-0.19 API breakage by not using "BM_type_chip" from libftdi0-0.18.
|
|
|
@ -1,341 +0,0 @@
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 2, June 1991
|
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
|
||||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
software--to make sure the software is free for all its users. This
|
|
||||||
General Public License applies to most of the Free Software
|
|
||||||
Foundation's software and to any other program whose authors commit to
|
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
this service if you wish), that you receive source code or can get it
|
|
||||||
if you want it, that you can change the software or use pieces of it
|
|
||||||
in new free programs; and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
|
||||||
These restrictions translate to certain responsibilities for you if you
|
|
||||||
distribute copies of the software, or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
|
||||||
you have. You must make sure that they, too, receive or can get the
|
|
||||||
source code. And you must show them these terms so they know their
|
|
||||||
rights.
|
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
|
||||||
distribute and/or modify the software.
|
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
|
||||||
that everyone understands that there is no warranty for this free
|
|
||||||
software. If the software is modified by someone else and passed on, we
|
|
||||||
want its recipients to know that what they have is not the original, so
|
|
||||||
that any problems introduced by others will not reflect on the original
|
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
|
||||||
program will individually obtain patent licenses, in effect making the
|
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
|
||||||
patent must be licensed for everyone's free use or not licensed at all.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running the Program is not restricted, and the output from the Program
|
|
||||||
is covered only if its contents constitute a work based on the
|
|
||||||
Program (independent of having been made by running the Program).
|
|
||||||
Whether that is true depends on what the Program does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Program's
|
|
||||||
source code as you receive it, in any medium, provided that you
|
|
||||||
conspicuously and appropriately publish on each copy an appropriate
|
|
||||||
copyright notice and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any warranty;
|
|
||||||
and give any other recipients of the Program a copy of this License
|
|
||||||
along with the Program.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy, and
|
|
||||||
you may at your option offer warranty protection in exchange for a fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Program or any portion
|
|
||||||
of it, thus forming a work based on the Program, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) You must cause the modified files to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
|
||||||
whole or in part contains or is derived from the Program or any
|
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
|
||||||
when run, you must cause it, when started running for such
|
|
||||||
interactive use in the most ordinary way, to print or display an
|
|
||||||
announcement including an appropriate copyright notice and a
|
|
||||||
notice that there is no warranty (or else, saying that you provide
|
|
||||||
a warranty) and that users may redistribute the program under
|
|
||||||
these conditions, and telling the user how to view a copy of this
|
|
||||||
License. (Exception: if the Program itself is interactive but
|
|
||||||
does not normally print such an announcement, your work based on
|
|
||||||
the Program is not required to print an announcement.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Program,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Program, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
|
||||||
under Section 2) in object code or executable form under the terms of
|
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
|
||||||
|
|
||||||
a) Accompany it with the complete corresponding machine-readable
|
|
||||||
source code, which must be distributed under the terms of Sections
|
|
||||||
1 and 2 above on a medium customarily used for software interchange; or,
|
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
|
||||||
years, to give any third party, for a charge no more than your
|
|
||||||
cost of physically performing source distribution, a complete
|
|
||||||
machine-readable copy of the corresponding source code, to be
|
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
|
||||||
to distribute corresponding source code. (This alternative is
|
|
||||||
allowed only for noncommercial distribution and only if you
|
|
||||||
received the program in object code or executable form with such
|
|
||||||
an offer, in accord with Subsection b above.)
|
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For an executable work, complete source
|
|
||||||
code means all the source code for all modules it contains, plus any
|
|
||||||
associated interface definition files, plus the scripts used to
|
|
||||||
control compilation and installation of the executable. However, as a
|
|
||||||
special exception, the source code distributed need not include
|
|
||||||
anything that is normally distributed (in either source or binary
|
|
||||||
form) with the major components (compiler, kernel, and so on) of the
|
|
||||||
operating system on which the executable runs, unless that component
|
|
||||||
itself accompanies the executable.
|
|
||||||
|
|
||||||
If distribution of executable or object code is made by offering
|
|
||||||
access to copy from a designated place, then offering equivalent
|
|
||||||
access to copy the source code from the same place counts as
|
|
||||||
distribution of the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
|
||||||
except as expressly provided under this License. Any attempt
|
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
|
||||||
void, and will automatically terminate your rights under this License.
|
|
||||||
However, parties who have received copies, or rights, from you under
|
|
||||||
this License will not have their licenses terminated so long as such
|
|
||||||
parties remain in full compliance.
|
|
||||||
|
|
||||||
5. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Program or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Program (or any work based on the
|
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Program or works based on it.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program subject to
|
|
||||||
these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties to
|
|
||||||
this License.
|
|
||||||
|
|
||||||
7. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Program at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Program by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Program.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under
|
|
||||||
any particular circumstance, the balance of the section is intended to
|
|
||||||
apply and the section as a whole is intended to apply in other
|
|
||||||
circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system, which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Program under this License
|
|
||||||
may add an explicit geographical distribution limitation excluding
|
|
||||||
those countries, so that distribution is permitted only in or among
|
|
||||||
countries not thus excluded. In such case, this License incorporates
|
|
||||||
the limitation as if written in the body of this License.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
|
||||||
specifies a version number of this License which applies to it and "any
|
|
||||||
later version", you have the option of following the terms and conditions
|
|
||||||
either of that version or of any later version published by the Free
|
|
||||||
Software Foundation. If the Program does not specify a version number of
|
|
||||||
this License, you may choose any version ever published by the Free Software
|
|
||||||
Foundation.
|
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
|
||||||
programs whose distribution conditions are different, write to the author
|
|
||||||
to ask for permission. For software which is copyrighted by the Free
|
|
||||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
|
||||||
make exceptions for this. Our decision will be guided by the two goals
|
|
||||||
of preserving the free status of all derivatives of our free software and
|
|
||||||
of promoting the sharing and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
|
||||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
||||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
||||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
||||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
||||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
||||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
||||||
REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
|
||||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
|
||||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
|
||||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
|
||||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
convey the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program is interactive, make it output a short notice like this
|
|
||||||
when it starts in an interactive mode:
|
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) year name of author
|
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, the commands you use may
|
|
||||||
be called something other than `show w' and `show c'; they could even be
|
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1989
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
This General Public License does not permit incorporating your program into
|
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
|
||||||
consider it more useful to permit linking proprietary applications with the
|
|
||||||
library. If this is what you want to do, use the GNU Library General
|
|
||||||
Public License instead of this License.
|
|
|
@ -1,11 +0,0 @@
|
||||||
CFLAGS = -Wall -O2 -s -Werror
|
|
||||||
LDFLAGS = -lusb -lftdi -s
|
|
||||||
PROG = ft232r_prog
|
|
||||||
|
|
||||||
all: $(PROG)
|
|
||||||
|
|
||||||
$(PROG): $(PROG).c
|
|
||||||
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(PROG)
|
|
|
@ -1,814 +0,0 @@
|
||||||
/*
|
|
||||||
* ft232r_prog.c by Mark Lord. Copyright 2010-2013.
|
|
||||||
*
|
|
||||||
* This is a Linux command-line alternative to the FTDI MProg/FTProg utilities.
|
|
||||||
* It is known to work only for FT232R chips at this time.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; see the file LICENSE.txt. If not, write to
|
|
||||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <ftdi.h>
|
|
||||||
|
|
||||||
#define MYVERSION "1.24"
|
|
||||||
|
|
||||||
static struct ftdi_context ftdi;
|
|
||||||
static int verbose = 0;
|
|
||||||
static const char *save_path = NULL, *restore_path = NULL;
|
|
||||||
|
|
||||||
enum cbus_mode {
|
|
||||||
cbus_txden = 0,
|
|
||||||
cbus_pwren = 1,
|
|
||||||
cbus_rxled = 2,
|
|
||||||
cbus_txled = 3,
|
|
||||||
cbus_txrxled = 4,
|
|
||||||
cbus_sleep = 5,
|
|
||||||
cbus_clk48 = 6,
|
|
||||||
cbus_clk24 = 7,
|
|
||||||
cbus_clk12 = 8,
|
|
||||||
cbus_clk6 = 9,
|
|
||||||
cbus_io = 10,
|
|
||||||
cbus_wr = 11,
|
|
||||||
cbus_rd = 12,
|
|
||||||
cbus_rxf = 13,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *cbus_mode_strings[] = {
|
|
||||||
"TxDEN",
|
|
||||||
"PwrEn",
|
|
||||||
"RxLED",
|
|
||||||
"TxLED",
|
|
||||||
"TxRxLED",
|
|
||||||
"Sleep",
|
|
||||||
"Clk48",
|
|
||||||
"Clk24",
|
|
||||||
"Clk12",
|
|
||||||
"Clk6",
|
|
||||||
"IO",
|
|
||||||
"WR",
|
|
||||||
"RD",
|
|
||||||
"RxF",
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
enum arg_type {
|
|
||||||
arg_help,
|
|
||||||
arg_dump,
|
|
||||||
arg_verbose,
|
|
||||||
arg_save,
|
|
||||||
arg_restore,
|
|
||||||
arg_cbus0,
|
|
||||||
arg_cbus1,
|
|
||||||
arg_cbus2,
|
|
||||||
arg_cbus3,
|
|
||||||
arg_cbus4,
|
|
||||||
arg_manufacturer,
|
|
||||||
arg_product,
|
|
||||||
arg_old_serno,
|
|
||||||
arg_new_serno,
|
|
||||||
arg_self_powered,
|
|
||||||
arg_max_bus_power,
|
|
||||||
arg_high_current_io,
|
|
||||||
arg_suspend_pull_down,
|
|
||||||
arg_old_vid,
|
|
||||||
arg_old_pid,
|
|
||||||
arg_new_vid,
|
|
||||||
arg_new_pid,
|
|
||||||
arg_invert_txd,
|
|
||||||
arg_invert_rxd,
|
|
||||||
arg_invert_rts,
|
|
||||||
arg_invert_cts,
|
|
||||||
arg_invert_dtr,
|
|
||||||
arg_invert_dsr,
|
|
||||||
arg_invert_dcd,
|
|
||||||
arg_invert_ri,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *arg_type_strings[] = {
|
|
||||||
"--help",
|
|
||||||
"--dump",
|
|
||||||
"--verbose",
|
|
||||||
"--save",
|
|
||||||
"--restore",
|
|
||||||
"--cbus0",
|
|
||||||
"--cbus1",
|
|
||||||
"--cbus2",
|
|
||||||
"--cbus3",
|
|
||||||
"--cbus4",
|
|
||||||
"--manufacturer",
|
|
||||||
"--product",
|
|
||||||
"--old-serial-number",
|
|
||||||
"--new-serial-number",
|
|
||||||
"--self-powered",
|
|
||||||
"--max-bus-power",
|
|
||||||
"--high-current-io",
|
|
||||||
"--suspend-pull-down",
|
|
||||||
"--old-vid",
|
|
||||||
"--old-pid",
|
|
||||||
"--new-vid",
|
|
||||||
"--new-pid",
|
|
||||||
"--invert_txd",
|
|
||||||
"--invert_rxd",
|
|
||||||
"--invert_rts",
|
|
||||||
"--invert_cts",
|
|
||||||
"--invert_dtr",
|
|
||||||
"--invert_dsr",
|
|
||||||
"--invert_dcd",
|
|
||||||
"--invert_ri",
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *arg_type_help[] = {
|
|
||||||
" # (show this help text)",
|
|
||||||
" # (dump eeprom settings to stdout))",
|
|
||||||
"# (show debug info and raw eeprom contents)",
|
|
||||||
" # (save original eeprom contents to file)",
|
|
||||||
"# (restore initial eeprom contents from file)",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
" <string> # (new USB manufacturer string)",
|
|
||||||
" <string> # (new USB product name string)",
|
|
||||||
"<string> # (current serial number of device to be reprogrammed)",
|
|
||||||
"<string> # (new USB serial number string)",
|
|
||||||
" [on|off] # (self powered)",
|
|
||||||
" <number> # (max bus current in milli-amperes)",
|
|
||||||
" [on|off] # (enable high [6mA @ 5V] drive current on CBUS pins)",
|
|
||||||
"[on|off] # (force I/O pins into logic low state on suspend)",
|
|
||||||
" <number> # (current vendor id of device to be reprogrammed, eg. 0x0403)",
|
|
||||||
" <number> # (current product id of device to be reprogrammed, eg. 0x6001)",
|
|
||||||
" <number> # (new/custom vendor id to be programmed)",
|
|
||||||
" <number> # (new/custom product id be programmed)",
|
|
||||||
" Inverts the current value of TXD",
|
|
||||||
" Inverts the current value of RXD",
|
|
||||||
" Inverts the current value of RTS",
|
|
||||||
" Inverts the current value of CTS",
|
|
||||||
" Inverts the current value of DTR",
|
|
||||||
" Inverts the current value of DSR",
|
|
||||||
" Inverts the current value of DCD",
|
|
||||||
" Inverts the current value of RI",
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *bool_strings[] = {
|
|
||||||
"off",
|
|
||||||
"on",
|
|
||||||
"0",
|
|
||||||
"1",
|
|
||||||
"no",
|
|
||||||
"yes",
|
|
||||||
"disable",
|
|
||||||
"enable",
|
|
||||||
};
|
|
||||||
|
|
||||||
struct eeprom_fields {
|
|
||||||
unsigned char byte01;
|
|
||||||
unsigned char high_current_io; /* bool */
|
|
||||||
unsigned char load_d2xx_driver; /* bool */
|
|
||||||
unsigned char txd_inverted; /* bool */
|
|
||||||
unsigned char rxd_inverted; /* bool */
|
|
||||||
unsigned char rts_inverted; /* bool */
|
|
||||||
unsigned char cts_inverted; /* bool */
|
|
||||||
unsigned char dtr_inverted; /* bool */
|
|
||||||
unsigned char dsr_inverted; /* bool */
|
|
||||||
unsigned char dcd_inverted; /* bool */
|
|
||||||
unsigned char ri_inverted; /* bool */
|
|
||||||
unsigned char pnp_enabled; /* bool */
|
|
||||||
enum cbus_mode cbus[5];
|
|
||||||
unsigned char extras[112]; /* extra, undefined fields */
|
|
||||||
struct ftdi_eeprom libftdi; /* stuff known to libftdi */
|
|
||||||
unsigned char BM_type_chip; /* from libftdi-0.18, missing in 0.19 */
|
|
||||||
|
|
||||||
/* These are not actually eeprom values; here for convenience */
|
|
||||||
unsigned short old_vid;
|
|
||||||
unsigned short old_pid;
|
|
||||||
const char *old_serno;
|
|
||||||
unsigned short new_vid;
|
|
||||||
unsigned short new_pid;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void dumpmem (const char *msg, void *addr, int len)
|
|
||||||
{
|
|
||||||
char *data = addr, hex[3 * 16 + 1], ascii[17];
|
|
||||||
unsigned int i, offset = 0;
|
|
||||||
|
|
||||||
if (msg)
|
|
||||||
printf("%s:\n", msg);
|
|
||||||
for (i = 0; i < len;) {
|
|
||||||
unsigned int i16 = i % 16;
|
|
||||||
unsigned char c = data[i];
|
|
||||||
sprintf(hex + (3 * i16), " %02x", c);
|
|
||||||
ascii[i16] = (c < ' ' || c > '~') ? '.' : c;
|
|
||||||
if (++i == len || i16 == 15) {
|
|
||||||
ascii[i16 + 1] = '\0';
|
|
||||||
for (; i16 != 15; ++i16)
|
|
||||||
strcat(hex, " ");
|
|
||||||
printf("%04x:%s %s\n", offset, hex, ascii);
|
|
||||||
offset = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned short calc_crc (void *addr, int len)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
unsigned short crc = 0xaaaa;
|
|
||||||
unsigned char *d8 = addr;
|
|
||||||
|
|
||||||
for (i = 0; i < len - 2; i += 2) {
|
|
||||||
crc ^= d8[i] | (d8[i+1] << 8);
|
|
||||||
crc = (crc << 1) | (crc >> 15);
|
|
||||||
}
|
|
||||||
return crc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void do_deinit (void)
|
|
||||||
{
|
|
||||||
ftdi_deinit(&ftdi);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void do_close (void)
|
|
||||||
{
|
|
||||||
ftdi_usb_close(&ftdi);
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned short verify_crc (void *addr, int len)
|
|
||||||
{
|
|
||||||
unsigned short crc = calc_crc(addr, len);
|
|
||||||
unsigned char *d8 = addr;
|
|
||||||
unsigned short actual = d8[len-2] | (d8[len-1] << 8);
|
|
||||||
|
|
||||||
if (crc != actual) {
|
|
||||||
fprintf(stderr, "Bad CRC: crc=0x%04x, actual=0x%04x\n", crc, actual);
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
if (verbose) printf("CRC: Okay (0x%04x)\n", crc);
|
|
||||||
return crc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned short update_crc (void *addr, int len)
|
|
||||||
{
|
|
||||||
unsigned short crc = calc_crc(addr, len);
|
|
||||||
unsigned char *d8 = addr;
|
|
||||||
|
|
||||||
d8[len-2] = crc;
|
|
||||||
d8[len-1] = crc >> 8;
|
|
||||||
return crc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int match_arg (const char *arg, const char **possibles)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; possibles[i]; ++i) {
|
|
||||||
if (0 == strcasecmp(possibles[i], arg))
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
fprintf(stderr, "unrecognized arg: \"%s\"\n", arg);
|
|
||||||
exit(EINVAL);
|
|
||||||
return -1; /* never reached */
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned long unsigned_val (const char *arg, unsigned long max)
|
|
||||||
{
|
|
||||||
unsigned long val;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
val = strtoul(arg, NULL, 0);
|
|
||||||
if (errno || val > max) {
|
|
||||||
fprintf(stderr, "%s: bad value (max=0x%lx)\n", arg, max);
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ee_dump (struct eeprom_fields *ee)
|
|
||||||
{
|
|
||||||
unsigned int c;
|
|
||||||
|
|
||||||
printf(" eeprom_size = %d\n", ee->libftdi.size);
|
|
||||||
printf(" vendor_id = 0x%04x\n", ee->libftdi.vendor_id);
|
|
||||||
printf(" product_id = 0x%04x\n", ee->libftdi.product_id);
|
|
||||||
printf(" self_powered = %d\n", ee->libftdi.self_powered);
|
|
||||||
printf(" remote_wakeup = %d\n", ee->libftdi.remote_wakeup);
|
|
||||||
printf("suspend_pull_downs = %d\n", ee->libftdi.suspend_pull_downs);
|
|
||||||
printf(" max_bus_power = %d mA\n", 2 * ee->libftdi.max_power);
|
|
||||||
printf(" manufacturer = %s\n", ee->libftdi.manufacturer);
|
|
||||||
printf(" product = %s\n", ee->libftdi.product);
|
|
||||||
printf(" serialnum = %s\n", ee->libftdi.serial);
|
|
||||||
printf(" high_current_io = %u\n", ee->high_current_io);
|
|
||||||
printf(" load_d2xx_driver = %u\n", ee->load_d2xx_driver);
|
|
||||||
printf(" txd_inverted = %u\n", ee->txd_inverted);
|
|
||||||
printf(" rxd_inverted = %u\n", ee->rxd_inverted);
|
|
||||||
printf(" rts_inverted = %u\n", ee->rts_inverted);
|
|
||||||
printf(" cts_inverted = %u\n", ee->cts_inverted);
|
|
||||||
printf(" dtr_inverted = %u\n", ee->dtr_inverted);
|
|
||||||
printf(" dsr_inverted = %u\n", ee->dsr_inverted);
|
|
||||||
printf(" dcd_inverted = %u\n", ee->dcd_inverted);
|
|
||||||
printf(" ri_inverted = %u\n", ee->ri_inverted);
|
|
||||||
|
|
||||||
for (c = 0; c < 5; ++c)
|
|
||||||
printf(" cbus[%u] = %s\n", c, cbus_mode_strings[ee->cbus[c]]);
|
|
||||||
|
|
||||||
if (verbose) {
|
|
||||||
/* These fields are non-applicable for FT232R devices */
|
|
||||||
printf(" usb_version = %d\n", ee->libftdi.usb_version);
|
|
||||||
printf(" use_serialnum = %d (n/a)\n", ee->libftdi.use_serial);
|
|
||||||
printf("change_usb_version = %d (n/a)\n", ee->libftdi.change_usb_version);
|
|
||||||
printf(" pnp_enabled = %u (n/a)\n", ee->pnp_enabled);
|
|
||||||
printf(" BM_type_chip = 0x%02x (n/a)\n", ee->BM_type_chip);
|
|
||||||
printf(" in_is_isochronous = %d (n/a)\n", ee->libftdi.in_is_isochronous);
|
|
||||||
printf("out_is_isochronous = %d (n/a)\n", ee->libftdi.out_is_isochronous);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static unsigned int calc_extras_offset (unsigned char *eeprom)
|
|
||||||
{
|
|
||||||
unsigned int str1 = (eeprom[0x0e] & 0x7f) + eeprom[0x0f];
|
|
||||||
unsigned int str2 = (eeprom[0x10] & 0x7f) + eeprom[0x11];
|
|
||||||
unsigned int str3 = (eeprom[0x12] & 0x7f) + eeprom[0x13];
|
|
||||||
unsigned int offset;
|
|
||||||
|
|
||||||
if (str3 > str2)
|
|
||||||
offset = (str3 > str1) ? str3 : str1;
|
|
||||||
else
|
|
||||||
offset = (str2 > str1) ? str2 : str1;
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int encode_string (void *eeprom, int desc, int offset, char *s)
|
|
||||||
{
|
|
||||||
unsigned char c, *u8 = eeprom, slen = (strlen(s) + 1) * 2;
|
|
||||||
|
|
||||||
if (!s || !*s)
|
|
||||||
return offset;
|
|
||||||
u8[desc + 0] = offset | 0x80; /* offset of string */
|
|
||||||
u8[desc + 1] = slen; /* length */
|
|
||||||
|
|
||||||
u8[offset++] = slen; /* length */
|
|
||||||
u8[offset++] = 0x03; /* "type" == string */
|
|
||||||
while ((c = *s++)) {
|
|
||||||
u8[offset++] = c;
|
|
||||||
u8[offset++] = 0;
|
|
||||||
}
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ft232r_eprom_build (struct eeprom_fields *ee, unsigned char *eeprom)
|
|
||||||
{
|
|
||||||
unsigned int len = ee->libftdi.size;
|
|
||||||
int offset = 0x18;
|
|
||||||
|
|
||||||
memset(eeprom, 0, len);
|
|
||||||
if (strlen(ee->libftdi.serial) > 16) {
|
|
||||||
fprintf(stderr, "Serial number string exceeds limit of 16 chars, aborting.\n");
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
if ((strlen(ee->libftdi.manufacturer) + strlen(ee->libftdi.product) + strlen(ee->libftdi.serial)) > 46) {
|
|
||||||
fprintf(stderr, "Total string sizes exceed limit of 46 chars, aborting.\n");
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
offset = encode_string(eeprom, 0x0e, offset, ee->libftdi.manufacturer);
|
|
||||||
offset = encode_string(eeprom, 0x10, offset, ee->libftdi.product);
|
|
||||||
offset = encode_string(eeprom, 0x12, offset, ee->libftdi.serial);
|
|
||||||
eeprom[0x02] = ee->libftdi.vendor_id;
|
|
||||||
eeprom[0x03] = ee->libftdi.vendor_id >> 8;
|
|
||||||
eeprom[0x04] = ee->libftdi.product_id;
|
|
||||||
eeprom[0x05] = ee->libftdi.product_id >> 8;
|
|
||||||
eeprom[0x07] = ee->BM_type_chip;
|
|
||||||
eeprom[0x08] = 0x80;
|
|
||||||
if (ee->libftdi.remote_wakeup)
|
|
||||||
eeprom[0x08] |= 0x20;
|
|
||||||
if (ee->libftdi.self_powered)
|
|
||||||
eeprom[0x08] |= 0x40;
|
|
||||||
eeprom[0x09] = ee->libftdi.max_power;
|
|
||||||
if (ee->libftdi.in_is_isochronous)
|
|
||||||
eeprom[0x0a] |= 0x01;
|
|
||||||
if (ee->libftdi.out_is_isochronous)
|
|
||||||
eeprom[0x0a] |= 0x02;
|
|
||||||
if (ee->libftdi.suspend_pull_downs)
|
|
||||||
eeprom[0x0a] |= 0x04;
|
|
||||||
if (ee->libftdi.use_serial)
|
|
||||||
eeprom[0x0a] |= 0x08;
|
|
||||||
if (ee->libftdi.change_usb_version)
|
|
||||||
eeprom[0x0a] |= 0x10;
|
|
||||||
eeprom[0x0c] = ee->libftdi.usb_version;
|
|
||||||
eeprom[0x0d] = ee->libftdi.usb_version >> 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* There are some undefined "extra features" bytes after the strings.
|
|
||||||
* So blindly preserve them from the original eeprom image.
|
|
||||||
*/
|
|
||||||
static void ee_encode_extras (unsigned char *eeprom, int len, struct eeprom_fields *ee)
|
|
||||||
{
|
|
||||||
unsigned int extras_offset = calc_extras_offset(eeprom);
|
|
||||||
|
|
||||||
memcpy(eeprom + extras_offset, ee->extras, len - extras_offset - 2);
|
|
||||||
if (ee->pnp_enabled)
|
|
||||||
eeprom[extras_offset + 2] |= 1;
|
|
||||||
else
|
|
||||||
eeprom[extras_offset + 2] &= ~1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned short ee_encode (unsigned char *eeprom, int len, struct eeprom_fields *ee)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
memset(eeprom, 0, len);
|
|
||||||
ee->libftdi.size = len;
|
|
||||||
|
|
||||||
if (ee->new_vid)
|
|
||||||
ee->libftdi.vendor_id = ee->new_vid;
|
|
||||||
if (ee->new_pid)
|
|
||||||
ee->libftdi.product_id = ee->new_pid;
|
|
||||||
|
|
||||||
/* Unfortunately, ftdi_eeprom_build() is buggy and puts things in the wrong places */
|
|
||||||
if (0) {
|
|
||||||
ret = ftdi_eeprom_build(&ee->libftdi, eeprom);
|
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr, "ftdi_eeprom_build() failed, ret=%d\n", ret);
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
printf("ftdi_eeprom_build() ret=%d\n", ret);
|
|
||||||
} else {
|
|
||||||
ft232r_eprom_build(ee, eeprom);
|
|
||||||
}
|
|
||||||
eeprom[1] = ee->byte01;
|
|
||||||
if (ee->high_current_io)
|
|
||||||
eeprom[0x00] |= 0x04;
|
|
||||||
if (ee->load_d2xx_driver)
|
|
||||||
eeprom[0x00] |= 0x08;
|
|
||||||
if (ee->txd_inverted)
|
|
||||||
eeprom[0x0b] |= 0x01;
|
|
||||||
if (ee->rxd_inverted)
|
|
||||||
eeprom[0x0b] |= 0x02;
|
|
||||||
if (ee->rts_inverted)
|
|
||||||
eeprom[0x0b] |= 0x04;
|
|
||||||
if (ee->cts_inverted)
|
|
||||||
eeprom[0x0b] |= 0x08;
|
|
||||||
if (ee->dtr_inverted)
|
|
||||||
eeprom[0x0b] |= 0x10;
|
|
||||||
if (ee->dsr_inverted)
|
|
||||||
eeprom[0x0b] |= 0x20;
|
|
||||||
if (ee->dcd_inverted)
|
|
||||||
eeprom[0x0b] |= 0x40;
|
|
||||||
if (ee->ri_inverted)
|
|
||||||
eeprom[0x0b] |= 0x80;
|
|
||||||
eeprom[0x14] = (ee->cbus[1] << 4) | ee->cbus[0];
|
|
||||||
eeprom[0x15] = (ee->cbus[3] << 4) | ee->cbus[2];
|
|
||||||
eeprom[0x16] = ee->cbus[4];
|
|
||||||
ee_encode_extras(eeprom, len, ee);
|
|
||||||
return update_crc(eeprom, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* There are some undefined "extra features" bytes after the strings.
|
|
||||||
* So blindly preserve them from the original eeprom image.
|
|
||||||
*/
|
|
||||||
static void ee_decode_extras (unsigned char *eeprom, int len, struct eeprom_fields *ee)
|
|
||||||
{
|
|
||||||
unsigned int extras_offset = calc_extras_offset(eeprom);
|
|
||||||
|
|
||||||
memcpy(ee->extras, eeprom + extras_offset, len - extras_offset - 2);
|
|
||||||
ee->pnp_enabled = eeprom[extras_offset + 2] & 0x01;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ee_decode (unsigned char *eeprom, int len, struct eeprom_fields *ee)
|
|
||||||
{
|
|
||||||
memset(ee, 0, sizeof(*ee));
|
|
||||||
if (eeprom[0] & 0x04)
|
|
||||||
ee->high_current_io = 1;
|
|
||||||
if (eeprom[0x00] & 0x08)
|
|
||||||
ee->load_d2xx_driver = 1;
|
|
||||||
ee->byte01 = eeprom[0x01];
|
|
||||||
if (eeprom[0x0b] & 0x01)
|
|
||||||
ee->txd_inverted = 1;
|
|
||||||
if (eeprom[0x0b] & 0x02)
|
|
||||||
ee->rxd_inverted = 1;
|
|
||||||
if (eeprom[0x0b] & 0x04)
|
|
||||||
ee->rts_inverted = 1;
|
|
||||||
if (eeprom[0x0b] & 0x08)
|
|
||||||
ee->cts_inverted = 1;
|
|
||||||
if (eeprom[0x0b] & 0x10)
|
|
||||||
ee->dtr_inverted = 1;
|
|
||||||
if (eeprom[0x0b] & 0x20)
|
|
||||||
ee->dsr_inverted = 1;
|
|
||||||
if (eeprom[0x0b] & 0x40)
|
|
||||||
ee->dcd_inverted = 1;
|
|
||||||
if (eeprom[0x0b] & 0x80)
|
|
||||||
ee->ri_inverted = 1;
|
|
||||||
ee->cbus[0] = eeprom[0x14] & 0xf;
|
|
||||||
ee->cbus[1] = eeprom[0x14] >> 4;
|
|
||||||
ee->cbus[2] = eeprom[0x15] & 0xf;
|
|
||||||
ee->cbus[3] = eeprom[0x15] >> 4;
|
|
||||||
ee->cbus[4] = eeprom[0x16] & 0xf;
|
|
||||||
ee_decode_extras(eeprom, len, ee);
|
|
||||||
|
|
||||||
/* Use libftdi to decode the remaining fields, which it knows about */
|
|
||||||
if (ftdi_eeprom_decode(&ee->libftdi, eeprom, len)) {
|
|
||||||
fprintf(stderr, "ftdi_eeprom_decode() failed\n");
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
ee->BM_type_chip = eeprom[0x07]; /* buggy ftdi_eeprom_decode() */
|
|
||||||
if (eeprom[0x0a] & 0x10) /* more buggy ftdi_eeprom_decode() */
|
|
||||||
ee->libftdi.change_usb_version = 1;
|
|
||||||
else
|
|
||||||
ee->libftdi.change_usb_version = 0;
|
|
||||||
ee->libftdi.usb_version = (eeprom[0x0d] << 8) | eeprom[0x0c];;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *myname;
|
|
||||||
|
|
||||||
static void show_help (FILE *fp)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
fprintf(fp, "\nUsage: %s [<arg> <val>]..\n", myname);
|
|
||||||
fprintf(fp, "\nwhere <arg> must be any of:\n");
|
|
||||||
|
|
||||||
for (i = 0; arg_type_strings[i]; ++i) {
|
|
||||||
const char *val = arg_type_help[i];
|
|
||||||
fprintf(fp, " %s", arg_type_strings[i]);
|
|
||||||
if (val) {
|
|
||||||
if (*val) {
|
|
||||||
fprintf(fp, " %s", val);
|
|
||||||
} else { /* cbus args */
|
|
||||||
int j;
|
|
||||||
fprintf(fp, " [");
|
|
||||||
for (j = 0; cbus_mode_strings[j];) {
|
|
||||||
fprintf(fp, "%s", cbus_mode_strings[j]);
|
|
||||||
if (cbus_mode_strings[++j])
|
|
||||||
fprintf(fp, "|");
|
|
||||||
}
|
|
||||||
fprintf(fp, "]");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fputc('\n', fp);
|
|
||||||
}
|
|
||||||
fputc('\n', fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned short ee_read_and_verify (void *eeprom, int len)
|
|
||||||
{
|
|
||||||
if (ftdi_read_eeprom(&ftdi, eeprom)) {
|
|
||||||
fprintf(stderr, "ftdi_read_eeprom() failed: %s\n", ftdi_get_error_string(&ftdi));
|
|
||||||
exit(EIO);
|
|
||||||
}
|
|
||||||
return verify_crc(eeprom, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void process_args (int argc, char *argv[], struct eeprom_fields *ee)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 1; i < argc;) {
|
|
||||||
int arg;
|
|
||||||
arg = match_arg(argv[i++], arg_type_strings);
|
|
||||||
switch (arg) {
|
|
||||||
case arg_help:
|
|
||||||
show_help(stdout);
|
|
||||||
exit(1);
|
|
||||||
case arg_dump:
|
|
||||||
continue;
|
|
||||||
case arg_verbose:
|
|
||||||
verbose = 1;
|
|
||||||
continue;
|
|
||||||
case arg_invert_txd:
|
|
||||||
ee->txd_inverted = !ee->txd_inverted;
|
|
||||||
continue;
|
|
||||||
case arg_invert_rxd:
|
|
||||||
ee->rxd_inverted = !ee->rxd_inverted;
|
|
||||||
continue;
|
|
||||||
case arg_invert_rts:
|
|
||||||
ee->rts_inverted = !ee->rts_inverted;
|
|
||||||
continue;
|
|
||||||
case arg_invert_cts:
|
|
||||||
ee->cts_inverted = !ee->cts_inverted;
|
|
||||||
continue;
|
|
||||||
case arg_invert_dtr:
|
|
||||||
ee->dtr_inverted = !ee->dtr_inverted;
|
|
||||||
continue;
|
|
||||||
case arg_invert_dsr:
|
|
||||||
ee->dsr_inverted = !ee->dsr_inverted;
|
|
||||||
continue;
|
|
||||||
case arg_invert_dcd:
|
|
||||||
ee->dcd_inverted = !ee->dcd_inverted;
|
|
||||||
continue;
|
|
||||||
case arg_invert_ri:
|
|
||||||
ee->ri_inverted = !ee->ri_inverted;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (i == argc) {
|
|
||||||
fprintf(stderr, "%s: missing %s value\n", argv[i-2], argv[i-1]);
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
switch (arg) {
|
|
||||||
case arg_save:
|
|
||||||
save_path = argv[i++];
|
|
||||||
break;
|
|
||||||
case arg_restore:
|
|
||||||
restore_path = argv[i++];
|
|
||||||
break;
|
|
||||||
case arg_cbus0:
|
|
||||||
case arg_cbus1:
|
|
||||||
case arg_cbus2:
|
|
||||||
case arg_cbus3:
|
|
||||||
case arg_cbus4:
|
|
||||||
ee->cbus[arg - arg_cbus0] = match_arg(argv[i++], cbus_mode_strings);
|
|
||||||
break;
|
|
||||||
case arg_manufacturer:
|
|
||||||
ee->libftdi.manufacturer = argv[i++];
|
|
||||||
break;
|
|
||||||
case arg_product:
|
|
||||||
ee->libftdi.product = argv[i++];
|
|
||||||
break;
|
|
||||||
case arg_new_serno:
|
|
||||||
ee->libftdi.serial = argv[i++];
|
|
||||||
break;
|
|
||||||
case arg_high_current_io:
|
|
||||||
ee->high_current_io = match_arg(argv[i++], bool_strings) & 1;
|
|
||||||
break;
|
|
||||||
case arg_self_powered:
|
|
||||||
ee->libftdi.self_powered = match_arg(argv[i++], bool_strings) & 1;
|
|
||||||
break;
|
|
||||||
case arg_max_bus_power:
|
|
||||||
ee->libftdi.max_power = unsigned_val(argv[i++], 0x1ff) / 2;
|
|
||||||
break;
|
|
||||||
case arg_suspend_pull_down:
|
|
||||||
ee->libftdi.suspend_pull_downs = unsigned_val(argv[i++], 0xff);
|
|
||||||
break;
|
|
||||||
case arg_old_vid:
|
|
||||||
ee->old_vid = unsigned_val(argv[i++], 0xffff);
|
|
||||||
break;
|
|
||||||
case arg_old_pid:
|
|
||||||
ee->old_pid = unsigned_val(argv[i++], 0xffff);
|
|
||||||
break;
|
|
||||||
case arg_old_serno:
|
|
||||||
ee->old_serno = argv[i++];
|
|
||||||
break;
|
|
||||||
case arg_new_vid:
|
|
||||||
ee->new_vid = unsigned_val(argv[i++], 0xffff);
|
|
||||||
break;
|
|
||||||
case arg_new_pid:
|
|
||||||
ee->new_pid = unsigned_val(argv[i++], 0xffff);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
fprintf(stderr, "bad args\n");
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void save_eeprom_to_file (const char *path, void *eeprom, int len)
|
|
||||||
{
|
|
||||||
int count, fd = open(path, O_CREAT|O_WRONLY|O_TRUNC, 0644);
|
|
||||||
|
|
||||||
if (fd == -1) {
|
|
||||||
int err = errno;
|
|
||||||
perror(path);
|
|
||||||
exit(err);
|
|
||||||
}
|
|
||||||
count = write(fd, eeprom, len);
|
|
||||||
if (count < 0) {
|
|
||||||
int err = errno;
|
|
||||||
perror(path);
|
|
||||||
exit(err);
|
|
||||||
}
|
|
||||||
close(fd);
|
|
||||||
if (count != len) {
|
|
||||||
fprintf(stderr, "%s: wrong size, wrote %d/%d bytes\n", path, count, len);
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
printf("%s: wrote %d bytes\n", path, count);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void restore_eeprom_from_file (const char *path, void *eeprom, int len, int max)
|
|
||||||
{
|
|
||||||
int count, fd = open(path, O_RDONLY);
|
|
||||||
|
|
||||||
if (fd == -1) {
|
|
||||||
int err = errno;
|
|
||||||
perror(path);
|
|
||||||
exit(err);
|
|
||||||
}
|
|
||||||
count = read(fd, eeprom, max);
|
|
||||||
if (count < 0) {
|
|
||||||
int err = errno;
|
|
||||||
perror(path);
|
|
||||||
exit(err);
|
|
||||||
}
|
|
||||||
close(fd);
|
|
||||||
if (count != len ) {
|
|
||||||
fprintf(stderr, "%s: wrong size, read %d/%d bytes\n", path, count, len);
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
printf("%s: read %d bytes\n", path, count);
|
|
||||||
verify_crc(eeprom, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main (int argc, char *argv[])
|
|
||||||
{
|
|
||||||
const char *slash;
|
|
||||||
unsigned char old[256] = {0,}, new[256] = {0,};
|
|
||||||
unsigned short new_crc;
|
|
||||||
struct eeprom_fields ee;
|
|
||||||
unsigned int len = 128;
|
|
||||||
|
|
||||||
myname = argv[0];
|
|
||||||
slash = strrchr(myname, '/');
|
|
||||||
if (slash)
|
|
||||||
myname = slash + 1;
|
|
||||||
|
|
||||||
printf("\n%s: version %s, by Mark Lord.\n", myname, MYVERSION);
|
|
||||||
if (argc < 2) {
|
|
||||||
show_help(stdout);
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
ftdi_init(&ftdi);
|
|
||||||
atexit(&do_deinit);
|
|
||||||
|
|
||||||
memset(&ee, 0, sizeof(ee));
|
|
||||||
ee.old_vid = 0x0403;; /* default; override with --old_vid arg */
|
|
||||||
ee.old_pid = 0x6001; /* default; override with --old_pid arg */
|
|
||||||
process_args(argc, argv, &ee); /* handle --help and --old-* args */
|
|
||||||
|
|
||||||
if (ftdi_usb_open_desc(&ftdi, ee.old_vid, ee.old_pid, NULL, ee.old_serno)) {
|
|
||||||
fprintf(stderr, "ftdi_usb_open() failed for %04x:%04x:%s %s\n",
|
|
||||||
ee.old_vid, ee.old_pid, ee.old_serno ? ee.old_serno : "", ftdi_get_error_string(&ftdi));
|
|
||||||
exit(ENODEV);
|
|
||||||
}
|
|
||||||
atexit(&do_close);
|
|
||||||
|
|
||||||
/* First, read the original eeprom from the device */
|
|
||||||
(void) ee_read_and_verify(old, len);
|
|
||||||
if (verbose) dumpmem("existing eeprom", old, len);
|
|
||||||
|
|
||||||
/* Save old contents to a file, if requested (--save) */
|
|
||||||
if (save_path)
|
|
||||||
save_eeprom_to_file(save_path, old, len);
|
|
||||||
|
|
||||||
/* Restore contents from a file, if requested (--restore) */
|
|
||||||
if (restore_path) {
|
|
||||||
restore_eeprom_from_file(restore_path, new, len, sizeof(new));
|
|
||||||
if (verbose) dumpmem(restore_path, new, len);
|
|
||||||
/* Decode file contents into ee struct */
|
|
||||||
ee_decode(new, len, &ee);
|
|
||||||
} else {
|
|
||||||
/* Decode eeprom contents into ee struct */
|
|
||||||
ee_decode(old, len, &ee);
|
|
||||||
|
|
||||||
/* Reencode without any changes, to ensure we can reconstruct the original eeprom from ee */
|
|
||||||
new_crc = ee_encode(new, len, &ee);
|
|
||||||
if (memcmp(old, new, len)) {
|
|
||||||
if (verbose) dumpmem("reconstructed eeprom", new, len);
|
|
||||||
fprintf(stderr, "eeprom reconstruction self-test failed, aborting.\n");
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* process args, and dump new settings */
|
|
||||||
process_args(argc, argv, &ee); /* Handle value-change args */
|
|
||||||
ee_dump(&ee);
|
|
||||||
|
|
||||||
/* Build new eeprom image */
|
|
||||||
new_crc = ee_encode(new, len, &ee);
|
|
||||||
|
|
||||||
/* If different from original, then write it back to the device */
|
|
||||||
if (0 == memcmp(old, new, len)) {
|
|
||||||
printf("No change from existing eeprom contents.\n");
|
|
||||||
} else {
|
|
||||||
if (verbose) dumpmem("new eeprom", new, len);
|
|
||||||
printf("Rewriting eeprom with new contents.\n");
|
|
||||||
if (ftdi_write_eeprom(&ftdi, new)) {
|
|
||||||
fprintf(stderr, "ftdi_write_eeprom() failed: %s\n", ftdi_get_error_string(&ftdi));
|
|
||||||
exit(EIO);
|
|
||||||
}
|
|
||||||
/* Read it back again, and check for differences */
|
|
||||||
if (ee_read_and_verify(new, len) != new_crc) {
|
|
||||||
fprintf(stderr, "Readback test failed, results may be botched\n");
|
|
||||||
exit(EINVAL);
|
|
||||||
}
|
|
||||||
ftdi_usb_reset(&ftdi); /* reset the device to force it to load the new settings */
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
sudo ./ft232r_prog –old-pid 0x000 –new-pid 0x6001
|
|
677
LICENSE
|
@ -1,677 +0,0 @@
|
||||||
(This project uses BertOS for some functionality. BertOS is licensed under GPLv2. Please see http://www.bertos.org for details. All files in the "bertos" directory originates from BertOS.)
|
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
{one line to give the program's name and a brief idea of what it does.}
|
|
||||||
Copyright (C) {year} {name of author}
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
{project} Copyright (C) {year} {fullname}
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
||||||
|
|
17
Makefile
|
@ -1,17 +0,0 @@
|
||||||
#
|
|
||||||
# Copyright 2009 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# Author: Lorenzo Berni <duplo@develer.com>
|
|
||||||
#
|
|
||||||
|
|
||||||
# Set to 1 for verbose build output, 0 for terse output
|
|
||||||
V := 0
|
|
||||||
|
|
||||||
default: all
|
|
||||||
|
|
||||||
include bertos/config.mk
|
|
||||||
|
|
||||||
include Modem/Modem.mk
|
|
||||||
|
|
||||||
include bertos/rules.mk
|
|
|
@ -1,8 +0,0 @@
|
||||||
name = 'empty preset'
|
|
||||||
advanced = True
|
|
||||||
description="""
|
|
||||||
<p>
|
|
||||||
This is a minimalist project, it just initializes the hardware of the
|
|
||||||
supported board and proposes an empty main.
|
|
||||||
<\p>
|
|
||||||
"""
|
|
|
@ -1,90 +0,0 @@
|
||||||
#
|
|
||||||
# Wizard autogenerated makefile.
|
|
||||||
# DO NOT EDIT, use the Modem_user.mk file instead.
|
|
||||||
#
|
|
||||||
|
|
||||||
# Constants automatically defined by the selected modules
|
|
||||||
Modem_DEBUG = 1
|
|
||||||
|
|
||||||
# Our target application
|
|
||||||
TRG += Modem
|
|
||||||
|
|
||||||
Modem_PREFIX = "/usr/bin/avr-"
|
|
||||||
|
|
||||||
Modem_SUFFIX = ""
|
|
||||||
|
|
||||||
Modem_SRC_PATH = Modem
|
|
||||||
|
|
||||||
Modem_HW_PATH = Modem
|
|
||||||
|
|
||||||
# Files automatically generated by the wizard. DO NOT EDIT, USE Modem_USER_CSRC INSTEAD!
|
|
||||||
Modem_WIZARD_CSRC = \
|
|
||||||
bertos/cpu/avr/drv/ser_avr.c \
|
|
||||||
bertos/cpu/avr/drv/ser_mega.c \
|
|
||||||
bertos/cpu/avr/drv/timer_avr.c \
|
|
||||||
bertos/cpu/avr/drv/timer_mega.c \
|
|
||||||
bertos/drv/ser.c \
|
|
||||||
bertos/drv/timer.c \
|
|
||||||
bertos/io/kfile.c \
|
|
||||||
bertos/mware/event.c \
|
|
||||||
bertos/mware/formatwr.c \
|
|
||||||
bertos/mware/hex.c \
|
|
||||||
bertos/struct/heap.c \
|
|
||||||
bertos/net/ax25.c \
|
|
||||||
bertos/algo/crc_ccitt.c \
|
|
||||||
#
|
|
||||||
|
|
||||||
# Files automatically generated by the wizard. DO NOT EDIT, USE Modem_USER_PCSRC INSTEAD!
|
|
||||||
Modem_WIZARD_PCSRC = \
|
|
||||||
bertos/mware/formatwr.c \
|
|
||||||
#
|
|
||||||
|
|
||||||
# Files automatically generated by the wizard. DO NOT EDIT, USE Modem_USER_CPPASRC INSTEAD!
|
|
||||||
Modem_WIZARD_CPPASRC = \
|
|
||||||
\
|
|
||||||
#
|
|
||||||
|
|
||||||
# Files automatically generated by the wizard. DO NOT EDIT, USE Modem_USER_CXXSRC INSTEAD!
|
|
||||||
Modem_WIZARD_CXXSRC = \
|
|
||||||
\
|
|
||||||
#
|
|
||||||
|
|
||||||
# Files automatically generated by the wizard. DO NOT EDIT, USE Modem_USER_ASRC INSTEAD!
|
|
||||||
Modem_WIZARD_ASRC = \
|
|
||||||
\
|
|
||||||
#
|
|
||||||
|
|
||||||
Modem_CPPFLAGS = -D'CPU_FREQ=(16000000UL)' -D'ARCH=(ARCH_DEFAULT)' -D'WIZ_AUTOGEN' -I$(Modem_HW_PATH) -I$(Modem_SRC_PATH) $(Modem_CPU_CPPFLAGS) $(Modem_USER_CPPFLAGS)
|
|
||||||
|
|
||||||
# Automatically generated by the wizard. PLEASE DO NOT EDIT!
|
|
||||||
Modem_LDFLAGS = $(Modem_CPU_LDFLAGS) $(Modem_WIZARD_LDFLAGS) $(Modem_USER_LDFLAGS)
|
|
||||||
|
|
||||||
# Automatically generated by the wizard. PLEASE DO NOT EDIT!
|
|
||||||
Modem_CPPAFLAGS = $(Modem_CPU_CPPAFLAGS) $(Modem_WIZARD_CPPAFLAGS) $(Modem_USER_CPPAFLAGS)
|
|
||||||
|
|
||||||
# Automatically generated by the wizard. PLEASE DO NOT EDIT!
|
|
||||||
Modem_CSRC = $(Modem_CPU_CSRC) $(Modem_WIZARD_CSRC) $(Modem_USER_CSRC)
|
|
||||||
|
|
||||||
# Automatically generated by the wizard. PLEASE DO NOT EDIT!
|
|
||||||
Modem_PCSRC = $(Modem_CPU_PCSRC) $(Modem_WIZARD_PCSRC) $(Modem_USER_PCSRC)
|
|
||||||
|
|
||||||
# Automatically generated by the wizard. PLEASE DO NOT EDIT!
|
|
||||||
Modem_CPPASRC = $(Modem_CPU_CPPASRC) $(Modem_WIZARD_CPPASRC) $(Modem_USER_CPPASRC)
|
|
||||||
|
|
||||||
# Automatically generated by the wizard. PLEASE DO NOT EDIT!
|
|
||||||
Modem_CXXSRC = $(Modem_CPU_CXXSRC) $(Modem_WIZARD_CXXSRC) $(Modem_USER_CXXSRC)
|
|
||||||
|
|
||||||
# Automatically generated by the wizard. PLEASE DO NOT EDIT!
|
|
||||||
Modem_ASRC = $(Modem_CPU_ASRC) $(Modem_WIZARD_ASRC) $(Modem_USER_ASRC)
|
|
||||||
|
|
||||||
# CPU specific flags and options, defined in the CPU definition files.
|
|
||||||
# Automatically generated by the wizard. PLEASE DO NOT EDIT!
|
|
||||||
Modem_MCU = atmega328p
|
|
||||||
Modem_CPU_CPPFLAGS = -Os -Ibertos/cpu/avr/
|
|
||||||
Modem_PROGRAMMER_CPU = atmega328p
|
|
||||||
Modem_STOPFLASH_SCRIPT = bertos/prg_scripts/avr/stopflash.sh
|
|
||||||
Modem_STOPDEBUG_SCRIPT = bertos/prg_scripts/none.sh
|
|
||||||
Modem_DEBUG_SCRIPT = bertos/prg_scripts/nodebug.sh
|
|
||||||
Modem_FLASH_SCRIPT = bertos/prg_scripts/avr/flash.sh
|
|
||||||
|
|
||||||
include $(Modem_SRC_PATH)/Modem_user.mk
|
|
|
@ -1,47 +0,0 @@
|
||||||
#
|
|
||||||
# User makefile.
|
|
||||||
# Edit this file to change compiler options and related stuff.
|
|
||||||
#
|
|
||||||
|
|
||||||
# Programmer interface configuration, see http://dev.bertos.org/wiki/ProgrammerInterface for help
|
|
||||||
Modem_PROGRAMMER_TYPE = none
|
|
||||||
Modem_PROGRAMMER_PORT = none
|
|
||||||
|
|
||||||
# Files included by the user.
|
|
||||||
Modem_USER_CSRC = \
|
|
||||||
$(Modem_SRC_PATH)/main.c \
|
|
||||||
$(Modem_HW_PATH)/hardware.c \
|
|
||||||
$(Modem_HW_PATH)/afsk.c \
|
|
||||||
$(Modem_HW_PATH)/protocol/SimpleSerial.c \
|
|
||||||
$(Modem_HW_PATH)/protocol/KISS.c \
|
|
||||||
#
|
|
||||||
|
|
||||||
# Files included by the user.
|
|
||||||
Modem_USER_PCSRC = \
|
|
||||||
#
|
|
||||||
|
|
||||||
# Files included by the user.
|
|
||||||
Modem_USER_CPPASRC = \
|
|
||||||
#
|
|
||||||
|
|
||||||
# Files included by the user.
|
|
||||||
Modem_USER_CXXSRC = \
|
|
||||||
#
|
|
||||||
|
|
||||||
# Files included by the user.
|
|
||||||
Modem_USER_ASRC = \
|
|
||||||
#
|
|
||||||
|
|
||||||
# Flags included by the user.
|
|
||||||
Modem_USER_LDFLAGS = \
|
|
||||||
#
|
|
||||||
|
|
||||||
# Flags included by the user.
|
|
||||||
Modem_USER_CPPAFLAGS = \
|
|
||||||
#
|
|
||||||
|
|
||||||
# Flags included by the user.
|
|
||||||
Modem_USER_CPPFLAGS = \
|
|
||||||
-fno-strict-aliasing \
|
|
||||||
-fwrapv \
|
|
||||||
#
|
|
741
Modem/afsk.c
|
@ -1,741 +0,0 @@
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// First things first, all the includes we need //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#include "afsk.h" // We need the header file for the modem
|
|
||||||
#include "config.h" // This stores basic configuration
|
|
||||||
#include "hardware.h" // Hardware functions are nice to have too :)
|
|
||||||
|
|
||||||
#include <drv/timer.h> // Timer driver from BertOS
|
|
||||||
|
|
||||||
#include <cpu/power.h> // Power management from BertOS
|
|
||||||
#include <cpu/pgm.h> // Access to PROGMEM from BertOS
|
|
||||||
#include <struct/fifobuf.h> // FIFO buffer implementation from BertOS
|
|
||||||
#include <string.h> // String operations, primarily used for memset function
|
|
||||||
|
|
||||||
extern unsigned long custom_preamble;
|
|
||||||
extern unsigned long custom_tail;
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// Definitions and some useful macros //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Sine table for Direct Digital Synthesis DAC
|
|
||||||
// Since it would be inefficient to calculate a sine value each
|
|
||||||
// time we process a sample, we store the values in program memory
|
|
||||||
// as a look-up table. We only need to store values for a quarter
|
|
||||||
// wave, since we can easily reconstruct the entire 512 values
|
|
||||||
// from only these 128 values.
|
|
||||||
#define SIN_LEN 512
|
|
||||||
static const uint8_t PROGMEM sin_table[] =
|
|
||||||
{
|
|
||||||
128, 129, 131, 132, 134, 135, 137, 138, 140, 142, 143, 145, 146, 148, 149, 151,
|
|
||||||
152, 154, 155, 157, 158, 160, 162, 163, 165, 166, 167, 169, 170, 172, 173, 175,
|
|
||||||
176, 178, 179, 181, 182, 183, 185, 186, 188, 189, 190, 192, 193, 194, 196, 197,
|
|
||||||
198, 200, 201, 202, 203, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217,
|
|
||||||
218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
|
|
||||||
234, 234, 235, 236, 237, 238, 238, 239, 240, 241, 241, 242, 243, 243, 244, 245,
|
|
||||||
245, 246, 246, 247, 248, 248, 249, 249, 250, 250, 250, 251, 251, 252, 252, 252,
|
|
||||||
253, 253, 253, 253, 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255,
|
|
||||||
}; STATIC_ASSERT(sizeof(sin_table) == SIN_LEN / 4);
|
|
||||||
|
|
||||||
|
|
||||||
// Calculate any sine value from quarter wave sine table
|
|
||||||
// The reason we declare this inline is to eliminate an extra
|
|
||||||
// call for the code. The code is essentially inserted directly
|
|
||||||
// in the calling functions code. This makes stuff faster :)
|
|
||||||
INLINE uint8_t sinSample(uint16_t i) {
|
|
||||||
// Make sure that the index asked for is in the correct range
|
|
||||||
ASSERT(i < SIN_LEN);
|
|
||||||
// First we make a new index value, and restrict it to only
|
|
||||||
// the first half-wave of the sine.
|
|
||||||
uint16_t newI = i % (SIN_LEN/2);
|
|
||||||
// We then check if this new index is larger than the first
|
|
||||||
// quarter wave. If it is, we don't have the value for this
|
|
||||||
// index directly, but we can figure it out by subtracting
|
|
||||||
// the new index from a half wave, effectively wrapping us
|
|
||||||
// back into the same place on the wave, whithin the quarter
|
|
||||||
// wave we have data for, only with the inverse sign. If the
|
|
||||||
// index was actually in the first quarter, we don't need to
|
|
||||||
// do anything.
|
|
||||||
newI = (newI >= (SIN_LEN/4)) ? (SIN_LEN/2 - newI -1) : newI;
|
|
||||||
// Now we just need to read the value from program memory
|
|
||||||
uint8_t sine = pgm_read8(&sin_table[newI]);
|
|
||||||
// And flip the sign (+/-) if the original index was greater
|
|
||||||
// than a half wave.
|
|
||||||
return (i >= (SIN_LEN/2)) ? (255 - sine) : sine;
|
|
||||||
}
|
|
||||||
|
|
||||||
// A very basic macro that just checks whether the last bit
|
|
||||||
// of a whatever is passed into it differ. This is used in the
|
|
||||||
// next macro.
|
|
||||||
#define BITS_DIFFER(bits1, bits2) (((bits1)^(bits2)) & 0x01)
|
|
||||||
|
|
||||||
// This macro is used to look for signal transitions. We need
|
|
||||||
// to identify these to keep the phase of our demodulator in
|
|
||||||
// sync with the incoming signal. Each time we find a signal
|
|
||||||
// transition on the physical medium, we adjust the phase of
|
|
||||||
// the demodulator.
|
|
||||||
// The macro effectively looks at the two least significant
|
|
||||||
// bits in a stream and returns true if they differ.
|
|
||||||
#define TRANSITION_FOUND(bits) BITS_DIFFER((bits), (bits) >> 1)
|
|
||||||
|
|
||||||
// We use this macro to check if the signal transitioned
|
|
||||||
// from one bit (tone) to another. This is used in the phase
|
|
||||||
// synchronisation. We look at the last four bits in the
|
|
||||||
// stream of demodulated bits and if they differ in sets of
|
|
||||||
// two bits, we assume a signal transition occured. We look
|
|
||||||
// at pairs of bits to eliminate false positives where a
|
|
||||||
// single erroneously demodulated bit will trigger an
|
|
||||||
// incorrect phase syncronisation.
|
|
||||||
#define DUAL_XOR(bits1, bits2) ((((bits1)^(bits2)) & 0x03) == 0x03)
|
|
||||||
#define SIGNAL_TRANSITIONED(bits) DUAL_XOR((bits), (bits) >> 2)
|
|
||||||
|
|
||||||
// Phase sync constants
|
|
||||||
#define PHASE_BITS 8 // How much to increment phase counter each sample
|
|
||||||
#define PHASE_INC 1 // Nudge by an eigth of a sample each adjustment
|
|
||||||
#define PHASE_MAX (SAMPLESPERBIT * PHASE_BITS) // Resolution of our phase counter = 64
|
|
||||||
#define PHASE_THRESHOLD (PHASE_MAX / 2) // Target transition point of our phase window
|
|
||||||
|
|
||||||
// Modulation constants
|
|
||||||
#define MARK_FREQ 1200 // The tone frequency signifying a binary one
|
|
||||||
#define SPACE_FREQ 2200 // The tone frequency signifying a binary zero
|
|
||||||
|
|
||||||
// We calculate the amount we need to increment the index
|
|
||||||
// in our sine table for each sample of the two tones
|
|
||||||
#define MARK_INC (uint16_t)(DIV_ROUND(SIN_LEN * (uint32_t)MARK_FREQ, CONFIG_AFSK_DAC_SAMPLERATE))
|
|
||||||
#define SPACE_INC (uint16_t)(DIV_ROUND(SIN_LEN * (uint32_t)SPACE_FREQ, CONFIG_AFSK_DAC_SAMPLERATE))
|
|
||||||
|
|
||||||
// HDLC flag bytes
|
|
||||||
#define HDLC_FLAG 0x7E // An HDLC_FLAG is used to signify the start or end of a frame
|
|
||||||
#define HDLC_RESET 0x7F // An HDLC_RESET is used to abruptly stop or reset a transmission
|
|
||||||
#define AX25_ESC 0x1B // We use the AX.25 escape character for escaping bit sequences in
|
|
||||||
// the actual data. This is similar to escaping an " character in a
|
|
||||||
// string enclosed by "s.
|
|
||||||
|
|
||||||
// Check that sample rate is divisible by bitrate.
|
|
||||||
// If this is not the case, all of our algorithms will
|
|
||||||
// fail horribly and we will cry.
|
|
||||||
STATIC_ASSERT(!(CONFIG_AFSK_DAC_SAMPLERATE % BITRATE));
|
|
||||||
|
|
||||||
// How many samples it takes to encode or decode one bit
|
|
||||||
// on the physical medium.
|
|
||||||
#define DAC_SAMPLESPERBIT (CONFIG_AFSK_DAC_SAMPLERATE / BITRATE)
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// Link Layer Control and Demodulation //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// hdlcParse /////////////////////////////////////////
|
|
||||||
// This function looks at the raw bits demodulated from
|
|
||||||
// the physical medium and tries to parse actual data
|
|
||||||
// packets from the bitstream. Note that at this level,
|
|
||||||
// we don't really try to discriminate when a packet
|
|
||||||
// starts or ends, or where the payload is. We only try
|
|
||||||
// to detect that a transmission is taking place, then
|
|
||||||
// synchronise to the start and end of the transmitted
|
|
||||||
// bytes, and push these up to the data-link layer, in
|
|
||||||
// this example the MP.x protocol. It is then the
|
|
||||||
// protocols job to actually recreate the full packet.
|
|
||||||
// Also note that the data is not "pushed" per se, but
|
|
||||||
// stored in a FIFO buffer, that the protocol must
|
|
||||||
// continously read to recreate the received packets.
|
|
||||||
static bool hdlcParse(Hdlc *hdlc, bool bit, FIFOBuffer *fifo) {
|
|
||||||
// Initialise a return value. We start with the
|
|
||||||
// assumption that all is going to end well :)
|
|
||||||
bool ret = true;
|
|
||||||
|
|
||||||
// Bitshift our byte of demodulated bits to
|
|
||||||
// the left by one bit, to make room for the
|
|
||||||
// next incoming bit
|
|
||||||
hdlc->demodulatedBits <<= 1;
|
|
||||||
// And then put the newest bit from the
|
|
||||||
// demodulator into the byte.
|
|
||||||
hdlc->demodulatedBits |= bit ? 1 : 0;
|
|
||||||
|
|
||||||
// Now we'll look at the last 8 received bits, and
|
|
||||||
// check if we have received a HDLC flag (01111110)
|
|
||||||
if (hdlc->demodulatedBits == HDLC_FLAG) {
|
|
||||||
// If we have, check that our output buffer is
|
|
||||||
// not full.
|
|
||||||
if (!fifo_isfull(fifo)) {
|
|
||||||
// If it isn't, we'll push the HDLC_FLAG into
|
|
||||||
// the buffer and indicate that we are now
|
|
||||||
// receiving data. For bling we also turn
|
|
||||||
// on the RX LED.
|
|
||||||
fifo_push(fifo, HDLC_FLAG);
|
|
||||||
hdlc->receiving = true;
|
|
||||||
LED_RX_ON();
|
|
||||||
} else {
|
|
||||||
// If the buffer is full, we have a problem
|
|
||||||
// and abort by setting the return value to
|
|
||||||
// false and stopping the here.
|
|
||||||
ret = false;
|
|
||||||
hdlc->receiving = false;
|
|
||||||
LED_RX_OFF();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Everytime we receive a HDLC_FLAG, we reset the
|
|
||||||
// storage for our current incoming byte and bit
|
|
||||||
// position in that byte. This effectively
|
|
||||||
// synchronises our parsing to the start and end
|
|
||||||
// of the received bytes.
|
|
||||||
hdlc->currentByte = 0;
|
|
||||||
hdlc->bitIndex = 0;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if we have received a RESET flag (01111111)
|
|
||||||
// In this comparison we also detect when no transmission
|
|
||||||
// (or silence) is taking place, and the demodulator
|
|
||||||
// returns an endless stream of zeroes. Due to the NRZ
|
|
||||||
// coding, the actual bits send to this function will
|
|
||||||
// be an endless stream of ones, which this AND operation
|
|
||||||
// will also detect.
|
|
||||||
if ((hdlc->demodulatedBits & HDLC_RESET) == HDLC_RESET) {
|
|
||||||
// If we have, something probably went wrong at the
|
|
||||||
// transmitting end, and we abort the reception.
|
|
||||||
hdlc->receiving = false;
|
|
||||||
LED_RX_OFF();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we have not yet seen a HDLC_FLAG indicating that
|
|
||||||
// a transmission is actually taking place, don't bother
|
|
||||||
// with anything.
|
|
||||||
if (!hdlc->receiving)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
// First check if what we are seeing is a stuffed bit.
|
|
||||||
// Since the different HDLC control characters like
|
|
||||||
// HDLC_FLAG, HDLC_RESET and such could also occur in
|
|
||||||
// a normal data stream, we employ a method known as
|
|
||||||
// "bit stuffing". All control characters have more than
|
|
||||||
// 5 ones in a row, so if the transmitting party detects
|
|
||||||
// this sequence in the _data_ to be transmitted, it inserts
|
|
||||||
// a zero to avoid the receiving party interpreting it as
|
|
||||||
// a control character. Therefore, if we detect such a
|
|
||||||
// "stuffed bit", we simply ignore it and wait for the
|
|
||||||
// next bit to come in.
|
|
||||||
//
|
|
||||||
// We do the detection by applying an AND bit-mask to the
|
|
||||||
// stream of demodulated bits. This mask is 00111111 (0x3f)
|
|
||||||
// if the result of the operation is 00111110 (0x3e), we
|
|
||||||
// have detected a stuffed bit.
|
|
||||||
if ((hdlc->demodulatedBits & 0x3f) == 0x3e)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
// If we have an actual 1 bit, push this to the current byte
|
|
||||||
// If it's a zero, we don't need to do anything, since the
|
|
||||||
// bit is initialized to zero when we bitshifted earlier.
|
|
||||||
if (hdlc->demodulatedBits & 0x01)
|
|
||||||
hdlc->currentByte |= 0x80;
|
|
||||||
|
|
||||||
// Increment the bitIndex and check if we have a complete byte
|
|
||||||
if (++hdlc->bitIndex >= 8) {
|
|
||||||
// If we have a HDLC control character, put a AX.25 escape
|
|
||||||
// in the received data. We know we need to do this,
|
|
||||||
// because at this point we must have already seen a HDLC
|
|
||||||
// flag, meaning that this control character is the result
|
|
||||||
// of a bitstuffed byte that is equal to said control
|
|
||||||
// character, but is actually part of the data stream.
|
|
||||||
// By inserting the escape character, we tell the protocol
|
|
||||||
// layer that this is not an actual control character, but
|
|
||||||
// data.
|
|
||||||
if ((hdlc->currentByte == HDLC_FLAG ||
|
|
||||||
hdlc->currentByte == HDLC_RESET ||
|
|
||||||
hdlc->currentByte == AX25_ESC)) {
|
|
||||||
// We also need to check that our received data buffer
|
|
||||||
// is not full before putting more data in
|
|
||||||
if (!fifo_isfull(fifo)) {
|
|
||||||
fifo_push(fifo, AX25_ESC);
|
|
||||||
} else {
|
|
||||||
// If it is, abort and return false
|
|
||||||
hdlc->receiving = false;
|
|
||||||
LED_RX_OFF();
|
|
||||||
ret = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Push the actual byte to the received data FIFO,
|
|
||||||
// if it isn't full.
|
|
||||||
if (!fifo_isfull(fifo)) {
|
|
||||||
fifo_push(fifo, hdlc->currentByte);
|
|
||||||
} else {
|
|
||||||
// If it is, well, you know by now!
|
|
||||||
hdlc->receiving = false;
|
|
||||||
LED_RX_OFF();
|
|
||||||
ret = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wipe received byte and reset bit index to 0
|
|
||||||
hdlc->currentByte = 0;
|
|
||||||
hdlc->bitIndex = 0;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// We don't have a full byte yet, bitshift the byte
|
|
||||||
// to make room for the next bit
|
|
||||||
hdlc->currentByte >>= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
// adcISR ////////////////////////////////////////////
|
|
||||||
// This is the Interrupt Service Routine for the
|
|
||||||
// Analog to Digital Conversion. It is called 9600
|
|
||||||
// times each second to analyze the sample taken from
|
|
||||||
// the physical medium. The job of this routine is
|
|
||||||
// to detect whether we have a "mark" or "space"
|
|
||||||
// frequency present on the baseband (the physical
|
|
||||||
// medium). The result of this analysis will then
|
|
||||||
// be passed to the HDLC parser in form of a 1 or a 0
|
|
||||||
void afsk_adc_isr(Afsk *afsk, int8_t currentSample) {
|
|
||||||
// To determine the received frequency, and thereby
|
|
||||||
// the bit of the sample, we multiply the sample by
|
|
||||||
// a sample delayed by (samples per bit / 2).
|
|
||||||
// We then lowpass-filter the samples with a
|
|
||||||
// Chebyshev filter. The lowpass filtering serves
|
|
||||||
// to "smooth out" the variations in the samples.
|
|
||||||
|
|
||||||
afsk->iirX[0] = afsk->iirX[1];
|
|
||||||
afsk->iirX[1] = ((int8_t)fifo_pop(&afsk->delayFifo) * currentSample) >> 2;
|
|
||||||
|
|
||||||
afsk->iirY[0] = afsk->iirY[1];
|
|
||||||
|
|
||||||
afsk->iirY[1] = afsk->iirX[0] + afsk->iirX[1] + (afsk->iirY[0] >> 1); // Chebyshev filter
|
|
||||||
|
|
||||||
|
|
||||||
// We put the sampled bit in a delay-line:
|
|
||||||
// First we bitshift everything 1 left
|
|
||||||
afsk->sampledBits <<= 1;
|
|
||||||
// And then add the sampled bit to our delay line
|
|
||||||
afsk->sampledBits |= (afsk->iirY[1] > 0) ? 1 : 0;
|
|
||||||
|
|
||||||
// Put the current raw sample in the delay FIFO
|
|
||||||
fifo_push(&afsk->delayFifo, currentSample);
|
|
||||||
|
|
||||||
// We need to check whether there is a signal transition.
|
|
||||||
// If there is, we can recalibrate the phase of our
|
|
||||||
// sampler to stay in sync with the transmitter. A bit of
|
|
||||||
// explanation is required to understand how this works.
|
|
||||||
// Since we have PHASE_MAX/PHASE_BITS = 8 samples per bit,
|
|
||||||
// we employ a phase counter (currentPhase), that increments
|
|
||||||
// by PHASE_BITS everytime a sample is captured. When this
|
|
||||||
// counter reaches PHASE_MAX, it wraps around by modulus
|
|
||||||
// PHASE_MAX. We then look at the last three samples we
|
|
||||||
// captured and determine if the bit was a one or a zero.
|
|
||||||
//
|
|
||||||
// This gives us a "window" looking into the stream of
|
|
||||||
// samples coming from the ADC. Sort of like this:
|
|
||||||
//
|
|
||||||
// Past Future
|
|
||||||
// 0000000011111111000000001111111100000000
|
|
||||||
// |________|
|
|
||||||
// ||
|
|
||||||
// Window
|
|
||||||
//
|
|
||||||
// Every time we detect a signal transition, we adjust
|
|
||||||
// where this window is positioned little. How much we
|
|
||||||
// adjust it is defined by PHASE_INC. If our current phase
|
|
||||||
// phase counter value is less than half of PHASE_MAX (ie,
|
|
||||||
// the window size) when a signal transition is detected,
|
|
||||||
// add PHASE_INC to our phase counter, effectively moving
|
|
||||||
// the window a little bit backward (to the left in the
|
|
||||||
// illustration), inversely, if the phase counter is greater
|
|
||||||
// than half of PHASE_MAX, we move it forward a little.
|
|
||||||
// This way, our "window" is constantly seeking to position
|
|
||||||
// it's center at the bit transitions. Thus, we synchronise
|
|
||||||
// our timing to the transmitter, even if it's timing is
|
|
||||||
// a little off compared to our own.
|
|
||||||
if (SIGNAL_TRANSITIONED(afsk->sampledBits)) {
|
|
||||||
if (afsk->currentPhase < PHASE_THRESHOLD) {
|
|
||||||
afsk->currentPhase += PHASE_INC;
|
|
||||||
} else {
|
|
||||||
afsk->currentPhase -= PHASE_INC;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We increment our phase counter
|
|
||||||
afsk->currentPhase += PHASE_BITS;
|
|
||||||
|
|
||||||
// Check if we have reached the end of
|
|
||||||
// our sampling window.
|
|
||||||
if (afsk->currentPhase >= PHASE_MAX) {
|
|
||||||
// If we have, wrap around our phase
|
|
||||||
// counter by modulus
|
|
||||||
afsk->currentPhase %= PHASE_MAX;
|
|
||||||
|
|
||||||
// Bitshift to make room for the next
|
|
||||||
// bit in our stream of demodulated bits
|
|
||||||
afsk->actualBits <<= 1;
|
|
||||||
|
|
||||||
// We determine the actual bit value by reading
|
|
||||||
// the last 3 sampled bits. If there is three or
|
|
||||||
// more 1's, we will assume that the transmitter
|
|
||||||
// sent us a one, otherwise we assume a zero
|
|
||||||
uint8_t bits = afsk->sampledBits & 0x07;
|
|
||||||
if (bits == 0x07 || // 111
|
|
||||||
bits == 0x06 || // 110
|
|
||||||
bits == 0x05 || // 101
|
|
||||||
bits == 0x03 // 011
|
|
||||||
) {
|
|
||||||
afsk->actualBits |= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//// Alternative using five bits ////////////////
|
|
||||||
// uint8_t bits = afsk->sampledBits & 0x0f;
|
|
||||||
// uint8_t c = 0;
|
|
||||||
// c += bits & BV(1);
|
|
||||||
// c += bits & BV(2);
|
|
||||||
// c += bits & BV(3);
|
|
||||||
// c += bits & BV(4);
|
|
||||||
// c += bits & BV(5);
|
|
||||||
// if (c >= 3) afsk->actualBits |= 1;
|
|
||||||
/////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Now we can pass the actual bit to the HDLC parser.
|
|
||||||
// We are using NRZ coding, so if 2 consecutive bits
|
|
||||||
// have the same value, we have a 1, otherwise a 0.
|
|
||||||
// We use the TRANSITION_FOUND function to determine this.
|
|
||||||
//
|
|
||||||
// This is smart in combination with bit stuffing,
|
|
||||||
// since it ensures a transmitter will never send more
|
|
||||||
// than five consecutive 1's. When sending consecutive
|
|
||||||
// ones, the signal stays at the same level, and if
|
|
||||||
// this happens for longer periods of time, we would
|
|
||||||
// not be able to synchronize our phase to the transmitter
|
|
||||||
// and would start experiencing "bit slip".
|
|
||||||
//
|
|
||||||
// By combining bit-stuffing with NRZ coding, we ensure
|
|
||||||
// that the signal will regularly make transitions
|
|
||||||
// that we can use to synchronize our phase.
|
|
||||||
//
|
|
||||||
// We also check the return of the Link Control parser
|
|
||||||
// to check if an error occured.
|
|
||||||
|
|
||||||
if (!hdlcParse(&afsk->hdlc, !TRANSITION_FOUND(afsk->actualBits), &afsk->rxFifo)) {
|
|
||||||
afsk->status |= RX_OVERRUN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// Signal modulation and DAC //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Defines how many consecutive ones we send
|
|
||||||
// before we need to "stuff" in a zero
|
|
||||||
#define BIT_STUFF_LEN 5
|
|
||||||
|
|
||||||
// A macro for switching what tone is being
|
|
||||||
// synthesized by the DAC. We basically just
|
|
||||||
// change how quickly we go through the sine
|
|
||||||
// table each time we send out a sample. This
|
|
||||||
// is done by changing the phaseInc variable
|
|
||||||
#define SWITCH_TONE(inc) (((inc) == MARK_INC) ? SPACE_INC : MARK_INC)
|
|
||||||
|
|
||||||
// This function starts the transmission
|
|
||||||
static void afsk_txStart(Afsk *afsk) {
|
|
||||||
if (!afsk->sending) {
|
|
||||||
// Initialize the phase increment to
|
|
||||||
// that of the mark frequency (zero)
|
|
||||||
afsk->phaseInc = MARK_INC;
|
|
||||||
// Reset the phase accumulator to 0
|
|
||||||
afsk->phaseAcc = 0;
|
|
||||||
// And also the bitstuff counter
|
|
||||||
afsk->bitstuffCount = 0;
|
|
||||||
// Indicate we are now sending
|
|
||||||
afsk->sending = true;
|
|
||||||
// And turn on the blingy LED
|
|
||||||
LED_TX_ON();
|
|
||||||
// We also need to calculate how many HDLC_FLAG
|
|
||||||
// bytes we need to send in preamble
|
|
||||||
afsk->preambleLength = DIV_ROUND(custom_preamble * BITRATE, 8000);
|
|
||||||
//afsk->preambleLength = DIV_ROUND(CONFIG_AFSK_PREAMBLE_LEN * BITRATE, 8000);
|
|
||||||
|
|
||||||
AFSK_DAC_IRQ_START();
|
|
||||||
}
|
|
||||||
// We make the same calculation for the tail length,
|
|
||||||
// but this needs to be atomic, since the txStart
|
|
||||||
// function could potentially be called while we
|
|
||||||
// are already transmitting.
|
|
||||||
|
|
||||||
ATOMIC(afsk->tailLength = DIV_ROUND(custom_tail * BITRATE, 8000));
|
|
||||||
//ATOMIC(afsk->tailLength = DIV_ROUND(CONFIG_AFSK_TRAILER_LEN * BITRATE, 8000));
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is the DAC ISR, called at sampling rate whenever the DAC IRQ is on.
|
|
||||||
// It modulates the data to be transmitted and returns a value directly
|
|
||||||
// for output on the DAC
|
|
||||||
uint8_t afsk_dac_isr(Afsk *afsk) {
|
|
||||||
// Check whether we are at the beginning of a sample
|
|
||||||
if (afsk->sampleIndex == 0) {
|
|
||||||
// If we are, we should figure out what we are
|
|
||||||
// actually going to modulate and transmit :)
|
|
||||||
if (afsk->txBit == 0) {
|
|
||||||
// txBit is a bitmask that is ANDed to the
|
|
||||||
// byte we are sending. It is bitshifted one
|
|
||||||
// position left each time we shift the next
|
|
||||||
// bit. If it is 0, we know we are at the
|
|
||||||
// beginning of the next byte, and nothing
|
|
||||||
// has been transmitted yet.
|
|
||||||
|
|
||||||
// If TX FIFO is empty and tail-length has decremented to 0
|
|
||||||
// we are done, stop the IRQ and reset
|
|
||||||
if (fifo_isempty(&afsk->txFifo) && afsk->tailLength == 0) {
|
|
||||||
AFSK_DAC_IRQ_STOP();
|
|
||||||
afsk->sending = false;
|
|
||||||
LED_TX_OFF();
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
// Reset the bitstuff counter if we have just sent
|
|
||||||
// a bitstuffed byte
|
|
||||||
if (!afsk->bitStuff) afsk->bitstuffCount = 0;
|
|
||||||
// Reset bitstuff indicator to true, signifying
|
|
||||||
// that it's ok to bit stuff.
|
|
||||||
afsk->bitStuff = true;
|
|
||||||
|
|
||||||
// Check if we are in preamble or tail
|
|
||||||
if (afsk->preambleLength == 0) {
|
|
||||||
// We are not in preamble
|
|
||||||
if (fifo_isempty(&afsk->txFifo)) {
|
|
||||||
// If the TX buffer is empty, we must
|
|
||||||
// be in the TX tail then.
|
|
||||||
// Decrement the tail counter and send
|
|
||||||
// a HDLC_FLAG
|
|
||||||
afsk->tailLength--;
|
|
||||||
afsk->currentOutputByte = HDLC_FLAG;
|
|
||||||
} else {
|
|
||||||
// If preamble is already transmitted and TX
|
|
||||||
// buffer is not empty, we should get a byte
|
|
||||||
// for transmission
|
|
||||||
afsk->currentOutputByte = fifo_pop(&afsk->txFifo);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// We are in preamble. We'll decrement
|
|
||||||
// the preamble counter and transmit a
|
|
||||||
// HDLC_FLAG
|
|
||||||
afsk->preambleLength--;
|
|
||||||
afsk->currentOutputByte = HDLC_FLAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This handles escape sequences and control
|
|
||||||
// characters. First we check if the current
|
|
||||||
// byte is an escape character. If it is, we
|
|
||||||
// know the next byte, even though it looks
|
|
||||||
// like an HDLC control character, in fact is
|
|
||||||
// not. Therefore we'll fetch it and transmit
|
|
||||||
// it as data using bit stuffing.
|
|
||||||
if (afsk->currentOutputByte == AX25_ESC) {
|
|
||||||
// First make sure that the TX buffer is
|
|
||||||
// not empty for some strange reason
|
|
||||||
if (fifo_isempty(&afsk->txFifo)) {
|
|
||||||
AFSK_DAC_IRQ_STOP();
|
|
||||||
afsk->sending = false;
|
|
||||||
LED_TX_OFF();
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
// If it is not, fetch the next byte
|
|
||||||
afsk->currentOutputByte = fifo_pop(&afsk->txFifo);
|
|
||||||
}
|
|
||||||
} else if (afsk->currentOutputByte == HDLC_FLAG || afsk->currentOutputByte == HDLC_RESET) {
|
|
||||||
// If there was not an escape character and
|
|
||||||
// this byte is an HDLC control character,
|
|
||||||
// we know that it is an _actual_ control
|
|
||||||
// character, and we indicate that it should
|
|
||||||
// not be bitstuffed.
|
|
||||||
afsk->bitStuff = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Since we are at the beginning of a byte,
|
|
||||||
// we'll initialize the txBit mask to:
|
|
||||||
// 00000001. It will then be bit-shifted one
|
|
||||||
// position to the left each time we send the
|
|
||||||
// next bit. By ANDing this mask to the byte
|
|
||||||
// we are sending, we can quickly figure out
|
|
||||||
// what tone we should transmit. For example:
|
|
||||||
//
|
|
||||||
// If we are sending bit number 4 of the
|
|
||||||
// byte: 01101011
|
|
||||||
// The bit mask would be: 00001000
|
|
||||||
// If we AND the byte and the
|
|
||||||
// mask, we get: 00001000
|
|
||||||
// Since this is not zero, we know we should
|
|
||||||
// transmit a one.
|
|
||||||
afsk->txBit = 0x01;
|
|
||||||
}
|
|
||||||
|
|
||||||
// First we need to check for bit-stuffing
|
|
||||||
if (afsk->bitStuff && afsk->bitstuffCount >= BIT_STUFF_LEN) {
|
|
||||||
// If we are allowed to bit-stuff, and we have
|
|
||||||
// reached the maximum number of consecutive
|
|
||||||
// ones, we'll reset the bit-stuff counter and
|
|
||||||
// insert a zero into the bitstream
|
|
||||||
afsk->bitstuffCount = 0;
|
|
||||||
afsk->phaseInc = SWITCH_TONE(afsk->phaseInc);
|
|
||||||
} else {
|
|
||||||
// If we don't need to bit-stuff now, we can get
|
|
||||||
// on with the actual transmission.
|
|
||||||
//
|
|
||||||
// We are using NRZ so if we want to transmit a 1
|
|
||||||
// the modulated signal will stay the same. For a 0
|
|
||||||
// we make the signal transition.
|
|
||||||
if (afsk->currentOutputByte & afsk->txBit) {
|
|
||||||
// We don't do anything, aka stay on the same
|
|
||||||
// tone as before. We have sent one 1, so we
|
|
||||||
// increment the bitstuff counter.
|
|
||||||
afsk->bitstuffCount++;
|
|
||||||
} else {
|
|
||||||
// We switch the tone, and reset the bitstuff
|
|
||||||
// counter, since we have now transmitted a
|
|
||||||
// zero
|
|
||||||
afsk->bitstuffCount = 0;
|
|
||||||
afsk->phaseInc = SWITCH_TONE(afsk->phaseInc);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bitshift the mast to allow for the next
|
|
||||||
// bit in the byte to be transmitted
|
|
||||||
afsk->txBit <<= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We set sampleIndex to DAC_SAMPLESPERBIT,
|
|
||||||
// so we will transmit this bit for the number
|
|
||||||
// of samples one bit requires to transmit at
|
|
||||||
// the chosen bitrate.
|
|
||||||
afsk->sampleIndex = DAC_SAMPLESPERBIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We increment the phase accumulator
|
|
||||||
// by the amount needed for the tone
|
|
||||||
afsk->phaseAcc += afsk->phaseInc;
|
|
||||||
// We then make sure that we have not
|
|
||||||
// exceeded the length of our sine table
|
|
||||||
afsk->phaseAcc %= SIN_LEN;
|
|
||||||
// Finally we decrement the sample counter
|
|
||||||
afsk->sampleIndex--;
|
|
||||||
// ... and return the sample to for it to
|
|
||||||
// be written out
|
|
||||||
return sinSample(afsk->phaseAcc);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// File operation functions for read/write //
|
|
||||||
// These functions make the "class" act like a file //
|
|
||||||
// pointer, which can be read from or written to. //
|
|
||||||
// Handy for sending and receiving data :) //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Read from the modem
|
|
||||||
static size_t afsk_read(KFile *fd, void *_buf, size_t size) {
|
|
||||||
Afsk *afsk = AFSK_CAST(fd);
|
|
||||||
uint8_t *buffer = (uint8_t *)_buf;
|
|
||||||
|
|
||||||
#if CONFIG_AFSK_RXTIMEOUT == 0
|
|
||||||
while (size-- && !fifo_isempty_locked(&afsk->rxFifo))
|
|
||||||
#else
|
|
||||||
while (size--)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
#if CONFIG_AFSK_RXTIMEOUT != -1
|
|
||||||
ticks_t start = timer_clock();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (fifo_isempty_locked(&afsk->rxFifo)) {
|
|
||||||
cpu_relax();
|
|
||||||
#if CONFIG_AFSK_RXTIMEOUT != -1
|
|
||||||
if (timer_clock() - start > ms_to_ticks(CONFIG_AFSK_RXTIMEOUT)) {
|
|
||||||
return buffer - (uint8_t *)_buf;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
*buffer++ = fifo_pop_locked(&afsk->rxFifo);
|
|
||||||
}
|
|
||||||
|
|
||||||
return buffer - (uint8_t *)_buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write to the modem
|
|
||||||
static size_t afsk_write(KFile *fd, const void *_buf, size_t size) {
|
|
||||||
Afsk *afsk = AFSK_CAST(fd);
|
|
||||||
const uint8_t *buf = (const uint8_t *)_buf;
|
|
||||||
|
|
||||||
while (size--) {
|
|
||||||
while (fifo_isfull_locked(&afsk->txFifo)) {
|
|
||||||
cpu_relax();
|
|
||||||
}
|
|
||||||
|
|
||||||
fifo_push_locked(&afsk->txFifo, *buf++);
|
|
||||||
afsk_txStart(afsk);
|
|
||||||
}
|
|
||||||
|
|
||||||
return buf - (const uint8_t *)_buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Waits for the write operation to finish
|
|
||||||
static int afsk_flush(KFile *fd) {
|
|
||||||
Afsk *afsk = AFSK_CAST(fd);
|
|
||||||
while (afsk->sending) {
|
|
||||||
cpu_relax();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check whether there was any errors
|
|
||||||
// while reading or writing
|
|
||||||
static int afsk_error(KFile *fd) {
|
|
||||||
Afsk *afsk = AFSK_CAST(fd);
|
|
||||||
int err;
|
|
||||||
ATOMIC(err = afsk->status);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allows resetting the error-state
|
|
||||||
static void afsk_clearerr(KFile *fd) {
|
|
||||||
Afsk *afsk = AFSK_CAST(fd);
|
|
||||||
ATOMIC(afsk->status = 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// Modem Initialization //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void afsk_init(Afsk *afsk, int _adcPin) {
|
|
||||||
// Allocate memory for struct
|
|
||||||
memset(afsk, 0, sizeof(*afsk));
|
|
||||||
|
|
||||||
// Configure ADC pin
|
|
||||||
afsk->adcPin = _adcPin;
|
|
||||||
|
|
||||||
// Initialise phase increment to that
|
|
||||||
// of the mark frequency
|
|
||||||
afsk->phaseInc = MARK_INC;
|
|
||||||
|
|
||||||
// Initialize FIFO buffers
|
|
||||||
fifo_init(&afsk->delayFifo, (uint8_t *)afsk->delayBuf, sizeof(afsk->delayBuf));
|
|
||||||
fifo_init(&afsk->rxFifo, afsk->rxBuf, sizeof(afsk->rxBuf));
|
|
||||||
fifo_init(&afsk->txFifo, afsk->txBuf, sizeof(afsk->txBuf));
|
|
||||||
|
|
||||||
// Fill delay FIFO with zeroes
|
|
||||||
for (int i = 0; i<SAMPLESPERBIT / 2; i++) {
|
|
||||||
fifo_push(&afsk->delayFifo, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize hardware
|
|
||||||
AFSK_ADC_INIT(_adcPin, afsk);
|
|
||||||
AFSK_DAC_INIT();
|
|
||||||
LED_TX_INIT();
|
|
||||||
LED_RX_INIT();
|
|
||||||
|
|
||||||
// And register the modem file-pointer
|
|
||||||
// functions for reading from and
|
|
||||||
// writing to it.
|
|
||||||
DB(afsk->fd._type = KFT_AFSK);
|
|
||||||
afsk->fd.write = afsk_write;
|
|
||||||
afsk->fd.read = afsk_read;
|
|
||||||
afsk->fd.flush = afsk_flush;
|
|
||||||
afsk->fd.error = afsk_error;
|
|
||||||
afsk->fd.clearerr = afsk_clearerr;
|
|
||||||
}
|
|
120
Modem/afsk.h
|
@ -1,120 +0,0 @@
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// First things first, all the includes we need //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef FSK_MODEM_H
|
|
||||||
#define FSK_MODEM_H
|
|
||||||
|
|
||||||
#include "config.h" // Various configuration values
|
|
||||||
#include "hardware.h" // Hardware functions
|
|
||||||
|
|
||||||
#include <cfg/compiler.h> // Compiler info from BertOS
|
|
||||||
#include <struct/fifobuf.h> // FIFO buffer implementation from BertOS
|
|
||||||
#include <io/kfile.h> // The BertOS KFile interface. This is
|
|
||||||
// used for letting other functions read
|
|
||||||
// from or write to the modem like a
|
|
||||||
// file descriptor.
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// Our type definitions and function declarations //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#define SAMPLERATE 9600 // The rate at which we are sampling and synthesizing
|
|
||||||
#define BITRATE 1200 // The actual bitrate at baseband. This is the baudrate.
|
|
||||||
#define SAMPLESPERBIT (SAMPLERATE / BITRATE) // How many DAC/ADC samples constitute one bit (8).
|
|
||||||
|
|
||||||
// This defines an errortype for a receive-
|
|
||||||
// buffer overrun.
|
|
||||||
#define RX_OVERRUN BV(0)
|
|
||||||
|
|
||||||
// This struct defines a Hdlc parser. It will let
|
|
||||||
// us parse the raw bits coming in from the modem
|
|
||||||
// and synchronise to byte boundaries.
|
|
||||||
typedef struct Hdlc
|
|
||||||
{
|
|
||||||
uint8_t demodulatedBits; // Incoming bitstream from demodulator
|
|
||||||
uint8_t bitIndex; // The current received bit in the current received byte
|
|
||||||
uint8_t currentByte; // The byte we're currently receiving
|
|
||||||
bool receiving; // Whether or not where actually receiving data (or just noise ;P)
|
|
||||||
} Hdlc;
|
|
||||||
|
|
||||||
// This is our primary modem struct. It defines
|
|
||||||
// all the values we need to modulate and
|
|
||||||
// demodulate data from the physical medium.
|
|
||||||
typedef struct Afsk
|
|
||||||
{
|
|
||||||
KFile fd; // A file descriptor for reading from and
|
|
||||||
// writing to the modem
|
|
||||||
|
|
||||||
// I/O hardware pins
|
|
||||||
int adcPin; // Pin for incoming signal
|
|
||||||
|
|
||||||
// General values
|
|
||||||
Hdlc hdlc; // We need a link control structure
|
|
||||||
uint16_t preambleLength; // Length of sync preamble
|
|
||||||
uint16_t tailLength; // Length of transmission tail
|
|
||||||
|
|
||||||
// Modulation values
|
|
||||||
uint8_t sampleIndex; // Current sample index for outgoing bit
|
|
||||||
uint8_t currentOutputByte; // Current byte to be modulated
|
|
||||||
uint8_t txBit; // Mask of current modulated bit
|
|
||||||
bool bitStuff; // Whether bitstuffing is allowed
|
|
||||||
|
|
||||||
uint8_t bitstuffCount; // Counter for bit-stuffing
|
|
||||||
|
|
||||||
uint16_t phaseAcc; // Phase accumulator
|
|
||||||
uint16_t phaseInc; // Phase increment per sample
|
|
||||||
|
|
||||||
FIFOBuffer txFifo; // FIFO for transmit data
|
|
||||||
uint8_t txBuf[CONFIG_AFSK_TX_BUFLEN]; // Actial data storage for said FIFO
|
|
||||||
|
|
||||||
volatile bool sending; // Set when modem is sending
|
|
||||||
|
|
||||||
// Demodulation values
|
|
||||||
FIFOBuffer delayFifo; // Delayed FIFO for frequency discrimination
|
|
||||||
int8_t delayBuf[SAMPLESPERBIT / 2 + 1]; // Actual data storage for said FIFO
|
|
||||||
|
|
||||||
FIFOBuffer rxFifo; // FIFO for received data
|
|
||||||
uint8_t rxBuf[CONFIG_AFSK_RX_BUFLEN]; // Actual data storage for said FIFO
|
|
||||||
|
|
||||||
int16_t iirX[2]; // IIR Filter X cells
|
|
||||||
int16_t iirY[2]; // IIR Filter Y cells
|
|
||||||
|
|
||||||
uint8_t sampledBits; // Bits sampled by the demodulator (at ADC speed)
|
|
||||||
int8_t currentPhase; // Current phase of the demodulator
|
|
||||||
uint8_t actualBits; // Actual found bits at correct bitrate
|
|
||||||
|
|
||||||
volatile int status; // Status of the modem, 0 means OK
|
|
||||||
|
|
||||||
} Afsk;
|
|
||||||
|
|
||||||
// Explanation nessecary for this. BertOS uses an
|
|
||||||
// object-oriented approach for handling "file-like"
|
|
||||||
// transactions (yes, we are using C :P). What we are
|
|
||||||
// doing here is defining a specific "file type" for
|
|
||||||
// the standard KFile to identify the modem as a "file"
|
|
||||||
// that can be read from and written to.
|
|
||||||
#define KFT_AFSK MAKE_ID('F', 'S', 'K', 'M')
|
|
||||||
|
|
||||||
// We then make a macro that can "typecast" a generic
|
|
||||||
// KFile file-pointer to an Afsk "object". This lets
|
|
||||||
// other pieces of code read from and write to the AFSK
|
|
||||||
// "objects" buffers with the standard KFile operations.
|
|
||||||
// If this seems weird and confusing, check out the
|
|
||||||
// BertOS KFile explanation at:
|
|
||||||
// http://www.bertos.org/use/tutorial-front-page/drivers-kfile-interface
|
|
||||||
INLINE Afsk *AFSK_CAST(KFile *fd) {
|
|
||||||
// We need to assert that the what we are trying
|
|
||||||
// to read/write is actually an AFSK "object",
|
|
||||||
// identified by the KFT_AFSK constant
|
|
||||||
ASSERT(fd->_type == KFT_AFSK);
|
|
||||||
return (Afsk *)fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Declare Interrupt Service Routines
|
|
||||||
// and initialization functions
|
|
||||||
void afsk_adc_isr(Afsk *af, int8_t sample);
|
|
||||||
uint8_t afsk_dac_isr(Afsk *af);
|
|
||||||
void afsk_init(Afsk *af, int adc_ch);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,65 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2008 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
* All Rights Reserved.
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Configuration file for formatted write module.
|
|
||||||
*
|
|
||||||
* \author Daniele Basile <asterix@develer.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CFG_FORMATWR_H
|
|
||||||
#define CFG_FORMATWR_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* printf()-style formatter configuration.
|
|
||||||
* $WIZ$ type = "enum"; value_list = "printf_list"
|
|
||||||
*
|
|
||||||
* \sa PRINTF_DISABLED
|
|
||||||
* \sa PRINTF_NOMODIFIERS
|
|
||||||
* \sa PRINTF_REDUCED
|
|
||||||
* \sa PRINTF_NOFLOAT
|
|
||||||
* \sa PRINTF_FULL
|
|
||||||
*/
|
|
||||||
#define CONFIG_PRINTF PRINTF_FULL
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Size of buffer to format "%" sequences in printf.
|
|
||||||
*
|
|
||||||
* Warning: no check on buffer size is done when formatting, be careful especially
|
|
||||||
* with big numbers and %f formatting.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "int"
|
|
||||||
* $WIZ$ min = 4
|
|
||||||
*/
|
|
||||||
#define CONFIG_FRMWRI_BUFSIZE 134
|
|
||||||
|
|
||||||
#endif /* CFG_FORMATWR_H */
|
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2008 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
*
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Configuration file for KFile interface module.
|
|
||||||
*
|
|
||||||
* \author Daniele Basile <asterix@develer.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CFG_KFILE_H
|
|
||||||
#define CFG_KFILE_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module logging level.
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "log_level"
|
|
||||||
*/
|
|
||||||
#define KFILE_LOG_LEVEL LOG_LVL_INFO
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module logging format.
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "log_format"
|
|
||||||
*/
|
|
||||||
#define KFILE_LOG_FORMAT LOG_FMT_TERSE
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable the gets function with echo.
|
|
||||||
* $WIZ$ type = "boolean"
|
|
||||||
*/
|
|
||||||
#define CONFIG_KFILE_GETS 0
|
|
||||||
|
|
||||||
#endif /* CFG_KFILE_H */
|
|
|
@ -1,47 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2001, 2004 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
* Copyright 1999, 2000, 2001, 2008 Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Kernel monitor configuration parameters
|
|
||||||
*
|
|
||||||
* \author Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CFG_MONITOR_H
|
|
||||||
#define CFG_MONITOR_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Process monitor.
|
|
||||||
* $WIZ$ type = "autoenabled"
|
|
||||||
*/
|
|
||||||
#define CONFIG_KERN_MONITOR 0
|
|
||||||
|
|
||||||
#endif /* CFG_MONITOR_H */
|
|
|
@ -1,113 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2001, 2004 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
* Copyright 1999, 2000, 2001, 2008 Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Kernel configuration parameters
|
|
||||||
*
|
|
||||||
* \author Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CFG_PROC_H
|
|
||||||
#define CFG_PROC_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable the multithreading kernel.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "autoenabled"
|
|
||||||
*/
|
|
||||||
#define CONFIG_KERN 0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Kernel interrupt supervisor. WARNING: Experimental, still incomplete!
|
|
||||||
* $WIZ$ type = "boolean"
|
|
||||||
* $WIZ$ supports = "False"
|
|
||||||
*/
|
|
||||||
#define CONFIG_KERN_IRQ 0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Preemptive process scheduling.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "boolean"
|
|
||||||
* $WIZ$ conditional_deps = "timer"
|
|
||||||
*/
|
|
||||||
#define CONFIG_KERN_PREEMPT 0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Time sharing quantum (a prime number prevents interference effects) [ms].
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "int"
|
|
||||||
* $WIZ$ min = 1
|
|
||||||
*/
|
|
||||||
#define CONFIG_KERN_QUANTUM 11
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Priority-based scheduling policy.
|
|
||||||
* $WIZ$ type = "boolean"
|
|
||||||
*/
|
|
||||||
#define CONFIG_KERN_PRI 1
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Priority-inheritance protocol.
|
|
||||||
* $WIZ$ type = "boolean"
|
|
||||||
*/
|
|
||||||
#define CONFIG_KERN_PRI_INHERIT 0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dynamic memory allocation for processes.
|
|
||||||
* $WIZ$ type = "boolean"
|
|
||||||
* $WIZ$ conditional_deps = "heap"
|
|
||||||
*/
|
|
||||||
#define CONFIG_KERN_HEAP 0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Size of the dynamic memory pool used by processes.
|
|
||||||
* $WIZ$ type = "int"
|
|
||||||
* $WIZ$ min = 0
|
|
||||||
*/
|
|
||||||
#define CONFIG_KERN_HEAP_SIZE 2048L
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module logging level.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "log_level"
|
|
||||||
*/
|
|
||||||
#define KERN_LOG_LEVEL LOG_LVL_ERR
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module logging format.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "log_format"
|
|
||||||
*/
|
|
||||||
#define KERN_LOG_FORMAT LOG_FMT_VERBOSE
|
|
||||||
|
|
||||||
#endif /* CFG_PROC_H */
|
|
|
@ -1,47 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2001, 2004 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
* Copyright 1999, 2000, 2001, 2008 Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Kernel signals configuration parameters
|
|
||||||
*
|
|
||||||
* \author Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CFG_SIGNAL_H
|
|
||||||
#define CFG_SIGNAL_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Inter-process signals.
|
|
||||||
* $WIZ$ type = "autoenabled"
|
|
||||||
*/
|
|
||||||
#define CONFIG_KERN_SIGNALS 0
|
|
||||||
|
|
||||||
#endif /* CFG_SIGNAL_H */
|
|
|
@ -1,47 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2008 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
* All Rights Reserved.
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Configuration file for watchdog module.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* \author Daniele Basile <asterix@develer.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CFG_WDT_H
|
|
||||||
#define CFG_WDT_H
|
|
||||||
|
|
||||||
/// Enable watchdog timer. $WIZ$ type = "autoenabled"
|
|
||||||
#define CONFIG_WATCHDOG 0
|
|
||||||
|
|
||||||
#endif /* CFG_WDT_H */
|
|
||||||
|
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
|
|
||||||
#ifndef FSK_CFG
|
|
||||||
#define FSK_CFG
|
|
||||||
|
|
||||||
// Serial options
|
|
||||||
#define PROTOCOL_SIMPLE_SERIAL 0x01
|
|
||||||
#define PROTOCOL_KISS 0x02
|
|
||||||
|
|
||||||
// Which serial protocol we want the modem to use
|
|
||||||
#define SERIAL_PROTOCOL PROTOCOL_SIMPLE_SERIAL
|
|
||||||
//#define SERIAL_PROTOCOL PROTOCOL_KISS
|
|
||||||
|
|
||||||
// Enable P-persistent CSMA
|
|
||||||
#define CSMA_ENABLE true
|
|
||||||
|
|
||||||
// Debug & test options
|
|
||||||
#define SERIAL_DEBUG false
|
|
||||||
#define PASSALL true
|
|
||||||
#define AUTOREPLY false
|
|
||||||
|
|
||||||
// Modem options
|
|
||||||
#define TX_MAXWAIT 2UL // How many milliseconds should pass with no
|
|
||||||
// no incoming data before it is transmitted
|
|
||||||
#define CONFIG_AFSK_RX_BUFLEN 64 // The size of the modems receive buffer
|
|
||||||
#define CONFIG_AFSK_TX_BUFLEN 64 // The size of the modems transmit buffer
|
|
||||||
#define CONFIG_AFSK_DAC_SAMPLERATE 9600 // The samplerate of the DAC. Note that
|
|
||||||
// changing it here will not change the
|
|
||||||
// actual sample rate. It is defined here
|
|
||||||
// so various functions can use it.
|
|
||||||
#define CONFIG_AFSK_RXTIMEOUT 0 // How long a read operation from the modem
|
|
||||||
// will wait for data before timing out.
|
|
||||||
|
|
||||||
#define CONFIG_AFSK_PREAMBLE_LEN 350UL // The length of the packet preamble in milliseconds
|
|
||||||
#define CONFIG_AFSK_TRAILER_LEN 50UL // The length of the packet tail in milliseconds
|
|
||||||
|
|
||||||
#endif
|
|
168
Modem/hardware.c
|
@ -1,168 +0,0 @@
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// First things first, all the includes we need //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#include "hardware.h" // We need the header for this code
|
|
||||||
#include "afsk.h" // We also need to know about the AFSK modem
|
|
||||||
|
|
||||||
#include <cpu/irq.h> // Interrupt functions from BertOS
|
|
||||||
|
|
||||||
#include <avr/io.h> // AVR IO functions from BertOS
|
|
||||||
#include <avr/interrupt.h> // AVR interrupt functions from BertOS
|
|
||||||
|
|
||||||
// A reference to our modem "object"
|
|
||||||
static Afsk *modem;
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// And now for the actual hardware functions //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// M1 correction = 9500
|
|
||||||
// M2 correction = 40000
|
|
||||||
#define FREQUENCY_CORRECTION 0
|
|
||||||
|
|
||||||
// This function initializes the ADC and configures
|
|
||||||
// it the way we need.
|
|
||||||
void hw_afsk_adcInit(int ch, Afsk *_modem)
|
|
||||||
{
|
|
||||||
// Store a reference to our modem "object"
|
|
||||||
modem = _modem;
|
|
||||||
|
|
||||||
// Also make sure that we are not trying to use
|
|
||||||
// a pin that can't be used for analog input
|
|
||||||
ASSERT(ch <= 5);
|
|
||||||
|
|
||||||
// We need a timer to control how often our sampling functions
|
|
||||||
// should run. To do this we will need to change some registers.
|
|
||||||
// First we do some configuration on the Timer/Counter Control
|
|
||||||
// Register 1, aka Timer1.
|
|
||||||
//
|
|
||||||
// The following bits are set:
|
|
||||||
// CS10: ClockSource 10, sets no prescaler on the clock,
|
|
||||||
// meaning it will run at the same speed as the CPU, ie 16MHz
|
|
||||||
// WGM13 and WGM12 together enables "Timer Mode 12", which
|
|
||||||
// is Clear Timer on Compare, compare set to TOP, and the
|
|
||||||
// source for the TOP value is ICR1 (Input Capture Register1).
|
|
||||||
// TOP means that we specify a maximum value for the timer, and
|
|
||||||
// once that value is reached, an interrupt will be triggered.
|
|
||||||
// The timer will then start from zero again. As just noted,
|
|
||||||
// the place we specify this value is in the ICR1 register.
|
|
||||||
TCCR1A = 0;
|
|
||||||
TCCR1B = BV(CS10) | BV(WGM13) | BV(WGM12);
|
|
||||||
|
|
||||||
// We now set the ICR1 register to what count value we want to
|
|
||||||
// reset (and thus trigger the interrupt) at.
|
|
||||||
// Since the timer is running at 16MHz, the counter will be
|
|
||||||
// incremented 16 million times each second, and we want the
|
|
||||||
// interrupt to trigger 9600 times each second. The formula for
|
|
||||||
// calculating the value of ICR1 (the TOP value) is:
|
|
||||||
// (CPUClock / Prescaler) / desired frequency - 1
|
|
||||||
// So that's what well put in this register to set up our
|
|
||||||
// 9.6KHz sampling rate. Note that we can also specify a clock
|
|
||||||
// correction to this calculation. If you measure your processors
|
|
||||||
// actual clock speed to 16.095MHz, define FREQUENCY_CORRECTION
|
|
||||||
// as 9500, and the actual sampling (and this modulation and
|
|
||||||
// demodulation) will be much closer to an actual 9600 Hz.
|
|
||||||
// No crystals are perfect though, and will also drift with
|
|
||||||
// temperature variations, but if you have a board with a
|
|
||||||
// crystal that is way off frequency, this can help alot.
|
|
||||||
ICR1 = (((CPU_FREQ+FREQUENCY_CORRECTION)) / 9600) - 1;
|
|
||||||
|
|
||||||
// Set reference to AVCC (5V), select pin
|
|
||||||
// Set the ADMUX register. The first part (BV(REFS0)) sets
|
|
||||||
// the reference voltage to VCC (5V), and the next selects
|
|
||||||
// the ADC channel (basically what pin we are capturing on)
|
|
||||||
ADMUX = BV(REFS0) | ch;
|
|
||||||
|
|
||||||
DDRC &= ~BV(ch); // Set the selected channel (pin) to input
|
|
||||||
PORTC &= ~BV(ch); // Initialize the selected pin to LOW
|
|
||||||
DIDR0 |= BV(ch); // Disable the Digital Input Buffer on selected pin
|
|
||||||
|
|
||||||
// Now a little more configuration to get the ADC working
|
|
||||||
// the way we want
|
|
||||||
ADCSRB = BV(ADTS2) | // Setting these three on (1-1-1) sets the ADC to
|
|
||||||
BV(ADTS1) | // "Timer1 capture event". That means we can declare
|
|
||||||
BV(ADTS0); // an ISR in the ADC Vector, that will then get called
|
|
||||||
// everytime the ADC has a sample ready, which will
|
|
||||||
// happen at the 9.6Khz sampling rate we set up earlier
|
|
||||||
|
|
||||||
ADCSRA = BV(ADEN) | // ADC Enable - Yes, we need to turn it on :)
|
|
||||||
BV(ADSC) | // ADC Start Converting - Tell it to start doing conversions
|
|
||||||
BV(ADATE)| // Enable autotriggering - Enables the autotrigger on complete
|
|
||||||
BV(ADIE) | // ADC Interrupt enable - Enables an interrupt to be called
|
|
||||||
BV(ADPS2); // Enable prescaler flag 2 (1-0-0 = division by 16 = 1MHz)
|
|
||||||
// This sets the ADC to run at 1MHz. This is out of spec,
|
|
||||||
// Since it's normal operating range is only up to 200KHz.
|
|
||||||
// But don't worry, it's not dangerous! I promise it wont
|
|
||||||
// blow up :) There is a downside to running at this speed
|
|
||||||
// though, hence the "out of spec", which is that we get
|
|
||||||
// a much lower resolution on the output. In this case,
|
|
||||||
// it's not a problem though, since we don't need the full
|
|
||||||
// 10-bit resolution, so we'll take fast and less precise!
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// This declares the Interrupt Service routine that will
|
|
||||||
// get called everytime the ADC finishes taking a sample.
|
|
||||||
// What actually happens here is that we take a piece of
|
|
||||||
// code, store it somewhere in memory, and then put the
|
|
||||||
// address of that "somewhere" into the Interrupt Vector
|
|
||||||
// Table of the processor, in this case the position
|
|
||||||
// "ADC_vect". This lets the processor know what to do
|
|
||||||
// when all the timing and configuration we just set up
|
|
||||||
// finally* ends up triggering the interrupt.
|
|
||||||
bool hw_ptt_on;
|
|
||||||
bool hw_afsk_dac_isr;
|
|
||||||
DECLARE_ISR(ADC_vect) {
|
|
||||||
TIFR1 = BV(ICF1);
|
|
||||||
|
|
||||||
// Call the routine for analysing the captured sample
|
|
||||||
// Notice that we read the ADC sample, and then bitshift
|
|
||||||
// by two places to the right, effectively eliminating
|
|
||||||
// two bits of precision. But we didn't have those
|
|
||||||
// anyway, because the ADC is running at high speed.
|
|
||||||
// We then subtract 128 from the value, to get the
|
|
||||||
// representation to match an AC waveform. We need to
|
|
||||||
// do this because the AC waveform (from the audio input)
|
|
||||||
// is biased by +2.5V, which is nessecary, since the ADC
|
|
||||||
// can't read negative voltages. By doing this simple
|
|
||||||
// math, we bring it back to an AC representation
|
|
||||||
// we can do further calculations on.
|
|
||||||
afsk_adc_isr(modem, ((int16_t)((ADC) >> 2) - 128));
|
|
||||||
|
|
||||||
// We also need to check if we're supposed to spit
|
|
||||||
// out some modulated data to the DAC.
|
|
||||||
if (hw_afsk_dac_isr) {
|
|
||||||
// If there is, it's easy to actually do so. We
|
|
||||||
// calculate what the sample should be in the
|
|
||||||
// DAC ISR, and apply the bitmask 11110000. This
|
|
||||||
// simoultaneously spits out our 4-bit digital
|
|
||||||
// sample to the four pins connected to our DAC
|
|
||||||
// circuit, which then converts it to an analog
|
|
||||||
// waveform. The reason for the " | BV(3)" is that
|
|
||||||
// we also need to trigger another pin controlled
|
|
||||||
// by the PORTD register. This is the PTT pin
|
|
||||||
// which tells the radio to open it transmitter.
|
|
||||||
PORTD = (afsk_dac_isr(modem) & 0xF0) | BV(3);
|
|
||||||
} else {
|
|
||||||
// If we're not supposed to transmit anything, we
|
|
||||||
// keep quiet by continously sending 128, which
|
|
||||||
// when converted to an AC waveform by the DAC,
|
|
||||||
// equates to a steady, unchanging 0 volts.
|
|
||||||
if (hw_ptt_on) {
|
|
||||||
PORTD = 136;
|
|
||||||
} else {
|
|
||||||
PORTD = 128;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// (*) "finally" is probably the wrong description here.
|
|
||||||
// "All the f'ing time" is probably more accurate :)
|
|
||||||
// but it felt like it was a long way down here,
|
|
||||||
// writing all the explanations. I think this is a
|
|
||||||
// nice testament to how efficient and smart these
|
|
||||||
// processors are. The actual code to set up what
|
|
||||||
// took a long time to explain, is really very short.
|
|
|
@ -1,59 +0,0 @@
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// First things first, all the includes we need //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef FSK_MODEM_HW
|
|
||||||
#define FSK_MODEM_HW
|
|
||||||
|
|
||||||
#include "cfg/cfg_arch.h" // Architecture configuration
|
|
||||||
|
|
||||||
#include <avr/io.h> // AVR IO functions from BertOS
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// Definitions and some useful macros //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Forward declaration of our modem "object"
|
|
||||||
struct Afsk;
|
|
||||||
|
|
||||||
// Function declarations
|
|
||||||
void hw_afsk_adcInit(int ch, struct Afsk *_ctx);
|
|
||||||
void hw_afsk_dacInit(int ch, struct Afsk *_ctx);
|
|
||||||
|
|
||||||
// Here's some macros for controlling the RX/TX LEDs
|
|
||||||
// THE _INIT() functions writes to the DDRB register
|
|
||||||
// to configure the pins as output pins, and the _ON()
|
|
||||||
// and _OFF() functions writes to the PORT registers
|
|
||||||
// to turn the pins on or off.
|
|
||||||
#define LED_TX_INIT() do { DDRB |= BV(1); } while (0)
|
|
||||||
#define LED_TX_ON() do { PORTB |= BV(1); } while (0)
|
|
||||||
#define LED_TX_OFF() do { PORTB &= ~BV(1); } while (0)
|
|
||||||
|
|
||||||
#define LED_RX_INIT() do { DDRB |= BV(2); } while (0)
|
|
||||||
#define LED_RX_ON() do { PORTB |= BV(2); } while (0)
|
|
||||||
#define LED_RX_OFF() do { PORTB &= ~BV(2); } while (0)
|
|
||||||
|
|
||||||
// A shorthand macro for initializing the ADC.
|
|
||||||
// It just calls the actual ADC initialization code
|
|
||||||
// in "hardware.c"
|
|
||||||
#define AFSK_ADC_INIT(ch, ctx) hw_afsk_adcInit(ch, ctx)
|
|
||||||
|
|
||||||
// Initialization of the DAC pins. The DDRD register
|
|
||||||
// configures pins 0 through 7 for input or output.
|
|
||||||
// DDR stands for Data Direction Register. By setting
|
|
||||||
// it to 0xF8 we set 11111000, which means the pins
|
|
||||||
// 3, 4, 5, 6 and 7 will be set to output.
|
|
||||||
#define AFSK_DAC_INIT() do { DDRD |= 0xF8; } while (0)
|
|
||||||
|
|
||||||
// These two macros start and stop the DAC routine
|
|
||||||
// being called in our timer interrupt. For starting
|
|
||||||
// it, we set a boolean flag to true, and false for
|
|
||||||
// stopping it. We also turn on and off pin 3 to trigger
|
|
||||||
// the PTT of the radio.
|
|
||||||
#define AFSK_DAC_IRQ_START() do { extern bool hw_afsk_dac_isr; PORTD |= BV(3); hw_afsk_dac_isr = true; } while (0)
|
|
||||||
#define AFSK_DAC_IRQ_STOP() do { extern bool hw_afsk_dac_isr; PORTD &= ~BV(3); hw_afsk_dac_isr = false; } while (0)
|
|
||||||
|
|
||||||
#define AFSK_HW_PTT_ON() do { extern bool hw_ptt_on; hw_ptt_on = true; } while (0)
|
|
||||||
#define AFSK_HW_PTT_OFF() do { extern bool hw_ptt_on; hw_ptt_on = false; } while (0)
|
|
||||||
|
|
||||||
#endif
|
|
205
Modem/main.c
|
@ -1,205 +0,0 @@
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// First things first, all the includes we need //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#include <cpu/irq.h> // Interrupt functionality from BertOS
|
|
||||||
|
|
||||||
#include <drv/ser.h> // Serial driver from BertOS
|
|
||||||
#include <drv/timer.h> // Timer driver from BertOS
|
|
||||||
|
|
||||||
#include <stdio.h> // Standard input/output
|
|
||||||
#include <string.h> // String operations
|
|
||||||
#define F_CPU 16000000UL
|
|
||||||
#include <util/delay.h>
|
|
||||||
|
|
||||||
#include <net/ax25.h>
|
|
||||||
|
|
||||||
#include "afsk.h" // Header for AFSK modem
|
|
||||||
|
|
||||||
|
|
||||||
#include "protocol/SimpleSerial.h" // Simple serial control protocol
|
|
||||||
#include "protocol/KISS.h" // KISS TNC protocol
|
|
||||||
|
|
||||||
#if SERIAL_DEBUG
|
|
||||||
#include "cfg/debug.h" // Debug configuration from BertOS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// A few definitions //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
static Afsk afsk; // Declare a AFSK modem struct
|
|
||||||
static AX25Ctx ax25; // Declare a protocol struct
|
|
||||||
static Serial ser; // Declare a serial interface struct
|
|
||||||
|
|
||||||
#define ADC_CH 0 // Define which channel (pin) we want
|
|
||||||
// for the ADC (this is A0 on arduino)
|
|
||||||
|
|
||||||
#if SERIAL_PROTOCOL == PROTOCOL_SIMPLE_SERIAL
|
|
||||||
static uint8_t serialBuffer[CONFIG_AX25_FRAME_BUF_LEN+1]; // Buffer for holding incoming serial data
|
|
||||||
static int sbyte; // For holding byte read from serial port
|
|
||||||
static size_t serialLen = 0; // Counter for counting length of data from serial
|
|
||||||
static bool sertx = false; // Flag signifying whether it's time to send data
|
|
||||||
// received on the serial port.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SERIAL_PROTOCOL == PROTOCOL_KISS
|
|
||||||
static uint8_t sbyte; // For holding byte read from serial port
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SER_BUFFER_FULL (serialLen < CONFIG_AX25_FRAME_BUF_LEN-1)
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// And here comes the actual program :) //
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// This is a callback we register with the protocol,
|
|
||||||
// so we can process each packet as they are decoded.
|
|
||||||
// Right now it just prints the packet to the serial port.
|
|
||||||
#if SERIAL_PROTOCOL == PROTOCOL_SIMPLE_SERIAL
|
|
||||||
static void message_callback(struct AX25Msg *msg)
|
|
||||||
{
|
|
||||||
ss_messageCallback(msg, &ser);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SERIAL_PROTOCOL == PROTOCOL_KISS
|
|
||||||
static void message_callback(struct AX25Ctx *ctx)
|
|
||||||
{
|
|
||||||
kiss_messageCallback(ctx);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Simple initialization function.
|
|
||||||
static void init(void)
|
|
||||||
{
|
|
||||||
// Enable interrupts
|
|
||||||
IRQ_ENABLE;
|
|
||||||
|
|
||||||
// Initialize hardware timers
|
|
||||||
timer_init();
|
|
||||||
|
|
||||||
// Initialize serial comms on UART0,
|
|
||||||
// which is the hardware serial on arduino
|
|
||||||
ser_init(&ser, SER_UART0);
|
|
||||||
ser_setbaudrate(&ser, 9600);
|
|
||||||
|
|
||||||
// For some reason BertOS sets the serial
|
|
||||||
// to 7 bit characters by default. We set
|
|
||||||
// it to 8 instead.
|
|
||||||
UCSR0C = _BV(UCSZ01) | _BV(UCSZ00);
|
|
||||||
|
|
||||||
// Create a modem context
|
|
||||||
afsk_init(&afsk, ADC_CH);
|
|
||||||
// ... and a protocol context with the modem
|
|
||||||
ax25_init(&ax25, &afsk.fd, message_callback);
|
|
||||||
|
|
||||||
#if SERIAL_PROTOCOL == PROTOCOL_SIMPLE_SERIAL
|
|
||||||
// Init SimpleSerial
|
|
||||||
ss_init(&ax25);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SERIAL_PROTOCOL == PROTOCOL_KISS
|
|
||||||
// Init KISS
|
|
||||||
kiss_init(&ax25, &afsk, &ser);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// That's all!
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
// Start by running the main initialization
|
|
||||||
init();
|
|
||||||
|
|
||||||
#if SERIAL_PROTOCOL == PROTOCOL_KISS
|
|
||||||
while (1) {
|
|
||||||
// First we instruct the protocol to check for
|
|
||||||
// incoming data
|
|
||||||
ax25_poll(&ax25);
|
|
||||||
|
|
||||||
if (ser_available(&ser)) {
|
|
||||||
sbyte = ser_getchar_nowait(&ser);
|
|
||||||
kiss_serialCallback(sbyte);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SERIAL_PROTOCOL == PROTOCOL_SIMPLE_SERIAL
|
|
||||||
// Record the current tick count for time-keeping
|
|
||||||
ticks_t start = timer_clock();
|
|
||||||
// Go into ye good ol' infinite loop
|
|
||||||
while (1) {
|
|
||||||
// First we instruct the protocol to check for
|
|
||||||
// incoming data
|
|
||||||
ax25_poll(&ax25);
|
|
||||||
|
|
||||||
// Poll for incoming serial data
|
|
||||||
if (!sertx && ser_available(&ser)) {
|
|
||||||
// We then read a byte from the serial port.
|
|
||||||
// Notice that we use "_nowait" since we can't
|
|
||||||
// have this blocking execution until a byte
|
|
||||||
// comes in.
|
|
||||||
sbyte = ser_getchar_nowait(&ser);
|
|
||||||
|
|
||||||
// If SERIAL_DEBUG is specified we'll handle
|
|
||||||
// serial data as direct human input and only
|
|
||||||
// transmit when we get a LF character
|
|
||||||
#if SERIAL_DEBUG
|
|
||||||
// If we have not yet surpassed the maximum frame length
|
|
||||||
// and the byte is not a "transmit" (newline) character,
|
|
||||||
// we should store it for transmission.
|
|
||||||
if ((serialLen < CONFIG_AX25_FRAME_BUF_LEN) && (sbyte != 10)) {
|
|
||||||
// Put the read byte into the buffer;
|
|
||||||
serialBuffer[serialLen] = sbyte;
|
|
||||||
// Increment the read length counter
|
|
||||||
serialLen++;
|
|
||||||
} else {
|
|
||||||
// If one of the above conditions were actually the
|
|
||||||
// case, it means we have to transmit, se we set
|
|
||||||
// transmission flag to true.
|
|
||||||
sertx = true;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
// Otherwise we assume the modem is running
|
|
||||||
// in automated mode, and we push out data
|
|
||||||
// as it becomes available. We either transmit
|
|
||||||
// immediately when the max frame length has
|
|
||||||
// been reached, or when we get no input for
|
|
||||||
// a certain amount of time.
|
|
||||||
|
|
||||||
if (serialLen < CONFIG_AX25_FRAME_BUF_LEN-1) {
|
|
||||||
// Put the read byte into the buffer;
|
|
||||||
serialBuffer[serialLen] = sbyte;
|
|
||||||
// Increment the read length counter
|
|
||||||
serialLen++;
|
|
||||||
} else {
|
|
||||||
// If max frame length has been reached
|
|
||||||
// we need to transmit.
|
|
||||||
serialBuffer[serialLen] = sbyte;
|
|
||||||
serialLen++;
|
|
||||||
sertx = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
start = timer_clock();
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
if (!SERIAL_DEBUG && serialLen > 0 && timer_clock() - start > ms_to_ticks(TX_MAXWAIT)) {
|
|
||||||
sertx = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sertx) {
|
|
||||||
ss_serialCallback(serialBuffer, serialLen, &ser, &ax25);
|
|
||||||
sertx = false;
|
|
||||||
serialLen = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,118 +0,0 @@
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <avr/eeprom.h>
|
|
||||||
#define F_CPU 16000000UL
|
|
||||||
#include <util/delay.h>
|
|
||||||
#include <drv/timer.h> // Timer driver from BertOS
|
|
||||||
#include "KISS.h"
|
|
||||||
|
|
||||||
static uint8_t serialBuffer[CONFIG_AX25_FRAME_BUF_LEN+1]; // Buffer for holding incoming serial data
|
|
||||||
AX25Ctx *ax25ctx;
|
|
||||||
Afsk *channel;
|
|
||||||
Serial *serial;
|
|
||||||
size_t frame_len;
|
|
||||||
bool IN_FRAME;
|
|
||||||
bool ESCAPE;
|
|
||||||
uint8_t command = CMD_UNKNOWN;
|
|
||||||
unsigned long custom_preamble = CONFIG_AFSK_PREAMBLE_LEN;
|
|
||||||
unsigned long custom_tail = CONFIG_AFSK_TRAILER_LEN;
|
|
||||||
|
|
||||||
unsigned long slotTime = 200;
|
|
||||||
uint8_t p = 63;
|
|
||||||
|
|
||||||
void kiss_init(AX25Ctx *ax25, Afsk *afsk, Serial *ser) {
|
|
||||||
ax25ctx = ax25;
|
|
||||||
serial = ser;
|
|
||||||
channel = afsk;
|
|
||||||
}
|
|
||||||
|
|
||||||
void kiss_messageCallback(AX25Ctx *ctx) {
|
|
||||||
kfile_putc(FEND, &serial->fd);
|
|
||||||
kfile_putc(0x00, &serial->fd);
|
|
||||||
for (unsigned i = 0; i < ctx->frm_len; i++) {
|
|
||||||
uint8_t b = ctx->buf[i];
|
|
||||||
if (b == FEND) {
|
|
||||||
kfile_putc(FESC, &serial->fd);
|
|
||||||
kfile_putc(TFEND, &serial->fd);
|
|
||||||
} else if (b == FESC) {
|
|
||||||
kfile_putc(FESC, &serial->fd);
|
|
||||||
kfile_putc(TFESC, &serial->fd);
|
|
||||||
} else {
|
|
||||||
kfile_putc(b, &serial->fd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
kfile_putc(FEND, &serial->fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
void fon(void) {
|
|
||||||
long ts = 300000;
|
|
||||||
while (ts--) PORTB |= BV(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
void kiss_csma(AX25Ctx *ctx, uint8_t *buf, size_t len) {
|
|
||||||
bool sent = false;
|
|
||||||
while (!sent) {
|
|
||||||
if(!channel->hdlc.receiving) {
|
|
||||||
uint8_t tp = rand() & 0xFF;
|
|
||||||
if (tp < p) {
|
|
||||||
ax25_sendRaw(ctx, buf, len);
|
|
||||||
sent = true;
|
|
||||||
} else {
|
|
||||||
ticks_t start = timer_clock();
|
|
||||||
while (timer_clock() - start < ms_to_ticks(slotTime)) {
|
|
||||||
cpu_relax();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
while (channel->hdlc.receiving) {
|
|
||||||
cpu_relax();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void kiss_serialCallback(uint8_t sbyte) {
|
|
||||||
if (IN_FRAME && sbyte == FEND && command == CMD_DATA) {
|
|
||||||
IN_FRAME = false;
|
|
||||||
#if CSMA_ENABLE
|
|
||||||
kiss_csma(ax25ctx, serialBuffer, frame_len);
|
|
||||||
#else
|
|
||||||
ax25_sendRaw(ax25ctx, serialBuffer, frame_len);
|
|
||||||
#endif
|
|
||||||
} else if (sbyte == FEND) {
|
|
||||||
IN_FRAME = true;
|
|
||||||
command = CMD_UNKNOWN;
|
|
||||||
frame_len = 0;
|
|
||||||
} else if (IN_FRAME && frame_len < CONFIG_AX25_FRAME_BUF_LEN) {
|
|
||||||
// Have a look at the command byte first
|
|
||||||
if (frame_len == 0 && command == CMD_UNKNOWN) {
|
|
||||||
// MicroModem supports only one HDLC port, so we
|
|
||||||
// strip off the port nibble of the command byte
|
|
||||||
sbyte = sbyte & 0x0F;
|
|
||||||
command = sbyte;
|
|
||||||
} else if (command == CMD_DATA) {
|
|
||||||
if (sbyte == FESC) {
|
|
||||||
ESCAPE = true;
|
|
||||||
} else {
|
|
||||||
if (ESCAPE) {
|
|
||||||
if (sbyte == TFEND) sbyte = FEND;
|
|
||||||
if (sbyte == TFESC) sbyte = FESC;
|
|
||||||
ESCAPE = false;
|
|
||||||
}
|
|
||||||
serialBuffer[frame_len++] = sbyte;
|
|
||||||
}
|
|
||||||
} else if (command == CMD_TXDELAY) {
|
|
||||||
custom_preamble = sbyte * 10UL;
|
|
||||||
} else if (command == CMD_TXTAIL) {
|
|
||||||
custom_tail = sbyte * 10;
|
|
||||||
} else if (command == CMD_SLOTTIME) {
|
|
||||||
slotTime = sbyte * 10;
|
|
||||||
} else if (command == CMD_P) {
|
|
||||||
p = sbyte;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
#ifndef _PROTOCOL_KISS
|
|
||||||
#define _PROTOCOL_KISS 0x02
|
|
||||||
|
|
||||||
#define FEND 0xC0
|
|
||||||
#define FESC 0xDB
|
|
||||||
#define TFEND 0xDC
|
|
||||||
#define TFESC 0xDD
|
|
||||||
|
|
||||||
#define CMD_UNKNOWN 0xFE
|
|
||||||
#define CMD_DATA 0x00
|
|
||||||
#define CMD_TXDELAY 0x01
|
|
||||||
#define CMD_P 0x02
|
|
||||||
#define CMD_SLOTTIME 0x03
|
|
||||||
#define CMD_TXTAIL 0x04
|
|
||||||
#define CMD_FULLDUPLEX 0x05
|
|
||||||
#define CMD_SETHARDWARE 0x06
|
|
||||||
#define CMD_RETURN 0xFF
|
|
||||||
|
|
||||||
#include <net/ax25.h>
|
|
||||||
#include <drv/ser.h>
|
|
||||||
#include "afsk.h"
|
|
||||||
|
|
||||||
void kiss_init(AX25Ctx *ax25, Afsk *afsk, Serial *ser);
|
|
||||||
void kiss_csma(AX25Ctx *ctx, uint8_t *buf, size_t len);
|
|
||||||
void kiss_messageCallback(AX25Ctx *ctx);
|
|
||||||
void kiss_serialCallback(uint8_t sbyte);
|
|
||||||
void fon(void);
|
|
||||||
#endif
|
|
|
@ -1,844 +0,0 @@
|
||||||
#define ENABLE_HELP false
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <avr/eeprom.h>
|
|
||||||
#define F_CPU 16000000UL
|
|
||||||
#include <util/delay.h>
|
|
||||||
#include "protocol/SimpleSerial.h"
|
|
||||||
|
|
||||||
bool PRINT_SRC = true;
|
|
||||||
bool PRINT_DST = true;
|
|
||||||
bool PRINT_PATH = true;
|
|
||||||
bool PRINT_DATA = true;
|
|
||||||
bool PRINT_INFO = true;
|
|
||||||
bool VERBOSE = true;
|
|
||||||
bool SILENT = false;
|
|
||||||
bool SS_INIT = false;
|
|
||||||
bool SS_DEFAULT_CONF = false;
|
|
||||||
|
|
||||||
AX25Call src;
|
|
||||||
AX25Call dst;
|
|
||||||
AX25Call path1;
|
|
||||||
AX25Call path2;
|
|
||||||
|
|
||||||
char CALL[6] = DEFAULT_CALLSIGN;
|
|
||||||
int CALL_SSID = 0;
|
|
||||||
char DST[6] = DEFAULT_DESTINATION_CALL;
|
|
||||||
int DST_SSID = 0;
|
|
||||||
char PATH1[6] = "WIDE1";
|
|
||||||
int PATH1_SSID = 1;
|
|
||||||
char PATH2[6] = "WIDE2";
|
|
||||||
int PATH2_SSID = 2;
|
|
||||||
|
|
||||||
AX25Call path[4];
|
|
||||||
AX25Ctx *ax25ctx;
|
|
||||||
|
|
||||||
#define NV_MAGIC_BYTE 0x69
|
|
||||||
uint8_t EEMEM nvMagicByte;
|
|
||||||
uint8_t EEMEM nvCALL[6];
|
|
||||||
uint8_t EEMEM nvDST[6];
|
|
||||||
uint8_t EEMEM nvPATH1[6];
|
|
||||||
uint8_t EEMEM nvPATH2[6];
|
|
||||||
uint8_t EEMEM nvCALL_SSID;
|
|
||||||
uint8_t EEMEM nvDST_SSID;
|
|
||||||
uint8_t EEMEM nvPATH1_SSID;
|
|
||||||
uint8_t EEMEM nvPATH2_SSID;
|
|
||||||
bool EEMEM nvPRINT_SRC;
|
|
||||||
bool EEMEM nvPRINT_DST;
|
|
||||||
bool EEMEM nvPRINT_PATH;
|
|
||||||
bool EEMEM nvPRINT_DATA;
|
|
||||||
bool EEMEM nvPRINT_INFO;
|
|
||||||
bool EEMEM nvVERBOSE;
|
|
||||||
bool EEMEM nvSILENT;
|
|
||||||
uint8_t EEMEM nvPOWER;
|
|
||||||
uint8_t EEMEM nvHEIGHT;
|
|
||||||
uint8_t EEMEM nvGAIN;
|
|
||||||
uint8_t EEMEM nvDIRECTIVITY;
|
|
||||||
uint8_t EEMEM nvSYMBOL_TABLE;
|
|
||||||
uint8_t EEMEM nvSYMBOL;
|
|
||||||
uint8_t EEMEM nvAUTOACK;
|
|
||||||
int EEMEM nvPREAMBLE;
|
|
||||||
int EEMEM nvTAIL;
|
|
||||||
|
|
||||||
// Location packet assembly fields
|
|
||||||
char latitude[8];
|
|
||||||
char longtitude[9];
|
|
||||||
char symbolTable = '/';
|
|
||||||
char symbol = 'n';
|
|
||||||
|
|
||||||
uint8_t power = 10;
|
|
||||||
uint8_t height = 10;
|
|
||||||
uint8_t gain = 10;
|
|
||||||
uint8_t directivity = 10;
|
|
||||||
/////////////////////////
|
|
||||||
|
|
||||||
// Message packet assembly fields
|
|
||||||
char message_recip[6];
|
|
||||||
int message_recip_ssid = -1;
|
|
||||||
|
|
||||||
int message_seq = 0;
|
|
||||||
char lastMessage[67];
|
|
||||||
size_t lastMessageLen;
|
|
||||||
bool message_autoAck = false;
|
|
||||||
/////////////////////////
|
|
||||||
|
|
||||||
extern unsigned long custom_preamble;
|
|
||||||
extern unsigned long custom_tail;
|
|
||||||
|
|
||||||
void ss_init(AX25Ctx *ax25) {
|
|
||||||
ax25ctx = ax25;
|
|
||||||
ss_loadSettings();
|
|
||||||
SS_INIT = true;
|
|
||||||
if (VERBOSE) {
|
|
||||||
_delay_ms(300);
|
|
||||||
kprintf("---------------\n");
|
|
||||||
kprintf("MicroAPRS v0.2a\n");
|
|
||||||
kprintf("unsigned.io/microaprs\n");
|
|
||||||
if (SS_DEFAULT_CONF) kprintf("Default configuration loaded!\n");
|
|
||||||
kprintf("Modem ready\n");
|
|
||||||
kprintf("---------------\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ss_clearSettings(void) {
|
|
||||||
eeprom_update_byte((void*)&nvMagicByte, 0xFF);
|
|
||||||
if (VERBOSE) kprintf("Configuration cleared. Restart to load defaults.\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void ss_loadSettings(void) {
|
|
||||||
uint8_t verification = eeprom_read_byte((void*)&nvMagicByte);
|
|
||||||
if (verification == NV_MAGIC_BYTE) {
|
|
||||||
eeprom_read_block((void*)CALL, (void*)nvCALL, 6);
|
|
||||||
eeprom_read_block((void*)DST, (void*)nvDST, 6);
|
|
||||||
eeprom_read_block((void*)PATH1, (void*)nvPATH1, 6);
|
|
||||||
eeprom_read_block((void*)PATH2, (void*)nvPATH2, 6);
|
|
||||||
|
|
||||||
CALL_SSID = eeprom_read_byte((void*)&nvCALL_SSID);
|
|
||||||
DST_SSID = eeprom_read_byte((void*)&nvDST_SSID);
|
|
||||||
PATH1_SSID = eeprom_read_byte((void*)&nvPATH1_SSID);
|
|
||||||
PATH2_SSID = eeprom_read_byte((void*)&nvPATH2_SSID);
|
|
||||||
|
|
||||||
PRINT_SRC = eeprom_read_byte((void*)&nvPRINT_SRC);
|
|
||||||
PRINT_DST = eeprom_read_byte((void*)&nvPRINT_DST);
|
|
||||||
PRINT_PATH = eeprom_read_byte((void*)&nvPRINT_PATH);
|
|
||||||
PRINT_DATA = eeprom_read_byte((void*)&nvPRINT_DATA);
|
|
||||||
PRINT_INFO = eeprom_read_byte((void*)&nvPRINT_INFO);
|
|
||||||
VERBOSE = eeprom_read_byte((void*)&nvVERBOSE);
|
|
||||||
SILENT = eeprom_read_byte((void*)&nvSILENT);
|
|
||||||
|
|
||||||
power = eeprom_read_byte((void*)&nvPOWER);
|
|
||||||
height = eeprom_read_byte((void*)&nvHEIGHT);
|
|
||||||
gain = eeprom_read_byte((void*)&nvGAIN);
|
|
||||||
directivity = eeprom_read_byte((void*)&nvDIRECTIVITY);
|
|
||||||
symbolTable = eeprom_read_byte((void*)&nvSYMBOL_TABLE);
|
|
||||||
symbol = eeprom_read_byte((void*)&nvSYMBOL);
|
|
||||||
message_autoAck = eeprom_read_byte((void*)&nvAUTOACK);
|
|
||||||
|
|
||||||
custom_preamble = eeprom_read_word((void*)&nvPREAMBLE);
|
|
||||||
custom_tail = eeprom_read_word((void*)&nvTAIL);
|
|
||||||
|
|
||||||
if (VERBOSE && SS_INIT) kprintf("Configuration loaded\n");
|
|
||||||
} else {
|
|
||||||
if (SS_INIT && !SILENT && VERBOSE) kprintf("Error: No stored configuration to load!\n");
|
|
||||||
if (SS_INIT && !SILENT && !VERBOSE) kprintf("0\n");
|
|
||||||
SS_DEFAULT_CONF = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ss_saveSettings(void) {
|
|
||||||
eeprom_update_block((void*)CALL, (void*)nvCALL, 6);
|
|
||||||
eeprom_update_block((void*)DST, (void*)nvDST, 6);
|
|
||||||
eeprom_update_block((void*)PATH1, (void*)nvPATH1, 6);
|
|
||||||
eeprom_update_block((void*)PATH2, (void*)nvPATH2, 6);
|
|
||||||
|
|
||||||
eeprom_update_byte((void*)&nvCALL_SSID, CALL_SSID);
|
|
||||||
eeprom_update_byte((void*)&nvDST_SSID, DST_SSID);
|
|
||||||
eeprom_update_byte((void*)&nvPATH1_SSID, PATH1_SSID);
|
|
||||||
eeprom_update_byte((void*)&nvPATH2_SSID, PATH2_SSID);
|
|
||||||
|
|
||||||
eeprom_update_byte((void*)&nvPRINT_SRC, PRINT_SRC);
|
|
||||||
eeprom_update_byte((void*)&nvPRINT_DST, PRINT_DST);
|
|
||||||
eeprom_update_byte((void*)&nvPRINT_PATH, PRINT_PATH);
|
|
||||||
eeprom_update_byte((void*)&nvPRINT_DATA, PRINT_DATA);
|
|
||||||
eeprom_update_byte((void*)&nvPRINT_INFO, PRINT_INFO);
|
|
||||||
eeprom_update_byte((void*)&nvVERBOSE, VERBOSE);
|
|
||||||
eeprom_update_byte((void*)&nvSILENT, SILENT);
|
|
||||||
|
|
||||||
eeprom_update_byte((void*)&nvPOWER, power);
|
|
||||||
eeprom_update_byte((void*)&nvHEIGHT, height);
|
|
||||||
eeprom_update_byte((void*)&nvGAIN, gain);
|
|
||||||
eeprom_update_byte((void*)&nvDIRECTIVITY, directivity);
|
|
||||||
eeprom_update_byte((void*)&nvSYMBOL_TABLE, symbolTable);
|
|
||||||
eeprom_update_byte((void*)&nvSYMBOL, symbol);
|
|
||||||
eeprom_update_byte((void*)&nvAUTOACK, message_autoAck);
|
|
||||||
|
|
||||||
eeprom_update_word((void*)&nvPREAMBLE, custom_preamble);
|
|
||||||
eeprom_update_word((void*)&nvTAIL, custom_tail);
|
|
||||||
|
|
||||||
eeprom_update_byte((void*)&nvMagicByte, NV_MAGIC_BYTE);
|
|
||||||
|
|
||||||
if (VERBOSE) kprintf("Configuration saved\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void ss_messageCallback(struct AX25Msg *msg, Serial *ser) {
|
|
||||||
if (PRINT_SRC) {
|
|
||||||
if (PRINT_INFO) kfile_print(&ser->fd, "SRC: ");
|
|
||||||
kfile_printf(&ser->fd, "[%.6s-%d] ", msg->src.call, msg->src.ssid);
|
|
||||||
}
|
|
||||||
if (PRINT_DST) {
|
|
||||||
if (PRINT_INFO) kfile_printf(&ser->fd, "DST: ");
|
|
||||||
kfile_printf(&ser->fd, "[%.6s-%d] ", msg->dst.call, msg->dst.ssid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PRINT_PATH) {
|
|
||||||
if (PRINT_INFO) kfile_print(&ser->fd, "PATH: ");
|
|
||||||
for (int i = 0; i < msg->rpt_cnt; i++)
|
|
||||||
kfile_printf(&ser->fd, "[%.6s-%d] ", msg->rpt_lst[i].call, msg->rpt_lst[i].ssid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PRINT_DATA) {
|
|
||||||
if (PRINT_INFO) kfile_print(&ser->fd, "DATA: ");
|
|
||||||
kfile_printf(&ser->fd, "%.*s", msg->len, msg->info);
|
|
||||||
}
|
|
||||||
kfile_print(&ser->fd, "\r\n");
|
|
||||||
|
|
||||||
if (message_autoAck && msg->len > 11) {
|
|
||||||
char mseq[6];
|
|
||||||
bool shouldAck = true;
|
|
||||||
int msl = 0;
|
|
||||||
int loc = msg->len - 1;
|
|
||||||
size_t i = 0;
|
|
||||||
|
|
||||||
while (i<7 && i < msg->len) {
|
|
||||||
if (msg->info[loc-i] == '{') {
|
|
||||||
size_t p;
|
|
||||||
for (p = 0; p <= i; p++) {
|
|
||||||
mseq[p] = msg->info[loc-i+p];
|
|
||||||
msl = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msl != 0) {
|
|
||||||
int pos = 1;
|
|
||||||
int ssidPos = 0;
|
|
||||||
while (pos < 7) {
|
|
||||||
if (msg->info[pos] != CALL[pos-1]) {
|
|
||||||
shouldAck = false;
|
|
||||||
pos = 7;
|
|
||||||
}
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
while (pos < 10) {
|
|
||||||
if (msg->info[pos] == '-') ssidPos = pos;
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
if (ssidPos != 0) {
|
|
||||||
if (msg->info[ssidPos+2] == ' ') {
|
|
||||||
if (msg->info[ssidPos+1]-48 != CALL_SSID) {
|
|
||||||
shouldAck = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
int assid = 10+(msg->info[ssidPos+2]-48);
|
|
||||||
if (assid != CALL_SSID) {
|
|
||||||
shouldAck = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msl != 0 && shouldAck) {
|
|
||||||
int ii = 0;
|
|
||||||
char *ack = malloc(14+msl);
|
|
||||||
|
|
||||||
for (ii = 0; ii < 9; ii++) {
|
|
||||||
ack[1+ii] = ' ';
|
|
||||||
}
|
|
||||||
int calllen = 0;
|
|
||||||
for (ii = 0; ii < 6; ii++) {
|
|
||||||
if (msg->src.call[ii] != 0) {
|
|
||||||
ack[1+ii] = msg->src.call[ii];
|
|
||||||
calllen++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg->src.ssid != 0) {
|
|
||||||
ack[1+calllen] = '-';
|
|
||||||
if (msg->src.ssid < 10) {
|
|
||||||
ack[2+calllen] = msg->src.ssid+48;
|
|
||||||
} else {
|
|
||||||
ack[2+calllen] = 49;
|
|
||||||
ack[3+calllen] = msg->src.ssid-10+48;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ack[0] = ':';
|
|
||||||
ack[10] = ':';
|
|
||||||
ack[11] = 'a';
|
|
||||||
ack[12] = 'c';
|
|
||||||
ack[13] = 'k';
|
|
||||||
|
|
||||||
for (ii = 0; ii < msl; ii++) {
|
|
||||||
ack[14+ii] = mseq[ii+1];
|
|
||||||
}
|
|
||||||
|
|
||||||
_delay_ms(1750);
|
|
||||||
ss_sendPkt(ack, 14+msl, ax25ctx);
|
|
||||||
|
|
||||||
free(ack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ss_serialCallback(void *_buffer, size_t length, Serial *ser, AX25Ctx *ctx) {
|
|
||||||
uint8_t *buffer = (uint8_t *)_buffer;
|
|
||||||
if (length > 0) {
|
|
||||||
// ! as first char to send packet
|
|
||||||
if (buffer[0] == '!' && length > 1) {
|
|
||||||
buffer++; length--;
|
|
||||||
ss_sendPkt(buffer, length, ctx);
|
|
||||||
if (VERBOSE) kprintf("Packet sent\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else if (buffer[0] == '@') {
|
|
||||||
buffer++; length--;
|
|
||||||
ss_sendLoc(buffer, length, ctx);
|
|
||||||
if (VERBOSE) kprintf("Location update sent\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else if (buffer[0] == '#') {
|
|
||||||
buffer++; length--;
|
|
||||||
ss_sendMsg(buffer, length, ctx);
|
|
||||||
if (VERBOSE) kprintf("Message sent\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
#if ENABLE_HELP
|
|
||||||
else if (buffer[0] == 'h') {
|
|
||||||
ss_printHelp();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else if (buffer[0] == 'H') {
|
|
||||||
ss_printSettings();
|
|
||||||
} else if (buffer[0] == 'S') {
|
|
||||||
ss_saveSettings();
|
|
||||||
} else if (buffer[0] == 'C') {
|
|
||||||
ss_clearSettings();
|
|
||||||
} else if (buffer[0] == 'L') {
|
|
||||||
ss_loadSettings();
|
|
||||||
} else if (buffer[0] == 'c' && length > 3) {
|
|
||||||
buffer++; length--;
|
|
||||||
int count = 0;
|
|
||||||
while (length-- && count < 6) {
|
|
||||||
char c = buffer[count];
|
|
||||||
if (c != 0 && c != 10 && c != 13) {
|
|
||||||
CALL[count] = c;
|
|
||||||
} else {
|
|
||||||
CALL[count] = 0x00;
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
while (count < 6) {
|
|
||||||
CALL[count] = 0x00;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
if (VERBOSE) kprintf("Callsign: %.6s-%d\n", CALL, CALL_SSID);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
|
|
||||||
} else if (buffer[0] == 'd' && length > 3) {
|
|
||||||
buffer++; length--;
|
|
||||||
int count = 0;
|
|
||||||
while (length-- && count < 6) {
|
|
||||||
char c = buffer[count];
|
|
||||||
if (c != 0 && c != 10 && c != 13) {
|
|
||||||
DST[count] = c;
|
|
||||||
} else {
|
|
||||||
DST[count] = 0;
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
while (count < 6) {
|
|
||||||
DST[count] = 0x00;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
if (VERBOSE) kprintf("Destination: %.6s-%d\n", DST, DST_SSID);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
|
|
||||||
|
|
||||||
} else if (buffer[0] == '1' && length > 1) {
|
|
||||||
buffer++; length--;
|
|
||||||
int count = 0;
|
|
||||||
while (length-- && count < 6) {
|
|
||||||
char c = buffer[count];
|
|
||||||
if (c != 0 && c != 10 && c != 13) {
|
|
||||||
PATH1[count] = c;
|
|
||||||
} else {
|
|
||||||
PATH1[count] = 0;
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
while (count < 6) {
|
|
||||||
PATH1[count] = 0x00;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
if (VERBOSE) kprintf("Path1: %.6s-%d\n", PATH1, PATH1_SSID);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
|
|
||||||
|
|
||||||
} else if (buffer[0] == '2' && length > 1) {
|
|
||||||
buffer++; length--;
|
|
||||||
int count = 0;
|
|
||||||
while (length-- && count < 6) {
|
|
||||||
char c = buffer[count];
|
|
||||||
if (c != 0 && c != 10 && c != 13) {
|
|
||||||
PATH2[count] = c;
|
|
||||||
} else {
|
|
||||||
PATH2[count] = 0;
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
while (count < 6) {
|
|
||||||
PATH2[count] = 0x00;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
if (VERBOSE) kprintf("Path2: %.6s-%d\n", PATH2, PATH2_SSID);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
|
|
||||||
|
|
||||||
} else if (buffer[0] == 's' && length > 2) {
|
|
||||||
buffer++; length--;
|
|
||||||
if (buffer[0] == 'c') {
|
|
||||||
if (length > 2 && buffer[2] > 48 && buffer[2] < 58) {
|
|
||||||
CALL_SSID = 10+buffer[2]-48;
|
|
||||||
} else {
|
|
||||||
CALL_SSID = buffer[1]-48;
|
|
||||||
}
|
|
||||||
if (VERBOSE) kprintf("Callsign: %.6s-%d\n", CALL, CALL_SSID);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
if (buffer[0] == 'd') {
|
|
||||||
if (length > 2 && buffer[2] > 48 && buffer[2] < 58) {
|
|
||||||
DST_SSID = 10+buffer[2]-48;
|
|
||||||
} else {
|
|
||||||
DST_SSID = buffer[1]-48;
|
|
||||||
}
|
|
||||||
if (VERBOSE) kprintf("Destination: %.6s-%d\n", DST, DST_SSID);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
if (buffer[0] == '1' && buffer[2] > 48 && buffer[2] < 58) {
|
|
||||||
if (length > 2) {
|
|
||||||
PATH1_SSID = 10+buffer[2]-48;
|
|
||||||
} else {
|
|
||||||
PATH1_SSID = buffer[1]-48;
|
|
||||||
}
|
|
||||||
if (VERBOSE) kprintf("Path1: %.6s-%d\n", PATH1, PATH1_SSID);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
if (buffer[0] == '2' && buffer[2] > 48 && buffer[2] < 58) {
|
|
||||||
if (length > 2) {
|
|
||||||
PATH2_SSID = 10+buffer[2]-48;
|
|
||||||
} else {
|
|
||||||
PATH2_SSID = buffer[1]-48;
|
|
||||||
}
|
|
||||||
if (VERBOSE) kprintf("Path2: %.6s-%d\n", PATH2, PATH2_SSID);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (buffer[0] == 'p' && length > 2) {
|
|
||||||
buffer++; length--;
|
|
||||||
if (buffer[0] == 's') {
|
|
||||||
if (buffer[1] == 49) {
|
|
||||||
PRINT_SRC = true;
|
|
||||||
if (VERBOSE) kprintf("Print SRC enabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else {
|
|
||||||
PRINT_SRC = false;
|
|
||||||
if (VERBOSE) kprintf("Print SRC disabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (buffer[0] == 'd') {
|
|
||||||
if (buffer[1] == 49) {
|
|
||||||
PRINT_DST = true;
|
|
||||||
if (VERBOSE) kprintf("Print DST enabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else {
|
|
||||||
PRINT_DST = false;
|
|
||||||
if (VERBOSE) kprintf("Print DST disabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (buffer[0] == 'p') {
|
|
||||||
if (buffer[1] == 49) {
|
|
||||||
PRINT_PATH = true;
|
|
||||||
if (VERBOSE) kprintf("Print PATH enabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else {
|
|
||||||
PRINT_PATH = false;
|
|
||||||
if (VERBOSE) kprintf("Print PATH disabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (buffer[0] == 'm') {
|
|
||||||
if (buffer[1] == 49) {
|
|
||||||
PRINT_DATA = true;
|
|
||||||
if (VERBOSE) kprintf("Print DATA enabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else {
|
|
||||||
PRINT_DATA = false;
|
|
||||||
if (VERBOSE) kprintf("Print DATA disabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (buffer[0] == 'i') {
|
|
||||||
if (buffer[1] == 49) {
|
|
||||||
PRINT_INFO = true;
|
|
||||||
if (VERBOSE) kprintf("Print INFO enabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else {
|
|
||||||
PRINT_INFO = false;
|
|
||||||
if (VERBOSE) kprintf("Print INFO disabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (buffer[0] == 'v') {
|
|
||||||
if (buffer[1] == 49) {
|
|
||||||
VERBOSE = true;
|
|
||||||
kfile_printf(&ser->fd, "Verbose mode enabled\n");
|
|
||||||
} else {
|
|
||||||
VERBOSE = false;
|
|
||||||
kfile_printf(&ser->fd, "Verbose mode disabled\n");
|
|
||||||
}
|
|
||||||
} else if (buffer[0] == 'V') {
|
|
||||||
if (buffer[1] == 49) {
|
|
||||||
SILENT = true;
|
|
||||||
VERBOSE = false;
|
|
||||||
kfile_printf(&ser->fd, "Silent mode enabled\n");
|
|
||||||
} else {
|
|
||||||
SILENT = false;
|
|
||||||
kfile_printf(&ser->fd, "Silent mode disabled\n");
|
|
||||||
}
|
|
||||||
} else if (buffer[0] == 'l' && length > 2) {
|
|
||||||
buffer++; length--;
|
|
||||||
if (buffer[0] == 'l' && buffer[1] == 'a' && length >= 10) {
|
|
||||||
buffer += 2;
|
|
||||||
memcpy(latitude, (void *)buffer, 8);
|
|
||||||
if (VERBOSE) kprintf("Latitude set to %.8s\n", latitude);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else if (buffer[0] == 'l' && buffer[1] == 'o' && length >= 11) {
|
|
||||||
buffer += 2;
|
|
||||||
memcpy(longtitude, (void *)buffer, 9);
|
|
||||||
if (VERBOSE) kprintf("Longtitude set to %.9s\n", longtitude);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else if (buffer[0] == 'p' && length >= 2 && buffer[1] >= 48 && buffer[1] <= 57) {
|
|
||||||
power = buffer[1] - 48;
|
|
||||||
if (VERBOSE) kprintf("Power set to %dw\n", power*power);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else if (buffer[0] == 'h' && length >= 2 && buffer[1] >= 48 && buffer[1] <= 57) {
|
|
||||||
height = buffer[1] - 48;
|
|
||||||
if (VERBOSE) kprintf("Antenna height set to %ldm AAT\n", (long)(BV(height)*1000L)/328L);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else if (buffer[0] == 'g' && length >= 2 && buffer[1] >= 48 && buffer[1] <= 57) {
|
|
||||||
gain = buffer[1] - 48;
|
|
||||||
if (VERBOSE) kprintf("Gain set to %ddB\n", gain);
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else if (buffer[0] == 'd' && length >= 2 && buffer[1] >= 48 && buffer[1] <= 57) {
|
|
||||||
directivity = buffer[1] - 48;
|
|
||||||
if (directivity == 9) directivity = 8;
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
if (VERBOSE) {
|
|
||||||
if (directivity == 0) kprintf("Directivity set to omni\n");
|
|
||||||
if (directivity != 0) kprintf("Directivity set to %ddeg\n", directivity*45);
|
|
||||||
}
|
|
||||||
} else if (buffer[0] == 's' && length >= 2) {
|
|
||||||
symbol = buffer[1];
|
|
||||||
if (VERBOSE) kprintf("Symbol set to %c\n", symbol);
|
|
||||||
} else if (buffer[0] == 't' && length >= 2) {
|
|
||||||
if (buffer[1] == 'a') {
|
|
||||||
symbolTable = '\\';
|
|
||||||
if (VERBOSE) kprintf("Selected alternate symbol table\n");
|
|
||||||
} else {
|
|
||||||
symbolTable = '/';
|
|
||||||
if (VERBOSE) kprintf("Selected standard symbol table\n");
|
|
||||||
}
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (buffer[0] == 'm' && length > 1) {
|
|
||||||
buffer++; length--;
|
|
||||||
if (buffer[0] == 'c' && length > 1) {
|
|
||||||
buffer++; length--;
|
|
||||||
int count = 0;
|
|
||||||
while (length-- && count < 6) {
|
|
||||||
char c = buffer[count];
|
|
||||||
if (c != 0 && c != 10 && c != 13) {
|
|
||||||
message_recip[count] = c;
|
|
||||||
} else {
|
|
||||||
message_recip[count] = 0x00;
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
while (count < 6) {
|
|
||||||
message_recip[count] = 0x00;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
if (VERBOSE) {
|
|
||||||
kprintf("Message recipient: %.6s", message_recip);
|
|
||||||
if (message_recip_ssid != -1) {
|
|
||||||
kprintf("-%d\n", message_recip_ssid);
|
|
||||||
} else {
|
|
||||||
kprintf("\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else if (buffer[0] == 's' && length > 1) {
|
|
||||||
if (length > 2) {
|
|
||||||
message_recip_ssid = 10+buffer[2]-48;
|
|
||||||
} else {
|
|
||||||
message_recip_ssid = buffer[1]-48;
|
|
||||||
}
|
|
||||||
if (message_recip_ssid < 0 || message_recip_ssid > 15) message_recip_ssid = -1;
|
|
||||||
if (VERBOSE) {
|
|
||||||
kprintf("Message recipient: %.6s", message_recip);
|
|
||||||
if (message_recip_ssid != -1) {
|
|
||||||
kprintf("-%d\n", message_recip_ssid);
|
|
||||||
} else {
|
|
||||||
kprintf("\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else if (buffer[0] == 'r') {
|
|
||||||
ss_msgRetry(ctx);
|
|
||||||
if (VERBOSE) kprintf("Retried last message\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else if (buffer[0] == 'a') {
|
|
||||||
if (buffer[1] == 49) {
|
|
||||||
message_autoAck = true;
|
|
||||||
if (VERBOSE) kprintf("Message auto-ack enabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
} else {
|
|
||||||
message_autoAck = false;
|
|
||||||
if (VERBOSE) kprintf("Message auto-ack disabled\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("1\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (buffer[0] == 'w' && length >= 2) {
|
|
||||||
char str[4]; buffer++;
|
|
||||||
memcpy(str, buffer, length-1);
|
|
||||||
int preamble = atoi(str);
|
|
||||||
if (preamble >= 0 && preamble <= 9999) {
|
|
||||||
custom_preamble = preamble;
|
|
||||||
kprintf("Preamble set to %dms\n", custom_preamble);
|
|
||||||
} else {
|
|
||||||
kprintf("Error: Invalid value for preamble\n");
|
|
||||||
}
|
|
||||||
} else if (buffer[0] == 'W' && length >= 2) {
|
|
||||||
char str[4]; buffer++;
|
|
||||||
memcpy(str, buffer, length-1);
|
|
||||||
int tail = atoi(str);
|
|
||||||
if (tail >= 0 && tail <= 9999) {
|
|
||||||
custom_tail = tail;
|
|
||||||
kprintf("TX Tail set to %dms\n", custom_tail);
|
|
||||||
} else {
|
|
||||||
kprintf("Error: Invalid value for TX tail\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (VERBOSE) kprintf("Error: Invalid command\n");
|
|
||||||
if (!VERBOSE && !SILENT) kprintf("0\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void ss_sendPkt(void *_buffer, size_t length, AX25Ctx *ax25) {
|
|
||||||
|
|
||||||
uint8_t *buffer = (uint8_t *)_buffer;
|
|
||||||
|
|
||||||
memcpy(dst.call, DST, 6);
|
|
||||||
dst.ssid = DST_SSID;
|
|
||||||
|
|
||||||
memcpy(src.call, CALL, 6);
|
|
||||||
src.ssid = CALL_SSID;
|
|
||||||
|
|
||||||
memcpy(path1.call, PATH1, 6);
|
|
||||||
path1.ssid = PATH1_SSID;
|
|
||||||
|
|
||||||
memcpy(path2.call, PATH2, 6);
|
|
||||||
path2.ssid = PATH2_SSID;
|
|
||||||
|
|
||||||
path[0] = dst;
|
|
||||||
path[1] = src;
|
|
||||||
path[2] = path1;
|
|
||||||
path[3] = path2;
|
|
||||||
|
|
||||||
ax25_sendVia(ax25, path, countof(path), buffer, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ss_sendLoc(void *_buffer, size_t length, AX25Ctx *ax25) {
|
|
||||||
size_t payloadLength = 20+length;
|
|
||||||
bool usePHG = false;
|
|
||||||
if (power < 10 && height < 10 && gain < 10 && directivity < 9) {
|
|
||||||
usePHG = true;
|
|
||||||
payloadLength += 7;
|
|
||||||
}
|
|
||||||
uint8_t *packet = malloc(payloadLength);
|
|
||||||
uint8_t *ptr = packet;
|
|
||||||
packet[0] = '=';
|
|
||||||
packet[9] = symbolTable;
|
|
||||||
packet[19] = symbol;
|
|
||||||
ptr++;
|
|
||||||
memcpy(ptr, latitude, 8);
|
|
||||||
ptr += 9;
|
|
||||||
memcpy(ptr, longtitude, 9);
|
|
||||||
ptr += 10;
|
|
||||||
if (usePHG) {
|
|
||||||
packet[20] = 'P';
|
|
||||||
packet[21] = 'H';
|
|
||||||
packet[22] = 'G';
|
|
||||||
packet[23] = power+48;
|
|
||||||
packet[24] = height+48;
|
|
||||||
packet[25] = gain+48;
|
|
||||||
packet[26] = directivity+48;
|
|
||||||
ptr+=7;
|
|
||||||
}
|
|
||||||
if (length > 0) {
|
|
||||||
uint8_t *buffer = (uint8_t *)_buffer;
|
|
||||||
memcpy(ptr, buffer, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
//kprintf("Assembled packet:\n%.*s\n", payloadLength, packet);
|
|
||||||
ss_sendPkt(packet, payloadLength, ax25);
|
|
||||||
free(packet);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ss_sendMsg(void *_buffer, size_t length, AX25Ctx *ax25) {
|
|
||||||
if (length > 67) length = 67;
|
|
||||||
size_t payloadLength = 11+length+4;
|
|
||||||
|
|
||||||
uint8_t *packet = malloc(payloadLength);
|
|
||||||
uint8_t *ptr = packet;
|
|
||||||
packet[0] = ':';
|
|
||||||
int callSize = 6;
|
|
||||||
int count = 0;
|
|
||||||
while (callSize--) {
|
|
||||||
if (message_recip[count] != 0) {
|
|
||||||
packet[1+count] = message_recip[count];
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (message_recip_ssid != -1) {
|
|
||||||
packet[1+count] = '-'; count++;
|
|
||||||
if (message_recip_ssid < 10) {
|
|
||||||
packet[1+count] = message_recip_ssid+48; count++;
|
|
||||||
} else {
|
|
||||||
packet[1+count] = 49; count++;
|
|
||||||
packet[1+count] = message_recip_ssid-10+48; count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (count < 9) {
|
|
||||||
packet[1+count] = ' '; count++;
|
|
||||||
}
|
|
||||||
packet[1+count] = ':';
|
|
||||||
ptr += 11;
|
|
||||||
if (length > 0) {
|
|
||||||
uint8_t *buffer = (uint8_t *)_buffer;
|
|
||||||
memcpy(ptr, buffer, length);
|
|
||||||
memcpy(lastMessage, buffer, length);
|
|
||||||
lastMessageLen = length;
|
|
||||||
}
|
|
||||||
|
|
||||||
message_seq++;
|
|
||||||
if (message_seq > 999) message_seq = 0;
|
|
||||||
|
|
||||||
packet[11+length] = '{';
|
|
||||||
int n = message_seq % 10;
|
|
||||||
int d = ((message_seq % 100) - n)/10;
|
|
||||||
int h = (message_seq - d - n) / 100;
|
|
||||||
|
|
||||||
packet[12+length] = h+48;
|
|
||||||
packet[13+length] = d+48;
|
|
||||||
packet[14+length] = n+48;
|
|
||||||
|
|
||||||
//kprintf("Assembled packet:\n%.*s\n", payloadLength, packet);
|
|
||||||
ss_sendPkt(packet, payloadLength, ax25);
|
|
||||||
|
|
||||||
free(packet);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ss_msgRetry(AX25Ctx *ax25) {
|
|
||||||
message_seq--;
|
|
||||||
ss_sendMsg(lastMessage, lastMessageLen, ax25);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ss_printSettings(void) {
|
|
||||||
kprintf("Configuration:\n");
|
|
||||||
kprintf("Callsign: %.6s-%d\n", CALL, CALL_SSID);
|
|
||||||
kprintf("Destination: %.6s-%d\n", DST, DST_SSID);
|
|
||||||
kprintf("Path1: %.6s-%d\n", PATH1, PATH1_SSID);
|
|
||||||
kprintf("Path2: %.6s-%d\n", PATH2, PATH2_SSID);
|
|
||||||
if (message_autoAck) {
|
|
||||||
kprintf("Auto-ack messages: On\n");
|
|
||||||
} else {
|
|
||||||
kprintf("Auto-ack messages: Off\n");
|
|
||||||
}
|
|
||||||
if (power != 10) kprintf("Power: %d\n", power);
|
|
||||||
if (height != 10) kprintf("Height: %d\n", height);
|
|
||||||
if (gain != 10) kprintf("Gain: %d\n", gain);
|
|
||||||
if (directivity != 10) kprintf("Directivity: %d\n", directivity);
|
|
||||||
if (symbolTable == '\\') kprintf("Symbol table: alternate\n");
|
|
||||||
if (symbolTable == '/') kprintf("Symbol table: standard\n");
|
|
||||||
kprintf("Symbol: %c\n", symbol);
|
|
||||||
kprintf("TX Preamble: %d\n", custom_preamble);
|
|
||||||
kprintf("TX Tail: %d\n", custom_tail);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if ENABLE_HELP
|
|
||||||
void ss_printHelp(void) {
|
|
||||||
kprintf("----------------------------------\n");
|
|
||||||
kprintf("Serial commands:\n");
|
|
||||||
kprintf("!<data> Send raw packet\n");
|
|
||||||
kprintf("@<cmt> Send location update (cmt = optional comment)\n");
|
|
||||||
kprintf("#<msg> Send APRS message\n\n");
|
|
||||||
|
|
||||||
kprintf("c<call> Set your callsign\n");
|
|
||||||
kprintf("d<call> Set destination callsign\n");
|
|
||||||
kprintf("1<call> Set PATH1 callsign\n");
|
|
||||||
kprintf("2<call> Set PATH2 callsign\n\n");
|
|
||||||
|
|
||||||
kprintf("sc<ssid> Set your SSID\n");
|
|
||||||
kprintf("sd<ssid> Set destination SSID\n");
|
|
||||||
kprintf("s1<ssid> Set PATH1 SSID\n");
|
|
||||||
kprintf("s2<ssid> Set PATH2 SSID\n\n");
|
|
||||||
|
|
||||||
kprintf("lla<LAT> Set latitude (NMEA-format, eg 4903.50N)\n");
|
|
||||||
kprintf("llo<LON> Set latitude (NMEA-format, eg 07201.75W)\n");
|
|
||||||
kprintf("lp<0-9> Set TX power info\n");
|
|
||||||
kprintf("lh<0-9> Set antenna height info\n");
|
|
||||||
kprintf("lg<0-9> Set antenna gain info\n");
|
|
||||||
kprintf("ld<0-9> Set antenna directivity info\n");
|
|
||||||
kprintf("ls<sym> Select symbol\n");
|
|
||||||
kprintf("lt<s/a> Select symbol table (standard/alternate)\n\n");
|
|
||||||
|
|
||||||
kprintf("mc<call> Set message recipient callsign\n");
|
|
||||||
kprintf("ms<ssid> Set message recipient SSID\n");
|
|
||||||
kprintf("mr<ssid> Retry last message\n");
|
|
||||||
kprintf("ma<1/0> Automatic message ACK on/off\n\n");
|
|
||||||
|
|
||||||
kprintf("ps<1/0> Print SRC on/off\n");
|
|
||||||
kprintf("pd<1/0> Print DST on/off\n");
|
|
||||||
kprintf("pp<1/0> Print PATH on/off\n");
|
|
||||||
kprintf("pm<1/0> Print DATA on/off\n");
|
|
||||||
kprintf("pi<1/0> Print INFO on/off\n\n");
|
|
||||||
kprintf("v<1/0> Verbose mode on/off\n");
|
|
||||||
kprintf("V<1/0> Silent mode on/off\n\n");
|
|
||||||
|
|
||||||
kprintf("S Save configuration\n");
|
|
||||||
kprintf("L Load configuration\n");
|
|
||||||
kprintf("C Clear configuration\n");
|
|
||||||
kprintf("H Print configuration\n");
|
|
||||||
kprintf("----------------------------------\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
|
@ -1,26 +0,0 @@
|
||||||
#ifndef _PROTOCOL_SIMPLE_SERIAL
|
|
||||||
#define _PROTOCOL_SIMPLE_SERIAL 0x01
|
|
||||||
#include <net/ax25.h>
|
|
||||||
#include <drv/ser.h>
|
|
||||||
|
|
||||||
#define DEFAULT_CALLSIGN "NOCALL"
|
|
||||||
#define DEFAULT_DESTINATION_CALL "APZMDM"
|
|
||||||
|
|
||||||
void ss_init(AX25Ctx *ax25);
|
|
||||||
|
|
||||||
void ss_messageCallback(struct AX25Msg *msg, Serial *ser);
|
|
||||||
void ss_serialCallback(void *_buffer, size_t length, Serial *ser, AX25Ctx *ctx);
|
|
||||||
|
|
||||||
void ss_sendPkt(void *_buffer, size_t length, AX25Ctx *ax25);
|
|
||||||
void ss_sendLoc(void *_buffer, size_t length, AX25Ctx *ax25);
|
|
||||||
void ss_sendMsg(void *_buffer, size_t length, AX25Ctx *ax25);
|
|
||||||
void ss_msgRetry(AX25Ctx *ax25);
|
|
||||||
|
|
||||||
void ss_clearSettings(void);
|
|
||||||
void ss_loadSettings(void);
|
|
||||||
void ss_saveSettings(void);
|
|
||||||
void ss_printSettings(void);
|
|
||||||
|
|
||||||
void ss_printHelp(void);
|
|
||||||
|
|
||||||
#endif
|
|
124
README.md
|
@ -1,124 +0,0 @@
|
||||||
MicroAPRS - THIS VERSION IS DEPRECATED
|
|
||||||
==========
|
|
||||||
|
|
||||||
MicroAPRS is the APRS fork of [MicroModem](https://github.com/markqvist/MicroModem). It can be built very easily with an Arduino board based on the Atmega 328p, and around 15 common electronics components.
|
|
||||||
|
|
||||||
Please read the "Quickstart.pdf" in the Documentation folder for some pointers on building the modem!
|
|
||||||
|
|
||||||
Right now the APRS specific documentation is lacking, so all the docs included in this repository is directly from MicroModem, but it should still offer good pointers on building the modem, and getting started. The only difference is the firmware.
|
|
||||||
|
|
||||||
Currently a simple serial control protocol is implemented. If there's interest, I could also implement the KISS protocol.
|
|
||||||
|
|
||||||
## Some features
|
|
||||||
|
|
||||||
- Send and receive AX.25 APRS packets
|
|
||||||
- Full software modulation and demodulation, minimal extra hardware required
|
|
||||||
- Easy configuration of callsign and path settings
|
|
||||||
- Flexibility in how received packets are output over serial connection
|
|
||||||
- Persistent configuration stored in EEPROM
|
|
||||||
- Shorthand functions for sending location updates and messages, so you don't need to manually create the packets
|
|
||||||
- Ability to send raw packets
|
|
||||||
- Support for settings APRS symbols
|
|
||||||
- Support for power/height/gain info in location updates
|
|
||||||
- Ability to automatically ACK messages adressed to the modem
|
|
||||||
|
|
||||||
## Modem control
|
|
||||||
|
|
||||||
Here's how to control the APRS modem over a serial connection. The modem accepts a variety of commands for setting options and sending packets. Generally a command starts with one or more characters defining the command, and then whatever data is needed to set the options for that command. Here's a list of the currently available commands:
|
|
||||||
|
|
||||||
|
|
||||||
##Serial commands
|
|
||||||
|
|
||||||
Command | Description
|
|
||||||
--- | :---
|
|
||||||
__!\<data>__ | Send raw packet
|
|
||||||
__@\<cmt>__ | Send location update (cmt = optional comment)
|
|
||||||
__#\<msg>__ | Send APRS message
|
|
||||||
|
|
|
||||||
__c\<call>__ | Set your callsign
|
|
||||||
__d\<call>__ | Set destination callsign
|
|
||||||
__1\<call>__ | Set PATH1 callsign
|
|
||||||
__2\<call>__ | Set PATH2 callsign
|
|
||||||
|
|
|
||||||
__sc\<ssid>__ | Set your SSID
|
|
||||||
__sd\<ssid>__ | Set destination SSID
|
|
||||||
__s1\<ssid>__ | Set PATH1 SSID
|
|
||||||
__s2\<ssid>__ | Set PATH2 SSID
|
|
||||||
|
|
|
||||||
__lla\<LAT>__ | Set latitude (NMEA-format, eg 4903.50N)
|
|
||||||
__llo\<LON>__ | Set latitude (NMEA-format, eg 07201.75W)
|
|
||||||
__lp\<0-9>__ | Set TX power info
|
|
||||||
__lh\<0-9>__ | Set antenna height info
|
|
||||||
__lg\<0-9>__ | Set antenna gain info
|
|
||||||
__ld\<0-9>__ | Set antenna directivity info
|
|
||||||
__ls\<sym>__ | Select symbol
|
|
||||||
__lt\<s/a>__ | Select symbol table (standard/alternate)
|
|
||||||
|
|
|
||||||
__mc\<call>__ | Set message recipient callsign
|
|
||||||
__ms\<ssid>__ | Set message recipient SSID
|
|
||||||
__mr\<ssid>__ | Retry last message
|
|
||||||
__ma\<1/0>__ | Automatic message ACK on/off
|
|
||||||
|
|
|
||||||
__ps\<1/0>__ | Print SRC on/off
|
|
||||||
__pd\<1/0>__ | Print DST on/off
|
|
||||||
__pp\<1/0>__ | Print PATH on/off
|
|
||||||
__pm\<1/0>__ | Print DATA on/off
|
|
||||||
__pi\<1/0>__ | Print INFO on/off
|
|
||||||
__v\<1/0>__ | Verbose mode on/off
|
|
||||||
__V\<1/0>__ | Silent mode on/off
|
|
||||||
|
|
|
||||||
__S__ | Save configuration
|
|
||||||
__L__ | Load configuration
|
|
||||||
__C__ | Clear configuration
|
|
||||||
__H__ | Print configuration
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
__To set your callsign to XX1YYY-5, and then save the configuration, send these three commands:__
|
|
||||||
```
|
|
||||||
cXX1YYY
|
|
||||||
sc5
|
|
||||||
S
|
|
||||||
```
|
|
||||||
|
|
||||||
__To send an APRS message to ZZ5ABC-1 with the content "Hi there!", send these commands:__
|
|
||||||
```
|
|
||||||
mcZZ5ABC
|
|
||||||
ms1
|
|
||||||
#Hi there!
|
|
||||||
```
|
|
||||||
|
|
||||||
__To send a location update, with the comment "MicroAPRS", you can do something like this:__
|
|
||||||
```
|
|
||||||
lla5230.70N
|
|
||||||
llo01043.70E
|
|
||||||
@MicroAPRS
|
|
||||||
```
|
|
||||||
|
|
||||||
__To send an APRS message to ZZ5ABC-1 with the content "Hi there!", using a raw packet, send this command:__
|
|
||||||
```
|
|
||||||
!:ZZ5ABC-1 :Hi there!{01
|
|
||||||
```
|
|
||||||
__Here's an example of how to send a location update with power, height and gain information, using a raw packet:__
|
|
||||||
```
|
|
||||||
!=5230.70N/01043.70E-PHG2410Arduino MicroAPRS
|
|
||||||
```
|
|
||||||
|
|
||||||
### EEPROM Settings
|
|
||||||
When saving the configuration, it is written to EEPROM, so it will persist between poweroffs. If a configuration has been stored, it will automatically be loaded when the modem powers up. The configuration can be cleared by sending the "clear configuration" command (`C`).
|
|
||||||
|
|
||||||
### Serial Connection
|
|
||||||
|
|
||||||
To connect to the modem use __9600 baud, 8N1__ serial. By default, the firmware uses time-sensitive input, which means that it will buffer serial data as it comes in, and when it has received no data for a few milliseconds, it will start interpreting whatever it has received. This means you need to set your serial terminal program to not send data for every keystroke, but only on new-line, or pressing send or whatever. If you do not want this behaviour, you can compile the firmware with the DEBUG flag set, which will make the modem wait for a new-line character before interpreting the received data. I would generally advise against this though, since it means that you cannot have newline characters in whatever data you want to send!
|
|
||||||
|
|
||||||
![MicroModem](https://raw.githubusercontent.com/markqvist/MicroModem/master/Design/Images/1.jpg)
|
|
||||||
|
|
||||||
The repository contains schematics and Eagle PCB files for a Microduino module. There is also fritzing sketches for both an Arduino shield and a Microduino module, with notes so they are easier to understand. I have had the eagle PCB fabricated, and it is working great, so you can use that if want to make your own board.
|
|
||||||
|
|
||||||
![MicroModem](https://raw.githubusercontent.com/markqvist/MicroModem/master/Design/Images/PCB-lo.png)
|
|
||||||
|
|
||||||
While this project is based on Arduino hardware, it does not use the Arduino IDE. The project has been implemented in your normal C with makefile style, and uses libraries from the open source BertOS.
|
|
||||||
|
|
||||||
Visit [my site](http://unsigned.io) for questions, comments and other details.
|
|
|
@ -1,102 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
* Copyright 1999 Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
*
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief CRC table and support routines
|
|
||||||
*
|
|
||||||
* \author Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "crc.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The boot on AVR cpu is placed at the end of flash memory, but the avr
|
|
||||||
* address memory by byte and the pointers are 16bits long, so we are able
|
|
||||||
* to address 64Kbyte memory max. For this reason we can't read the crctab
|
|
||||||
* from flash, because it is placed at the end of memory. This is true every
|
|
||||||
* time we have an AVR cpu with more that 64Kbyte of flash. To fix this problem
|
|
||||||
* we let the compiler copy the table in RAM at startup. Obviously this solution
|
|
||||||
* is not efficent, but for now this is the only way.
|
|
||||||
*/
|
|
||||||
#if CPU_HARVARD && !(defined(ARCH_BOOT) && (ARCH & ARCH_BOOT))
|
|
||||||
#define CRC_TABLE const uint16_t PROGMEM crc16tab[256]
|
|
||||||
#else
|
|
||||||
#define CRC_TABLE const uint16_t crc16tab[256]
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* crctab calculated by Mark G. Mendel, Network Systems Corporation
|
|
||||||
*/
|
|
||||||
CRC_TABLE = {
|
|
||||||
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
|
|
||||||
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
|
|
||||||
0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
|
|
||||||
0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
|
|
||||||
0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
|
|
||||||
0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
|
|
||||||
0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
|
|
||||||
0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
|
|
||||||
0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
|
|
||||||
0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
|
|
||||||
0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
|
|
||||||
0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
|
|
||||||
0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
|
|
||||||
0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
|
|
||||||
0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
|
|
||||||
0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
|
|
||||||
0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
|
|
||||||
0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
|
|
||||||
0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
|
|
||||||
0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
|
|
||||||
0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
|
|
||||||
0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
|
|
||||||
0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
|
|
||||||
0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
|
|
||||||
0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
|
|
||||||
0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
|
|
||||||
0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
|
|
||||||
0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
|
|
||||||
0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
|
|
||||||
0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
|
|
||||||
0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
|
|
||||||
0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
|
|
||||||
};
|
|
||||||
|
|
||||||
uint16_t crc16(uint16_t crc, const void *buffer, size_t len)
|
|
||||||
{
|
|
||||||
const unsigned char *buf = (const unsigned char *)buffer;
|
|
||||||
while(len--)
|
|
||||||
crc = UPDCRC16(*buf++, crc);
|
|
||||||
|
|
||||||
return crc;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,115 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
* Copyright 1999 Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
*
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Cyclic Redundancy Check 16 (CRC). This algorithm is the one used by the XMODEM protocol.
|
|
||||||
*
|
|
||||||
* \note This algorithm is incompatible with the CCITT-CRC16.
|
|
||||||
*
|
|
||||||
* This code is based on the article Copyright 1986 Stephen Satchell.
|
|
||||||
*
|
|
||||||
* Programmers may incorporate any or all code into their programs,
|
|
||||||
* giving proper credit within the source. Publication of the
|
|
||||||
* source routines is permitted so long as proper credit is given
|
|
||||||
* to Stephen Satchell, Satchell Evaluations and Chuck Forsberg,
|
|
||||||
* Omen Technology.
|
|
||||||
*
|
|
||||||
* \author Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
*
|
|
||||||
* $WIZ$ module_name = "crc16"
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ALGO_CRC_H
|
|
||||||
#define ALGO_CRC_H
|
|
||||||
|
|
||||||
#include "cfg/cfg_arch.h"
|
|
||||||
|
|
||||||
#include <cfg/compiler.h>
|
|
||||||
#include <cpu/pgm.h>
|
|
||||||
|
|
||||||
EXTERN_C_BEGIN
|
|
||||||
|
|
||||||
/* CRC table */
|
|
||||||
extern const uint16_t crc16tab[256];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Compute the updated CRC16 value for one octet (macro version)
|
|
||||||
*
|
|
||||||
* \note This version is only intended for old/broken compilers.
|
|
||||||
* Use the inline function in new code.
|
|
||||||
*
|
|
||||||
* \param c New octet (range 0-255)
|
|
||||||
* \param oldcrc Previous CRC16 value (referenced twice, beware of side effects)
|
|
||||||
*/
|
|
||||||
#if CPU_HARVARD && !(defined(ARCH_BOOT) && (ARCH & ARCH_BOOT))
|
|
||||||
#define UPDCRC16(c, oldcrc) (pgm_read_uint16_t(&crc16tab[((oldcrc) >> 8) ^ ((unsigned char)(c))]) ^ ((oldcrc) << 8))
|
|
||||||
#else
|
|
||||||
#define UPDCRC16(c, oldcrc) ((crc16tab[((oldcrc) >> 8) ^ ((unsigned char)(c))]) ^ ((oldcrc) << 8))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** CRC-16 init value */
|
|
||||||
#define CRC16_INIT_VAL ((uint16_t)0)
|
|
||||||
|
|
||||||
#ifdef INLINE
|
|
||||||
/**
|
|
||||||
* \brief Compute the updated CRC16 value for one octet (inline version)
|
|
||||||
*/
|
|
||||||
INLINE uint16_t updcrc16(uint8_t c, uint16_t oldcrc)
|
|
||||||
{
|
|
||||||
#if CPU_HARVARD && !(defined(ARCH_BOOT) && (ARCH & ARCH_BOOT))
|
|
||||||
return pgm_read_uint16_t(&crc16tab[(oldcrc >> 8) ^ c]) ^ (oldcrc << 8);
|
|
||||||
#else
|
|
||||||
return crc16tab[(oldcrc >> 8) ^ c] ^ (oldcrc << 8);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif // INLINE
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function implements the CRC 16 calculation on a buffer.
|
|
||||||
*
|
|
||||||
* \param crc Current CRC16 value.
|
|
||||||
* \param buf The buffer to perform CRC calculation on.
|
|
||||||
* \param len The length of the Buffer.
|
|
||||||
*
|
|
||||||
* \return The updated CRC16 value.
|
|
||||||
*/
|
|
||||||
extern uint16_t crc16(uint16_t crc, const void *buf, size_t len);
|
|
||||||
|
|
||||||
int crc_testSetup(void);
|
|
||||||
int crc_testRun(void);
|
|
||||||
int crc_testTearDown(void);
|
|
||||||
|
|
||||||
EXTERN_C_END
|
|
||||||
|
|
||||||
#endif /* ALGO_CRC_H */
|
|
|
@ -1,83 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2009 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
*
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief CRC-CCITT table and support routines
|
|
||||||
*
|
|
||||||
* \author Francesco Sacchi <batt@develer.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "crc_ccitt.h"
|
|
||||||
|
|
||||||
const uint16_t PROGMEM crc_ccitt_tab[256] = {
|
|
||||||
0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
|
|
||||||
0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
|
|
||||||
0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
|
|
||||||
0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
|
|
||||||
0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
|
|
||||||
0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
|
|
||||||
0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
|
|
||||||
0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
|
|
||||||
0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
|
|
||||||
0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
|
|
||||||
0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
|
|
||||||
0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
|
|
||||||
0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
|
|
||||||
0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
|
|
||||||
0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
|
|
||||||
0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
|
|
||||||
0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
|
|
||||||
0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
|
|
||||||
0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
|
|
||||||
0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
|
|
||||||
0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
|
|
||||||
0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
|
|
||||||
0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
|
|
||||||
0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
|
|
||||||
0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
|
|
||||||
0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
|
|
||||||
0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
|
|
||||||
0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
|
|
||||||
0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
|
|
||||||
0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
|
|
||||||
0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
|
|
||||||
0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78,
|
|
||||||
};
|
|
||||||
|
|
||||||
uint16_t crc_ccitt(uint16_t crc, const void *buffer, size_t len)
|
|
||||||
{
|
|
||||||
const unsigned char *buf = (const unsigned char *)buffer;
|
|
||||||
while (len--)
|
|
||||||
crc = updcrc_ccitt(*buf++, crc);
|
|
||||||
|
|
||||||
return crc;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2009 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
*
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief CCITT Cyclic Redundancy Check (CRC-CCITT).
|
|
||||||
*
|
|
||||||
* \note This algorithm is incompatible with the CRC16.
|
|
||||||
*
|
|
||||||
* \author Francesco Sacchi <batt@develer.com>
|
|
||||||
*
|
|
||||||
* $WIZ$ module_name = "crc-ccitt"
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ALGO_CRC_CCITT_H
|
|
||||||
#define ALGO_CRC_CCITT_H
|
|
||||||
|
|
||||||
#include <cfg/compiler.h>
|
|
||||||
#include <cpu/pgm.h>
|
|
||||||
|
|
||||||
EXTERN_C_BEGIN
|
|
||||||
|
|
||||||
/* CRC table */
|
|
||||||
extern const uint16_t crc_ccitt_tab[256];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Compute the updated CRC-CCITT value for one octet (inline version)
|
|
||||||
*/
|
|
||||||
INLINE uint16_t updcrc_ccitt(uint8_t c, uint16_t oldcrc)
|
|
||||||
{
|
|
||||||
return (oldcrc >> 8) ^ pgm_read16(&crc_ccitt_tab[(oldcrc ^ c) & 0xff]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** CRC-CCITT init value */
|
|
||||||
#define CRC_CCITT_INIT_VAL ((uint16_t)0xFFFF)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function implements the CRC-CCITT calculation on a buffer.
|
|
||||||
*
|
|
||||||
* \param crc Current CRC-CCITT value.
|
|
||||||
* \param buf The buffer to perform CRC calculation on.
|
|
||||||
* \param len The length of the Buffer.
|
|
||||||
*
|
|
||||||
* \return The updated CRC-CCITT value.
|
|
||||||
*/
|
|
||||||
extern uint16_t crc_ccitt(uint16_t crc, const void *buf, size_t len);
|
|
||||||
|
|
||||||
EXTERN_C_END
|
|
||||||
|
|
||||||
#endif /* ALGO_CRC_CCITT_H */
|
|
|
@ -1,149 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2008 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
*
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Configuration file for the ADC module.
|
|
||||||
*
|
|
||||||
* \author Daniele Basile <asterix@develer.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CFG_ADC_H
|
|
||||||
#define CFG_ADC_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module logging level.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "log_level"
|
|
||||||
*/
|
|
||||||
#define ADC_LOG_LEVEL LOG_LVL_INFO
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module logging format.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "log_format"
|
|
||||||
*/
|
|
||||||
#define ADC_LOG_FORMAT LOG_FMT_VERBOSE
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clock Frequency for ADC conversion.
|
|
||||||
* This frequency will be rounded down to an integer
|
|
||||||
* submultiple of CPU_FREQ.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "int"
|
|
||||||
* $WIZ$ supports = "at91"
|
|
||||||
* $WIZ$ max = 5000000
|
|
||||||
*/
|
|
||||||
#define CONFIG_ADC_CLOCK 4800000UL
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Minimum time for starting up a conversion [us].
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "int"
|
|
||||||
* $WIZ$ min = 20
|
|
||||||
* $WIZ$ supports = "at91"
|
|
||||||
*/
|
|
||||||
#define CONFIG_ADC_STARTUP_TIME 20
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Minimum time for sample and hold [ns].
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "int"
|
|
||||||
* $WIZ$ min = 600
|
|
||||||
* $WIZ$ supports = "at91"
|
|
||||||
*/
|
|
||||||
#define CONFIG_ADC_SHTIME 834
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ADC Voltage Reference.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "avr_adc_refs"
|
|
||||||
* $WIZ$ supports = "avr"
|
|
||||||
*/
|
|
||||||
#define CONFIG_ADC_AVR_REF ADC_AVR_AVCC
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ADC clock divisor from main crystal.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "int"
|
|
||||||
* $WIZ$ min = 2
|
|
||||||
* $WIZ$ max = 128
|
|
||||||
* $WIZ$ supports = "avr"
|
|
||||||
*/
|
|
||||||
#define CONFIG_ADC_AVR_DIVISOR 2
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable ADC strobe for debugging ADC ISR.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "boolean"
|
|
||||||
*/
|
|
||||||
#define CONFIG_ADC_STROBE 0
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Start up timer[s] = startup value / ADCClock [Hz]
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "sam3_adc_sut"
|
|
||||||
* $WIZ$ supports = "sam3"
|
|
||||||
*/
|
|
||||||
#define CONFIG_ADC_SUT ADC_SUT512
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Analog Settling Time[s] = settling value / ADCClock[Hz]
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "sam3_adc_stt"
|
|
||||||
* $WIZ$ supports = "sam3"
|
|
||||||
*/
|
|
||||||
#define CONFIG_ADC_STTLING ADC_AST17
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tracking Time[s] = (TRACKTIM + 1) / ADCClock[Hz]
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "int"
|
|
||||||
* $WIZ$ min = 0
|
|
||||||
* $WIZ$ supports = "sam3"
|
|
||||||
*/
|
|
||||||
#define CONFIG_ADC_TRACKTIM 0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Transfer Period[s] = (TRANSFER * 2 + 3) ADCClock[Hz]
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "int"
|
|
||||||
* $WIZ$ min = 0
|
|
||||||
* $WIZ$ supports = "sam3"
|
|
||||||
*/
|
|
||||||
#define CONFIG_ADC_TRANSFER 1
|
|
||||||
|
|
||||||
#endif /* CFG_ADC_H */
|
|
|
@ -1,52 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
* Copyright 2001,2002,2003 Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
*
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Set system configuration.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* \author Bernie Innocenti <bernie@codewiz.org>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CFG_ARCH_CONFIG_H
|
|
||||||
#define CFG_ARCH_CONFIG_H
|
|
||||||
|
|
||||||
#define ARCH_DEFAULT (1<<0) ///< Default architecture
|
|
||||||
|
|
||||||
#define ARCH_EMUL (1<<2) ///< EMUL architecture
|
|
||||||
#define ARCH_QT (1<<3) ///< QT architecture
|
|
||||||
#define ARCH_UNITTEST (1<<4) ///< UNITTEST architecture
|
|
||||||
#define ARCH_NIGHTTEST (1<<5) ///< NIGHTTEST architecture
|
|
||||||
|
|
||||||
#endif /* CFG_ARCH_CONFIG_H */
|
|
|
@ -1,46 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2008 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
* All Rights Reserved.
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Configuration file for Debug module.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* \author Daniele Basile <asterix@develer.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CFG_ATTR_H
|
|
||||||
#define CFG_ATTR_H
|
|
||||||
|
|
||||||
/// Put a function or critical code in fast memory.
|
|
||||||
#define CONFIG_FAST_MEM 0
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CFG_ATTR_H */
|
|
|
@ -1,75 +0,0 @@
|
||||||
/**
|
|
||||||
* \file
|
|
||||||
* <!--
|
|
||||||
* This file is part of BeRTOS.
|
|
||||||
*
|
|
||||||
* Bertos is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* As a special exception, you may use this file as part of a free software
|
|
||||||
* library without restriction. Specifically, if other files instantiate
|
|
||||||
* templates or use macros or inline functions from this file, or you compile
|
|
||||||
* this file and link it with other files to produce an executable, this
|
|
||||||
* file does not by itself cause the resulting executable to be covered by
|
|
||||||
* the GNU General Public License. This exception does not however
|
|
||||||
* invalidate any other reasons why the executable file might be covered by
|
|
||||||
* the GNU General Public License.
|
|
||||||
*
|
|
||||||
* Copyright 2008 Develer S.r.l. (http://www.develer.com/)
|
|
||||||
*
|
|
||||||
* -->
|
|
||||||
*
|
|
||||||
* \brief Configuration file for the AX25 protocol module.
|
|
||||||
*
|
|
||||||
* \author Francesco Sacchi <batt@develer.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CFG_AX25_H
|
|
||||||
#define CFG_AX25_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module logging level.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "log_level"
|
|
||||||
*/
|
|
||||||
#define AX25_LOG_LEVEL LOG_LVL_WARN
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module logging format.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "enum"
|
|
||||||
* $WIZ$ value_list = "log_format"
|
|
||||||
*/
|
|
||||||
#define AX25_LOG_FORMAT LOG_FMT_TERSE
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AX25 frame buffer lenght.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "int"
|
|
||||||
* $WIZ$ min = 18
|
|
||||||
*/
|
|
||||||
#define CONFIG_AX25_FRAME_BUF_LEN 330
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable repeaters listing in AX25 frames.
|
|
||||||
* If enabled use 56 addtional bytes of RAM
|
|
||||||
* for each message received.
|
|
||||||
*
|
|
||||||
* $WIZ$ type = "boolean"
|
|
||||||
*/
|
|
||||||
#define CONFIG_AX25_RPT_LST 1
|
|
||||||
|
|
||||||
#endif /* CFG_AX25_H */
|
|