text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="6.1">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
<setting verticaltext="up"/>
</settings>
<grid distance="0.01" unitdist="inch" unit="inch" style="lines" multiple="1" display="yes" altdistance="0.025" altunitdist="inch" altunit="inch"/>
<layers>
<layer number="1" name="Top" color="4" fill="1" visible="yes" active="yes"/>
<layer number="2" name="Route2" color="1" fill="3" visible="no" active="no"/>
<layer number="3" name="Route3" color="4" fill="3" visible="no" active="no"/>
<layer number="4" name="Route4" color="1" fill="4" visible="no" active="no"/>
<layer number="5" name="Route5" color="4" fill="4" visible="no" active="no"/>
<layer number="6" name="Route6" color="1" fill="8" visible="no" active="no"/>
<layer number="7" name="Route7" color="4" fill="8" visible="no" active="no"/>
<layer number="8" name="Route8" color="1" fill="2" visible="no" active="no"/>
<layer number="9" name="Route9" color="4" fill="2" visible="no" active="no"/>
<layer number="10" name="Route10" color="1" fill="7" visible="no" active="no"/>
<layer number="11" name="Route11" color="4" fill="7" visible="no" active="no"/>
<layer number="12" name="Route12" color="1" fill="5" visible="no" active="no"/>
<layer number="13" name="Route13" color="4" fill="5" visible="no" active="no"/>
<layer number="14" name="Route14" color="1" fill="6" visible="no" active="no"/>
<layer number="15" name="Route15" color="4" fill="6" visible="no" active="no"/>
<layer number="16" name="Bottom" color="1" fill="1" visible="yes" active="yes"/>
<layer number="17" name="Pads" color="2" fill="1" visible="yes" active="yes"/>
<layer number="18" name="Vias" color="2" fill="1" visible="yes" active="yes"/>
<layer number="19" name="Unrouted" color="6" fill="1" visible="yes" active="yes"/>
<layer number="20" name="Dimension" color="15" fill="1" visible="yes" active="yes"/>
<layer number="21" name="tPlace" color="7" fill="1" visible="yes" active="yes"/>
<layer number="22" name="bPlace" color="7" fill="1" visible="yes" active="yes"/>
<layer number="23" name="tOrigins" color="15" fill="1" visible="yes" active="yes"/>
<layer number="24" name="bOrigins" color="15" fill="1" visible="yes" active="yes"/>
<layer number="25" name="tNames" color="7" fill="1" visible="yes" active="yes"/>
<layer number="26" name="bNames" color="7" fill="1" visible="yes" active="yes"/>
<layer number="27" name="tValues" color="7" fill="1" visible="yes" active="yes"/>
<layer number="28" name="bValues" color="7" fill="1" visible="yes" active="yes"/>
<layer number="29" name="tStop" color="7" fill="3" visible="no" active="yes"/>
<layer number="30" name="bStop" color="7" fill="6" visible="no" active="yes"/>
<layer number="31" name="tCream" color="7" fill="4" visible="no" active="yes"/>
<layer number="32" name="bCream" color="7" fill="5" visible="no" active="yes"/>
<layer number="33" name="tFinish" color="6" fill="3" visible="no" active="yes"/>
<layer number="34" name="bFinish" color="6" fill="6" visible="no" active="yes"/>
<layer number="35" name="tGlue" color="7" fill="4" visible="no" active="yes"/>
<layer number="36" name="bGlue" color="7" fill="5" visible="no" active="yes"/>
<layer number="37" name="tTest" color="7" fill="1" visible="no" active="yes"/>
<layer number="38" name="bTest" color="7" fill="1" visible="no" active="yes"/>
<layer number="39" name="tKeepout" color="4" fill="11" visible="yes" active="yes"/>
<layer number="40" name="bKeepout" color="1" fill="11" visible="yes" active="yes"/>
<layer number="41" name="tRestrict" color="4" fill="10" visible="yes" active="yes"/>
<layer number="42" name="bRestrict" color="1" fill="10" visible="yes" active="yes"/>
<layer number="43" name="vRestrict" color="2" fill="10" visible="yes" active="yes"/>
<layer number="44" name="Drills" color="7" fill="1" visible="no" active="yes"/>
<layer number="45" name="Holes" color="7" fill="1" visible="no" active="yes"/>
<layer number="46" name="Milling" color="3" fill="1" visible="no" active="yes"/>
<layer number="47" name="Measures" color="7" fill="1" visible="no" active="yes"/>
<layer number="48" name="Document" color="7" fill="1" visible="yes" active="yes"/>
<layer number="49" name="Reference" color="7" fill="1" visible="yes" active="yes"/>
<layer number="51" name="tDocu" color="7" fill="1" visible="yes" active="yes"/>
<layer number="52" name="bDocu" color="7" fill="1" visible="yes" active="yes"/>
<layer number="91" name="Nets" color="2" fill="1" visible="no" active="no"/>
<layer number="92" name="Busses" color="1" fill="1" visible="no" active="no"/>
<layer number="93" name="Pins" color="2" fill="1" visible="no" active="no"/>
<layer number="94" name="Symbols" color="4" fill="1" visible="no" active="no"/>
<layer number="95" name="Names" color="7" fill="1" visible="no" active="no"/>
<layer number="96" name="Values" color="7" fill="1" visible="no" active="no"/>
<layer number="97" name="Info" color="7" fill="1" visible="no" active="no"/>
<layer number="98" name="Guide" color="6" fill="1" visible="no" active="no"/>
</layers>
<board>
<plain>
</plain>
<libraries>
<library name="RJ45">
<packages>
<package name="RJ45-GENERIC">
<description>Conector Generico para Mag-Jack RJ-45</description>
<wire x1="-0.5" y1="0" x2="15.5" y2="0" width="0.127" layer="21"/>
<wire x1="15.5" y1="0" x2="15.5" y2="21" width="0.127" layer="21"/>
<wire x1="15.5" y1="21" x2="-0.5" y2="21" width="0.127" layer="21"/>
<wire x1="-0.5" y1="21" x2="-0.5" y2="0" width="0.127" layer="21"/>
<pad name="PAAMA" x="1.17" y="6.958" drill="0.6" diameter="1.6764" shape="square"/>
<pad name="PKAM" x="3.71" y="6.958" drill="0.6" diameter="1.6764" shape="square"/>
<pad name="PSHIELD1" x="0" y="14.105" drill="0.7" diameter="1.778" shape="long" rot="R90"/>
<pad name="PSHIEL2" x="15.375" y="14.105" drill="0.6" diameter="1.778" shape="long" rot="R90"/>
<pad name="PKV" x="14.005" y="6.958" drill="0.6" diameter="1.6764" shape="square"/>
<pad name="PAV" x="11.465" y="6.958" drill="0.6" diameter="1.6764" shape="square"/>
<pad name="P7" x="4.58" y="19.685" drill="0.6" diameter="1.778" shape="octagon"/>
<pad name="P5" x="7.12" y="19.685" drill="0.6" diameter="1.778" shape="octagon"/>
<pad name="P3" x="9.66" y="19.685" drill="0.6" diameter="1.778" shape="octagon"/>
<pad name="P1" x="12.2" y="19.685" drill="0.6" diameter="1.778" shape="octagon"/>
<pad name="P6" x="5.85" y="17.145" drill="0.6" diameter="1.778" shape="octagon"/>
<pad name="P8" x="3.31" y="17.145" drill="0.6" diameter="1.778" shape="octagon"/>
<pad name="P4" x="8.39" y="17.145" drill="0.6" diameter="1.778" shape="octagon"/>
<pad name="P2" x="10.93" y="17.145" drill="0.6" diameter="1.778" shape="octagon"/>
<pad name="PSTAND" x="2.5" y="11.008" drill="0.7" diameter="1.6764" shape="octagon"/>
<pad name="PSTAND2" x="13" y="11.008" drill="0.6" diameter="1.6764" shape="octagon"/>
<text x="10.16" y="1.27" size="1.27" layer="25">RJ-45</text>
</package>
</packages>
</library>
<library name="pinhead">
<packages>
<package name="1X05">
<description>PIN HEADER</description>
<wire x1="1.905" y1="1.27" x2="3.175" y2="1.27" width="0.1524" layer="21"/>
<wire x1="3.175" y1="1.27" x2="3.81" y2="0.635" width="0.1524" layer="21"/>
<wire x1="3.81" y1="0.635" x2="3.81" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="3.81" y1="-0.635" x2="3.175" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-1.27" y1="0.635" x2="-0.635" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-0.635" y1="1.27" x2="0.635" y2="1.27" width="0.1524" layer="21"/>
<wire x1="0.635" y1="1.27" x2="1.27" y2="0.635" width="0.1524" layer="21"/>
<wire x1="1.27" y1="0.635" x2="1.27" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="1.27" y1="-0.635" x2="0.635" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="0.635" y1="-1.27" x2="-0.635" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-0.635" y1="-1.27" x2="-1.27" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="1.905" y1="1.27" x2="1.27" y2="0.635" width="0.1524" layer="21"/>
<wire x1="1.27" y1="-0.635" x2="1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="3.175" y1="-1.27" x2="1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-5.715" y1="1.27" x2="-4.445" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-4.445" y1="1.27" x2="-3.81" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-3.81" y1="0.635" x2="-3.81" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-3.81" y1="-0.635" x2="-4.445" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-3.81" y1="0.635" x2="-3.175" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-3.175" y1="1.27" x2="-1.905" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-1.905" y1="1.27" x2="-1.27" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-1.27" y1="0.635" x2="-1.27" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-1.27" y1="-0.635" x2="-1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-1.905" y1="-1.27" x2="-3.175" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-3.175" y1="-1.27" x2="-3.81" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-6.35" y1="0.635" x2="-6.35" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-5.715" y1="1.27" x2="-6.35" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-6.35" y1="-0.635" x2="-5.715" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-4.445" y1="-1.27" x2="-5.715" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="4.445" y1="1.27" x2="5.715" y2="1.27" width="0.1524" layer="21"/>
<wire x1="5.715" y1="1.27" x2="6.35" y2="0.635" width="0.1524" layer="21"/>
<wire x1="6.35" y1="0.635" x2="6.35" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="6.35" y1="-0.635" x2="5.715" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="4.445" y1="1.27" x2="3.81" y2="0.635" width="0.1524" layer="21"/>
<wire x1="3.81" y1="-0.635" x2="4.445" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="5.715" y1="-1.27" x2="4.445" y2="-1.27" width="0.1524" layer="21"/>
<pad name="1" x="-5.08" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="2" x="-2.54" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="3" x="0" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="4" x="2.54" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="5" x="5.08" y="0" drill="1.016" shape="long" rot="R90"/>
<text x="-6.4262" y="1.8288" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-6.35" y="-3.175" size="1.27" layer="27">>VALUE</text>
<rectangle x1="2.286" y1="-0.254" x2="2.794" y2="0.254" layer="51"/>
<rectangle x1="-0.254" y1="-0.254" x2="0.254" y2="0.254" layer="51"/>
<rectangle x1="-2.794" y1="-0.254" x2="-2.286" y2="0.254" layer="51"/>
<rectangle x1="-5.334" y1="-0.254" x2="-4.826" y2="0.254" layer="51"/>
<rectangle x1="4.826" y1="-0.254" x2="5.334" y2="0.254" layer="51"/>
</package>
</packages>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
</classes>
<designrules>
<description language="de">EAGLE Design Rules

Die Standard-Design-Rules sind so gewählt, dass sie für
die meisten Anwendungen passen. Sollte ihre Platine
besondere Anforderungen haben, treffen Sie die erforderlichen
Einstellungen hier und speichern die Design Rules unter
einem neuen Namen ab.</description>
<description language="en">EAGLE Design Rules

The default Design Rules have been set to cover
a wide range of applications. Your particular design
may have different requirements, so please make the
necessary adjustments and save your customized
design rules under a new name.</description>
<param name="layerSetup" value="(1*16)"/>
<param name="mtCopper" value="0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm"/>
<param name="mtIsolate" value="1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm"/>
<param name="mdWireWire" value="30mil"/>
<param name="mdWirePad" value="30mil"/>
<param name="mdWireVia" value="38mil"/>
<param name="mdPadPad" value="30mil"/>
<param name="mdPadVia" value="30mil"/>
<param name="mdViaVia" value="30mil"/>
<param name="mdSmdPad" value="18mil"/>
<param name="mdSmdVia" value="18mil"/>
<param name="mdSmdSmd" value="18mil"/>
<param name="mdViaViaSameLayer" value="8mil"/>
<param name="mnLayersViaInSmd" value="2"/>
<param name="mdCopperDimension" value="40mil"/>
<param name="mdDrill" value="8mil"/>
<param name="mdSmdStop" value="0mil"/>
<param name="msWidth" value="10mil"/>
<param name="msDrill" value="24mil"/>
<param name="msMicroVia" value="9.99mm"/>
<param name="msBlindViaRatio" value="0.5"/>
<param name="rvPadTop" value="0.25"/>
<param name="rvPadInner" value="0.25"/>
<param name="rvPadBottom" value="0.25"/>
<param name="rvViaOuter" value="0.25"/>
<param name="rvViaInner" value="0.25"/>
<param name="rvMicroViaOuter" value="0.25"/>
<param name="rvMicroViaInner" value="0.25"/>
<param name="rlMinPadTop" value="18mil"/>
<param name="rlMaxPadTop" value="20mil"/>
<param name="rlMinPadInner" value="18mil"/>
<param name="rlMaxPadInner" value="20mil"/>
<param name="rlMinPadBottom" value="18mil"/>
<param name="rlMaxPadBottom" value="20mil"/>
<param name="rlMinViaOuter" value="18mil"/>
<param name="rlMaxViaOuter" value="20mil"/>
<param name="rlMinViaInner" value="18mil"/>
<param name="rlMaxViaInner" value="20mil"/>
<param name="rlMinMicroViaOuter" value="14mil"/>
<param name="rlMaxMicroViaOuter" value="20mil"/>
<param name="rlMinMicroViaInner" value="14mil"/>
<param name="rlMaxMicroViaInner" value="20mil"/>
<param name="psTop" value="-1"/>
<param name="psBottom" value="-1"/>
<param name="psFirst" value="-1"/>
<param name="psElongationLong" value="100"/>
<param name="psElongationOffset" value="100"/>
<param name="mvStopFrame" value="1"/>
<param name="mvCreamFrame" value="0"/>
<param name="mlMinStopFrame" value="4mil"/>
<param name="mlMaxStopFrame" value="4mil"/>
<param name="mlMinCreamFrame" value="0mil"/>
<param name="mlMaxCreamFrame" value="0mil"/>
<param name="mlViaStopLimit" value="0mil"/>
<param name="srRoundness" value="0"/>
<param name="srMinRoundness" value="0mil"/>
<param name="srMaxRoundness" value="0mil"/>
<param name="slThermalIsolate" value="10mil"/>
<param name="slThermalsForVias" value="0"/>
<param name="dpMaxLengthDifference" value="10mm"/>
<param name="dpGapFactor" value="2.5"/>
<param name="checkGrid" value="0"/>
<param name="checkAngle" value="0"/>
<param name="checkFont" value="1"/>
<param name="checkRestrict" value="1"/>
<param name="useDiameter" value="13"/>
<param name="maxErrors" value="50"/>
</designrules>
<autorouter>
<pass name="Default">
<param name="RoutingGrid" value="50mil"/>
<param name="tpViaShape" value="round"/>
<param name="PrefDir.1" value="|"/>
<param name="PrefDir.2" value="0"/>
<param name="PrefDir.3" value="0"/>
<param name="PrefDir.4" value="0"/>
<param name="PrefDir.5" value="0"/>
<param name="PrefDir.6" value="0"/>
<param name="PrefDir.7" value="0"/>
<param name="PrefDir.8" value="0"/>
<param name="PrefDir.9" value="0"/>
<param name="PrefDir.10" value="0"/>
<param name="PrefDir.11" value="0"/>
<param name="PrefDir.12" value="0"/>
<param name="PrefDir.13" value="0"/>
<param name="PrefDir.14" value="0"/>
<param name="PrefDir.15" value="0"/>
<param name="PrefDir.16" value="-"/>
<param name="cfVia" value="8"/>
<param name="cfNonPref" value="5"/>
<param name="cfChangeDir" value="2"/>
<param name="cfOrthStep" value="2"/>
<param name="cfDiagStep" value="3"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="1"/>
<param name="cfMalusStep" value="1"/>
<param name="cfPadImpact" value="4"/>
<param name="cfSmdImpact" value="4"/>
<param name="cfBusImpact" value="0"/>
<param name="cfHugging" value="3"/>
<param name="cfAvoid" value="4"/>
<param name="cfPolygon" value="10"/>
<param name="cfBase.1" value="0"/>
<param name="cfBase.2" value="1"/>
<param name="cfBase.3" value="1"/>
<param name="cfBase.4" value="1"/>
<param name="cfBase.5" value="1"/>
<param name="cfBase.6" value="1"/>
<param name="cfBase.7" value="1"/>
<param name="cfBase.8" value="1"/>
<param name="cfBase.9" value="1"/>
<param name="cfBase.10" value="1"/>
<param name="cfBase.11" value="1"/>
<param name="cfBase.12" value="1"/>
<param name="cfBase.13" value="1"/>
<param name="cfBase.14" value="1"/>
<param name="cfBase.15" value="1"/>
<param name="cfBase.16" value="0"/>
<param name="mnVias" value="20"/>
<param name="mnSegments" value="9999"/>
<param name="mnExtdSteps" value="9999"/>
<param name="mnRipupLevel" value="10"/>
<param name="mnRipupSteps" value="100"/>
<param name="mnRipupTotal" value="100"/>
</pass>
<pass name="Follow-me" refer="Default" active="yes">
</pass>
<pass name="Busses" refer="Default" active="yes">
<param name="cfNonPref" value="4"/>
<param name="cfBusImpact" value="4"/>
<param name="cfHugging" value="0"/>
<param name="mnVias" value="0"/>
</pass>
<pass name="Route" refer="Default" active="yes">
</pass>
</autorouter>
<elements>
<element name="U$2" library="RJ45" package="RJ45-GENERIC" value="RJ-45-GENERIC" x="5.08" y="2.54"/>
<element name="JP1" library="pinhead" package="1X05" value="" x="24.13" y="16.51" rot="R90"/>
<element name="JP2" library="pinhead" package="1X05" value="" x="1.27" y="16.51" rot="R90"/>
</elements>
<signals>
<signal name="N$1">
<contactref element="U$2" pad="P3"/>
<contactref element="JP1" pad="5"/>
<wire x1="14.74" y1="22.225" x2="14.74" y2="22.36" width="0.4064" layer="16"/>
<wire x1="14.74" y1="22.36" x2="15.24" y2="22.86" width="0.4064" layer="16"/>
<wire x1="15.24" y1="22.86" x2="15.24" y2="24.13" width="0.4064" layer="16"/>
<wire x1="15.24" y1="24.13" x2="21.59" y2="24.13" width="0.4064" layer="16"/>
<wire x1="21.59" y1="24.13" x2="24.13" y2="21.59" width="0.4064" layer="16"/>
</signal>
<signal name="N$2">
<contactref element="U$2" pad="P1"/>
<contactref element="JP1" pad="4"/>
<wire x1="22.86" y1="19.05" x2="24.13" y2="19.05" width="0.4064" layer="16"/>
<wire x1="21.336" y1="20.574" x2="22.86" y2="19.05" width="0.4064" layer="16"/>
<wire x1="21.336" y1="21.082" x2="21.336" y2="20.574" width="0.4064" layer="16"/>
<wire x1="20.32" y1="22.098" x2="21.336" y2="21.082" width="0.4064" layer="16"/>
<wire x1="17.407" y1="22.098" x2="20.32" y2="22.098" width="0.4064" layer="16"/>
<wire x1="17.28" y1="22.225" x2="17.407" y2="22.098" width="0.4064" layer="16"/>
</signal>
<signal name="N$3">
<contactref element="U$2" pad="P2"/>
<contactref element="JP1" pad="3"/>
<wire x1="23.876" y1="16.51" x2="24.13" y2="16.51" width="0.4064" layer="16"/>
<wire x1="20.32" y1="19.558" x2="23.876" y2="16.51" width="0.4064" layer="16"/>
<wire x1="16.137" y1="19.558" x2="20.32" y2="19.558" width="0.4064" layer="16"/>
<wire x1="16.01" y1="19.685" x2="16.137" y2="19.558" width="0.4064" layer="16"/>
</signal>
<signal name="N$4">
<contactref element="U$2" pad="PSHIEL2"/>
<contactref element="JP1" pad="2"/>
<wire x1="24.13" y1="13.97" x2="23.13" y2="13.97" width="0.4064" layer="16"/>
<wire x1="23.13" y1="13.97" x2="20.455" y2="16.645" width="0.4064" layer="16"/>
</signal>
<signal name="N$5">
<contactref element="U$2" pad="P4"/>
<contactref element="JP1" pad="1"/>
<wire x1="22.098" y1="11.43" x2="24.13" y2="11.43" width="0.4064" layer="16"/>
<wire x1="16.764" y1="16.764" x2="22.098" y2="11.43" width="0.4064" layer="16"/>
<wire x1="13.97" y1="16.764" x2="16.764" y2="16.764" width="0.4064" layer="16"/>
<wire x1="13.462" y1="17.272" x2="13.97" y2="16.764" width="0.4064" layer="16"/>
<wire x1="13.462" y1="17.272" x2="13.462" y2="19.677" width="0.4064" layer="16"/>
<wire x1="13.462" y1="19.677" x2="13.47" y2="19.685" width="0.4064" layer="16"/>
</signal>
<signal name="N$6">
<contactref element="U$2" pad="P5"/>
<contactref element="JP2" pad="5"/>
<wire x1="1.27" y1="21.59" x2="3.81" y2="24.13" width="0.4064" layer="16"/>
<wire x1="3.81" y1="24.13" x2="11.43" y2="24.13" width="0.4064" layer="16"/>
<wire x1="11.43" y1="24.13" x2="11.43" y2="22.995" width="0.4064" layer="16"/>
<wire x1="11.43" y1="22.995" x2="12.2" y2="22.225" width="0.4064" layer="16"/>
</signal>
<signal name="N$7">
<contactref element="U$2" pad="P7"/>
<contactref element="JP2" pad="4"/>
<wire x1="1.27" y1="19.05" x2="2.54" y2="19.05" width="0.4064" layer="16"/>
<wire x1="2.54" y1="19.05" x2="3.81" y2="20.32" width="0.4064" layer="16"/>
<wire x1="3.81" y1="20.32" x2="3.81" y2="21.082" width="0.4064" layer="16"/>
<wire x1="3.81" y1="21.082" x2="4.826" y2="22.098" width="0.4064" layer="16"/>
<wire x1="4.826" y1="22.098" x2="9.533" y2="22.098" width="0.4064" layer="16"/>
<wire x1="9.533" y1="22.098" x2="9.66" y2="22.225" width="0.4064" layer="16"/>
</signal>
<signal name="N$8">
<contactref element="U$2" pad="P8"/>
<contactref element="JP2" pad="3"/>
<wire x1="1.27" y1="16.51" x2="1.778" y2="16.51" width="0.4064" layer="16"/>
<wire x1="1.778" y1="16.51" x2="5.08" y2="19.812" width="0.4064" layer="16"/>
<wire x1="5.08" y1="19.812" x2="8.263" y2="19.812" width="0.4064" layer="16"/>
<wire x1="8.263" y1="19.812" x2="8.39" y2="19.685" width="0.4064" layer="16"/>
</signal>
<signal name="N$9">
<contactref element="U$2" pad="PSHIELD1"/>
<contactref element="JP2" pad="2"/>
<wire x1="1.27" y1="13.97" x2="2.405" y2="13.97" width="0.4064" layer="16"/>
<wire x1="2.405" y1="13.97" x2="5.08" y2="16.645" width="0.4064" layer="16"/>
</signal>
<signal name="N$10">
<contactref element="U$2" pad="P6"/>
<contactref element="JP2" pad="1"/>
<wire x1="1.27" y1="11.43" x2="3.556" y2="11.43" width="0.4064" layer="16"/>
<wire x1="3.556" y1="11.43" x2="8.89" y2="16.764" width="0.4064" layer="16"/>
<wire x1="8.89" y1="16.764" x2="10.16" y2="16.764" width="0.4064" layer="16"/>
<wire x1="10.16" y1="16.764" x2="10.922" y2="17.526" width="0.4064" layer="16"/>
<wire x1="10.922" y1="17.526" x2="10.922" y2="19.677" width="0.4064" layer="16"/>
<wire x1="10.922" y1="19.677" x2="10.93" y2="19.685" width="0.4064" layer="16"/>
</signal>
<signal name="N$11">
<wire x1="-1.016" y1="5.588" x2="-0.762" y2="5.588" width="1.6764" layer="16"/>
<wire x1="-0.762" y1="5.588" x2="27.94" y2="5.588" width="1.6764" layer="16"/>
<wire x1="27.94" y1="27.432" x2="27.94" y2="5.588" width="1.6764" layer="16"/>
<wire x1="-2.286" y1="27.432" x2="27.94" y2="27.432" width="1.6764" layer="16"/>
<wire x1="-2.286" y1="5.588" x2="-2.286" y2="27.432" width="1.6764" layer="16"/>
<wire x1="-2.286" y1="5.588" x2="-1.016" y2="5.588" width="1.6764" layer="16"/>
</signal>
<signal name="GND">
<polygon width="0.6096" layer="16">
<vertex x="9.906" y="15.494"/>
<vertex x="9.906" y="14.986"/>
<vertex x="6.35" y="11.43"/>
<vertex x="6.35" y="10.922"/>
<vertex x="3.81" y="8.382"/>
<vertex x="-1.27" y="8.382"/>
<vertex x="-1.27" y="6.35"/>
<vertex x="27.178" y="6.35"/>
<vertex x="27.178" y="9.398"/>
<vertex x="21.082" y="9.398"/>
<vertex x="18.034" y="12.446"/>
<vertex x="15.24" y="15.24"/>
<vertex x="15.24" y="15.494"/>
</polygon>
<polygon width="0.6096" layer="16">
<vertex x="-1.524" y="26.67"/>
<vertex x="-1.524" y="23.622"/>
<vertex x="1.524" y="23.622"/>
<vertex x="3.302" y="25.4"/>
<vertex x="23.368" y="25.4"/>
<vertex x="25.654" y="23.114"/>
<vertex x="27.178" y="23.114"/>
<vertex x="27.178" y="26.67"/>
</polygon>
</signal>
</signals>
</board>
</drawing>
</eagle>

extension: brd


text:
#include <Arduino.h>
#include <MIDI.h>
#include <Audio.h>
#include <ST7735_t3.h> // Hardware-specific library
#include "sampler.h"
#include "flashloader.h"
#include "midireader.h"
#include "midisequenceadapter.h"
#include "polyphonicsampler.h"
#include "tempo.h"
#include "TeensyVariablePlayback.h"
#include "TFTPianoDisplay.h"
#include "AudioLevelView.h"

MIDI_CREATE_DEFAULT_INSTANCE();
#define KEY_NOTENUMBER_C5 84
#define KEY_NOTENUMBER_C4 72
#define KEY_NOTENUMBER_C3 60
#define KEY_NOTENUMBER_C2 48
#define KEY_NOTENUMBER_C1 36

#pragma region audio
// GUItool: begin automatically generated code
AudioPlayArrayResmp      voice2;         //xy=364,311
AudioPlayArrayResmp      voice1;         //xy=368,214
AudioPlayArrayResmp      voice5;         //xy=378,609
AudioPlayArrayResmp      voice6;         //xy=381,676
AudioPlayArrayResmp      voice7;         //xy=383,798
AudioPlayArrayResmp      voice8;         //xy=387,907
AudioPlayArrayResmp      voice3;         //xy=396,418
AudioPlayArrayResmp      voice4;         //xy=398,490
AudioEffectEnvelope      envelope3;      //xy=541,313
AudioEffectEnvelope      envelope1;      //xy=542,215
AudioEffectEnvelope      envelope2;      //xy=544,255
AudioEffectEnvelope      envelope4;      //xy=544,355
AudioEffectEnvelope      envelope5;      //xy=544,407
AudioEffectEnvelope      envelope6;      //xy=548,451
AudioEffectEnvelope      envelope7;      //xy=548,489
AudioEffectEnvelope      envelope8;      //xy=548,527
AudioEffectEnvelope      envelope12;     //xy=552,718
AudioEffectEnvelope      envelope11;     //xy=555,674
AudioEffectEnvelope      envelope10;     //xy=558,621
AudioEffectEnvelope      envelope9;      //xy=561,584
AudioEffectEnvelope      envelope16;     //xy=570,941
AudioEffectEnvelope      envelope15;     //xy=572,900
AudioEffectEnvelope      envelope13;     //xy=574,793
AudioEffectEnvelope      envelope14;     //xy=574,836
AudioAnalyzePeak         peak2;          //xy=731,91
AudioAnalyzePeak         peak1;          //xy=734,46
AudioAnalyzePeak         peak4;          //xy=741,189
AudioAnalyzePeak         peak5;          //xy=748,427
AudioAnalyzePeak         peak3;          //xy=753,139
AudioMixer4              mixer2;         //xy=757,370
AudioMixer4              mixer1;         //xy=758,280
AudioAnalyzePeak         peak7;          //xy=759,501
AudioAnalyzePeak         peak8;          //xy=760,526
AudioAnalyzePeak         peak9;          //xy=763,570
AudioAnalyzePeak         peak6;          //xy=771,461
AudioMixer4              mixer3;         //xy=772,744
AudioMixer4              mixer4;         //xy=772,810
AudioAnalyzePeak         peak10;         //xy=774,607
AudioAnalyzePeak         peak12;         //xy=778,688
AudioAnalyzePeak         peak11;         //xy=785,649
AudioAnalyzePeak         peak14;         //xy=803,943
AudioAnalyzePeak         peak15;         //xy=806,980
AudioAnalyzePeak         peak13;         //xy=808,888
AudioAnalyzePeak         peak16;         //xy=813,1025
AudioMixer4              mixer5;         //xy=924,256
AudioMixer4              mixer6;         //xy=934,422
AudioMixer4              mixer7;         //xy=1194,226
AudioMixer4              mixer8;         //xy=1209,415
AudioOutputTDM           tdm1;           //xy=1377,352
AudioConnection          patchCord1(voice2, 0, envelope3, 0);
AudioConnection          patchCord2(voice2, 1, envelope4, 0);
AudioConnection          patchCord3(voice1, 0, envelope1, 0);
AudioConnection          patchCord4(voice1, 1, envelope2, 0);
AudioConnection          patchCord5(voice5, 0, envelope9, 0);
AudioConnection          patchCord6(voice5, 1, envelope10, 0);
AudioConnection          patchCord7(voice6, 0, envelope11, 0);
AudioConnection          patchCord8(voice6, 1, envelope12, 0);
AudioConnection          patchCord9(voice7, 0, envelope13, 0);
AudioConnection          patchCord10(voice7, 1, envelope14, 0);
AudioConnection          patchCord11(voice8, 0, envelope15, 0);
AudioConnection          patchCord12(voice8, 1, envelope16, 0);
AudioConnection          patchCord13(voice3, 0, envelope5, 0);
AudioConnection          patchCord14(voice3, 1, envelope6, 0);
AudioConnection          patchCord15(voice4, 0, envelope7, 0);
AudioConnection          patchCord16(voice4, 1, envelope8, 0);
AudioConnection          patchCord17(envelope3, 0, mixer1, 1);
AudioConnection          patchCord18(envelope3, peak3);
AudioConnection          patchCord19(envelope1, 0, mixer1, 0);
AudioConnection          patchCord20(envelope1, peak1);
AudioConnection          patchCord21(envelope2, 0, mixer2, 0);
AudioConnection          patchCord22(envelope2, peak2);
AudioConnection          patchCord23(envelope4, 0, mixer2, 1);
AudioConnection          patchCord24(envelope4, peak4);
AudioConnection          patchCord25(envelope5, 0, mixer1, 2);
AudioConnection          patchCord26(envelope5, peak5);
AudioConnection          patchCord27(envelope6, 0, mixer2, 2);
AudioConnection          patchCord28(envelope6, peak6);
AudioConnection          patchCord29(envelope7, 0, mixer1, 3);
AudioConnection          patchCord30(envelope7, peak7);
AudioConnection          patchCord31(envelope8, 0, mixer2, 3);
AudioConnection          patchCord32(envelope8, peak8);
AudioConnection          patchCord33(envelope12, 0, mixer4, 1);
AudioConnection          patchCord34(envelope12, peak12);
AudioConnection          patchCord35(envelope11, 0, mixer3, 1);
AudioConnection          patchCord36(envelope11, peak11);
AudioConnection          patchCord37(envelope10, 0, mixer4, 0);
AudioConnection          patchCord38(envelope10, peak10);
AudioConnection          patchCord39(envelope9, 0, mixer3, 0);
AudioConnection          patchCord40(envelope9, peak9);
AudioConnection          patchCord41(envelope16, 0, mixer4, 3);
AudioConnection          patchCord42(envelope16, peak16);
AudioConnection          patchCord43(envelope15, 0, mixer3, 3);
AudioConnection          patchCord44(envelope15, peak15);
AudioConnection          patchCord45(envelope13, 0, mixer3, 2);
AudioConnection          patchCord46(envelope13, peak13);
AudioConnection          patchCord47(envelope14, 0, mixer4, 2);
AudioConnection          patchCord48(envelope14, peak14);
AudioConnection          patchCord49(mixer2, 0, mixer6, 0);
AudioConnection          patchCord50(mixer1, 0, mixer5, 0);
AudioConnection          patchCord51(mixer3, 0, mixer5, 1);
AudioConnection          patchCord52(mixer4, 0, mixer6, 1);
AudioConnection          patchCord53(mixer5, 0, mixer7, 0);
AudioConnection          patchCord54(mixer6, 0, mixer8, 0);
AudioConnection          patchCord55(mixer7, 0, tdm1, 0);
AudioConnection          patchCord56(mixer7, 0, tdm1, 4);
AudioConnection          patchCord57(mixer8, 0, tdm1, 2);
AudioConnection          patchCord58(mixer8, 0, tdm1, 6);
AudioControlCS42448      cs42448;      //xy=793,1101
// GUItool: end automatically generated code
#pragma endregion

#pragma region tft
#define TFT_CS   6  // CS & DC can use pins 2, 6, 9, 10, 15, 20, 21, 22, 23
#define TFT_DC    2  //  but certain pairs must NOT be used: 2+10, 6+9, 20+23, 21+22
#define TFT_RST   255 // RST can use any pin
ST7735_t3 tft = ST7735_t3(TFT_CS, TFT_DC, TFT_RST);
#pragma endregion

#pragma region piano views
TFTPianoDisplay pianoDisplay1(tft, 3, 4, 4, 0); //tft, byte octaves, byte startOctave, byte x, byte y
TFTPianoDisplay pianoDisplay2(tft, 3, 7, 4, 13); //tft, byte octaves, byte startOctave, byte x, byte y
#pragma endregion

#pragma region AudioLevelViews
AudioLevelView levelViewVoice1 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 10, 64, 64, 1);
AudioLevelView levelViewVoice2 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 15, 64, 64, 1);
AudioLevelView levelViewVoice3 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 20, 64, 64, 1);
AudioLevelView levelViewVoice4 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 25, 64, 64, 1);
AudioLevelView levelViewVoice5 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 30, 64, 64, 1);
AudioLevelView levelViewVoice6 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 35, 64, 64, 1);
AudioLevelView levelViewVoice7 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 40, 64, 64, 1);
AudioLevelView levelViewVoice8 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 45, 64, 64, 1);
AudioLevelView levelViewVoice9 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 50, 64, 64, 1);
AudioLevelView levelViewVoice10 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 55, 64, 64, 1);
AudioLevelView levelViewVoice11 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 60, 64, 64, 1);
AudioLevelView levelViewVoice12 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 65, 64, 64, 1);
AudioLevelView levelViewVoice13 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 70, 64, 64, 1);
AudioLevelView levelViewVoice14 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 75, 64, 64, 1);
AudioLevelView levelViewVoice15 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 80, 64, 64, 1);
AudioLevelView levelViewVoice16 = AudioLevelView(tft, ST7735_GREEN, ST7735_BLACK, 85, 64, 64, 1);
AudioLevelView *levelViews[] = {&levelViewVoice1, &levelViewVoice2,  &levelViewVoice3,  &levelViewVoice4,  &levelViewVoice5,  &levelViewVoice6,  &levelViewVoice7,  &levelViewVoice8,
                                &levelViewVoice9, &levelViewVoice10, &levelViewVoice11, &levelViewVoice12, &levelViewVoice13, &levelViewVoice14, &levelViewVoice15, &levelViewVoice16};
#pragma endregion

sampler                 _sampler;
newdigate::audiosample  *sample1, *sample2, *sample3, *sample4, *sample5;
void handleNoteOn(uint8_t channel, uint8_t pitch, uint8_t velocity)
{
    _sampler.noteEvent(pitch, velocity, true, false);
    Serial.printf("on %d %d\n", channel, pitch);
}

void handleNoteOff(uint8_t channel, uint8_t pitch, uint8_t velocity)
{
    _sampler.noteEvent(pitch, velocity, false, false);
    Serial.printf("off %d %d\n", channel, pitch);
}

void bmpDraw(const char *filename, uint8_t x, uint16_t y);
uint16_t read16();
uint32_t read32();

tempo _tempo(140.0f);
multisequencer _multisequencer(_tempo);
midisequenceadapter _adapter(_multisequencer); // to read midi files into the a sequencer pattern
sequencer *_sequencer;

AudioPlayArrayResmp *voices[] = {&voice1, &voice2, &voice3, &voice4, &voice5, &voice6, &voice7, &voice8};
AudioAnalyzePeak *peaks[] = {&peak1, &peak2, &peak3, &peak4, &peak5, &peak6, &peak7, &peak8, &peak9, &peak10, &peak11, &peak12, &peak13, &peak14, &peak15, &peak16};

void setup() {
    Serial.begin(9600);

    tft.initR(INITR_GREENTAB);
    tft.setRotation(3);
    tft.fillScreen(ST7735_BLACK);
    tft.println("loading...");

    while (!SD.begin(BUILTIN_SDCARD)) {
      tft.println("SD initialization failed!");
      delay(1000);
    }
    tft.println("SD initialised.");

    for (unsigned int i=0; i<8; i++) {
        voices[i]->setNumChannels(2);
        voices[i]->enableInterpolation(true);
        voices[i]->begin();
    }

    mixer7.gain(0, 0.35);
    mixer8.gain(0, 0.35);

    envelope1.attack(0);
    envelope2.attack(0);
    envelope3.attack(0);
    envelope4.attack(0);
    envelope5.attack(0);
    envelope6.attack(0);
    envelope7.attack(0);
    envelope8.attack(0);

    _sampler.addVoice( voice1, mixer1, 0, envelope1, mixer2, 0, envelope2);
    _sampler.addVoice( voice2, mixer1, 1, envelope3, mixer2, 1, envelope4);
    _sampler.addVoice( voice3, mixer1, 2, envelope5, mixer2, 2, envelope6);
    _sampler.addVoice( voice4, mixer1, 3, envelope7, mixer2, 3, envelope8);
    _sampler.addVoice( voice5, mixer3, 0, envelope9,  mixer4, 0, envelope10);
    _sampler.addVoice( voice6, mixer3, 1, envelope11, mixer4, 1, envelope12);
    _sampler.addVoice( voice7, mixer3, 2, envelope13, mixer4, 2, envelope14);
    _sampler.addVoice( voice8, mixer3, 3, envelope15, mixer4, 3, envelope16);

    newdigate::flashloader loader;
    sample1 = loader.loadSample("PNO1C1.RAW");
    tft.println("C1");

    sample2 = loader.loadSample("PNO1C2.RAW");
    tft.println("C2");

    sample3 = loader.loadSample("PNO1C3.RAW");
    tft.println("C3");

    sample4 = loader.loadSample("PNO1C4.RAW");
    tft.println("C4");

    sample5 = loader.loadSample("PNO1C5.RAW");
    tft.println("C5");

    _sampler.addSample(KEY_NOTENUMBER_C1, sample1->sampledata, sample1->samplesize / 2);
    _sampler.addSample(KEY_NOTENUMBER_C2, sample2->sampledata, sample2->samplesize / 2);
    _sampler.addSample(KEY_NOTENUMBER_C3, sample3->sampledata, sample3->samplesize / 2);
    _sampler.addSample(KEY_NOTENUMBER_C4, sample4->sampledata, sample4->samplesize / 2);
    _sampler.addSample(KEY_NOTENUMBER_C5, sample5->sampledata, sample5->samplesize / 2);

    MIDI.setHandleNoteOn(handleNoteOn);
    MIDI.setHandleNoteOff(handleNoteOff);
    MIDI.begin(MIDI_CHANNEL_OMNI);

    //mixer3.gain(0, 0.25f);
    //mixer3.gain(1, 0.25f);

    AudioMemory(50);
    cs42448.enable();
    cs42448.volume(1.0f);

    tft.fillScreen(ST7735_BLACK);
    tft.setCursor(0, 26);
    tft.println("  Wintergatan\n  Marble machine....");

    _sequencer = _multisequencer.newSequencer();

    _adapter.loadMidi("marbles.mid");
    _adapter.loadMidifileToNextChannelPattern(0, 0, 64, 0);  // multicequencer channel number, midi track number, 35 bars long
    _adapter.close();

    _multisequencer.start(micros());
    _sequencer->setNextPattern(0);

    _sequencer->onevent = [] (sequencerevent *event) {

        _sampler.noteEvent(event->noteNumber, event->velocity, event->isNoteStartEvent, false);
        if (event->isNoteStartEvent) {
            pianoDisplay1.keyDown(event->noteNumber);
            pianoDisplay2.keyDown(event->noteNumber);
        } else {
            pianoDisplay1.keyUp(event->noteNumber);
            pianoDisplay2.keyUp(event->noteNumber);
        }
    };

    if (SD.exists("wilson.jpg")) {
        Serial.println("drawing wilson...");
        File wilson = SD.open("wilson.jpg");
        bmpDraw("wilson.bmp", 0, 45);
    } else
      Serial.println("wilson not found...");

}

void loop() {

    _multisequencer.tick(micros());
    MIDI.read();
    if (pianoDisplay1.displayNeedsUpdating())
        pianoDisplay1.drawPiano();
    if (pianoDisplay2.displayNeedsUpdating())
        pianoDisplay2.drawPiano();

    for (int i=0; i < 16; i++) {
        if (peaks[i]->available() )         {
            levelViews[i]->updateLevel(peaks[i]->read());
        }
    }
}

namespace std {
    void __throw_bad_function_call() {}
    void __throw_length_error(char const*) {}
}

unsigned __exidx_start;
unsigned __exidx_end;

File bmpFile;
#define BUFFPIXEL 20
void bmpDraw(const char *filename, uint8_t x, uint16_t y) {

    int      bmpWidth, bmpHeight;   // W+H in pixels
    uint8_t  bmpDepth;              // Bit depth (currently must be 24)
    uint32_t bmpImageoffset;        // Start of image data in file
    uint32_t rowSize;               // Not always = bmpWidth; may have padding
    uint8_t  sdbuffer[3 * BUFFPIXEL]; // pixel buffer (R+G+B per pixel)
    uint16_t buffidx = sizeof(sdbuffer); // Current position in sdbuffer
    boolean  goodBmp = false;       // Set to true on valid header parse
    boolean  flip    = true;        // BMP is stored bottom-to-top
    int      w, h, row, col;
    uint8_t  r, g, b;
    uint32_t pos = 0, startTime = millis();

    uint16_t awColors[320];  // hold colors for one row at a time...

    if ((x >= tft.width()) || (y >= tft.height())) return;

    Serial.println();
    Serial.print("Loading image '");
    Serial.print((char *) filename);
    Serial.print("\'\n");

    // Open requested file on SD card
    bmpFile = SD.open(filename);
    if (!bmpFile) {
        Serial.print("File not found");
        tft.fillScreen(ST7735_BLACK);
        tft.setCursor(12, tft.height() / 2 - 12);
        tft.print("Unable to");
        tft.setCursor(12, tft.height() / 2 - 0);
        tft.print("read file: ");
        tft.setCursor(12, tft.height() / 2 + 12);
        tft.setTextColor(ST7735_YELLOW);
        tft.print(filename);
        return;
    }

    // Parse BMP header
    if (read16() == 0x4D42) { // BMP signature
        Serial.print("File size: ");
        uint fileSize = read32();
        Serial.printf("%u \n", fileSize);
        (void)read32(); // Read & ignore creator bytes
        bmpImageoffset = read32(); // Start of image data
        Serial.printf("Image Offset: ");
        Serial.printf("%u \n", bmpImageoffset);
        // Read DIB header
        Serial.printf("Header size: %u\n", read32());
        bmpWidth  = read32();
        bmpHeight = read32();
        if (read16() == 1) { // # planes -- must be '1'
            bmpDepth = read16(); // bits per pixel
            Serial.print("Bit Depth: "); Serial.print(bmpDepth);
            if ((bmpDepth == 24) && (read32() == 0)) { // 0 = uncompressed

                goodBmp = true; // Supported BMP format -- proceed!
                Serial.printf("Image size: %u x %u\n", bmpWidth, bmpHeight);

                // BMP rows are padded (if needed) to 4-byte boundary
                rowSize = (bmpWidth * 3 + 3) & ~3;

                // If bmpHeight is negative, image is in top-down order.
                // This is not canon but has been observed in the wild.
                if (bmpHeight < 0) {
                    bmpHeight = -bmpHeight;
                    flip      = false;
                }

                // Crop area to be loaded
                w = bmpWidth;
                h = bmpHeight;
                if ((x + w - 1) >= tft.width())  w = tft.width()  - x;
                if ((y + h - 1) >= tft.height()) h = tft.height() - y;

                for (row = 0; row < h; row++) { // For each scanline...

                    // Seek to start of scan line.  It might seem labor-
                    // intensive to be doing this on every line, but this
                    // method covers a lot of gritty details like cropping
                    // and scanline padding.  Also, the seek only takes
                    // place if the file position actually needs to change
                    // (avoids a lot of cluster math in SD library).
                    if (flip) // Bitmap is stored bottom-to-top order (normal BMP)
                        pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize;
                    else     // Bitmap is stored top-to-bottom
                        pos = bmpImageoffset + row * rowSize;
                    if (bmpFile.position() != pos) { // Need seek?
                        bmpFile.seek(pos);
                        buffidx = sizeof(sdbuffer); // Force buffer reload
                    }

                    for (col = 0; col < w; col++) { // For each pixel...
                        // Time to read more pixel data?
                        if (buffidx >= sizeof(sdbuffer)) { // Indeed
                            bmpFile.read(sdbuffer, sizeof(sdbuffer));
                            buffidx = 0; // Set index to beginning
                        }

                        // Convert pixel from BMP to TFT format, push to display
#ifdef IMAGE_COLORS_BGR
                        b = sdbuffer[buffidx++];
            g = sdbuffer[buffidx++];
            r = sdbuffer[buffidx++];
#else
                        r = sdbuffer[buffidx++];
                        g = sdbuffer[buffidx++];
                        b = sdbuffer[buffidx++];
#endif
                        awColors[col] = tft.Color565(r, g, b);
                    } // end pixel
                    tft.writeRect(0, row + y, w, 1, awColors);
                } // end scanline
                Serial.print("Loaded in ");
                Serial.print(millis() - startTime);
                Serial.print(" ms\n");
            } // end goodBmp
        }
    }

    bmpFile.close();
    if (!goodBmp) Serial.print("BMP format not recognized.\n");
}

// These read 16- and 32-bit types from the SD card file.
// BMP data is stored little-endian, Arduino is little-endian too.
// May need to reverse subscript order if porting elsewhere.

uint16_t read16() {
    uint16_t result = 0;
    ((uint8_t *)&result)[0] = bmpFile.read(); // LSB
    ((uint8_t *)&result)[1] = bmpFile.read(); // MSB
    return result;
}

uint32_t read32() {
    uint32_t result = 0;
    uint8_t x1 = (uint8_t)bmpFile.read();
    uint8_t x2 = (uint8_t)bmpFile.read();
    uint8_t x3 = (uint8_t)bmpFile.read();
    uint8_t x4 = (uint8_t)bmpFile.read();
    ((uint8_t *)&result)[0] = x1; // LSB
    ((uint8_t *)&result)[1] = x2;
    ((uint8_t *)&result)[2] = x3;
    ((uint8_t *)&result)[3] = x4; // MSB
    return result;
}

license: MIT

repository: newdigate/teensy-marble-machine

license_type: permissive

repo_name: newdigate/teensy-marble-machine

branch_name: refs/heads/main

extension: ino


text:
package thread

import (
	"runtime"
	"syscall"
	"unsafe"
)

// Realtime locks the calling goroutine to its own kernel thread and elevates that
// thread's priority to realtime. It sets the round-robin schduling policy and uses
// priority level 10 (somewhere in the lower middle of the range).
func Realtime() error {
	// First pin goroutine to its own kernel thread.
	runtime.LockOSThread()
	// Get the ID of the thread.
	tid := syscall.Gettid()
	// Give this thread realtime priority.
	res, _, err := syscall.RawSyscall(syscall.SYS_SCHED_SETSCHEDULER, uintptr(tid),
		uintptr(RR), uintptr(unsafe.Pointer(&schedParam{10})))
	if res == 0 {
		return nil
	}
	return err
}

const FIFO = 1 // fifo scheduling policy
const RR = 2   // round-robin scheduling policy

type schedParam struct {
	Priority int
}

repository: tve/devices

repo_name: tve/devices

branch_name: refs/heads/master

extension: go


text:
// Copyright 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package tkgctl

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/vmware-tanzu-private/core/pkg/v1/tkg/fakes"
)

var _ = Describe("Unit tests for update credentials", func() {
	var tkgClient *fakes.Client

	Context("Updating cluster credentials for TKG", func() {
		It("Update credentials for workload cluster", func() {
			kubeConfigPath := getConfigFilePath()

			tkgClient = &fakes.Client{}

			tkgctlClient := &tkgctl{
				tkgClient:  tkgClient,
				kubeconfig: kubeConfigPath,
			}

			err := tkgctlClient.UpdateCredentialsCluster(UpdateCredentialsClusterOptions{
				ClusterName:     "clusterName",
				VSphereUsername: "username",
				VSpherePassword: "password",
			})
			Expect(err).NotTo(HaveOccurred())

			Expect(tkgClient.UpdateCredentialsClusterCallCount()).To(Equal(1))
			updateCredentialOptions := tkgClient.UpdateCredentialsClusterArgsForCall(0)
			Expect(updateCredentialOptions.ClusterName).To(Equal("clusterName"))
			Expect(updateCredentialOptions.VSphereUpdateClusterOptions.Username).To(Equal("username"))
			Expect(updateCredentialOptions.VSphereUpdateClusterOptions.Password).To(Equal("password"))
			Expect(updateCredentialOptions.IsRegionalCluster).To(Equal(false))
		})

		It("Update credentials for management cluster", func() {
			kubeConfigPath := getConfigFilePath()

			tkgClient = &fakes.Client{}

			tkgctlClient := &tkgctl{
				tkgClient:  tkgClient,
				kubeconfig: kubeConfigPath,
			}

			err := tkgctlClient.UpdateCredentialsRegion(UpdateCredentialsRegionOptions{
				ClusterName:     "clusterName",
				VSphereUsername: "username",
				VSpherePassword: "password",
				IsCascading:     true,
			})
			Expect(err).NotTo(HaveOccurred())

			Expect(tkgClient.UpdateCredentialsRegionCallCount()).To(Equal(1))
			updateCredentialOptions := tkgClient.UpdateCredentialsRegionArgsForCall(0)
			Expect(updateCredentialOptions.ClusterName).To(Equal("clusterName"))
			Expect(updateCredentialOptions.VSphereUpdateClusterOptions.Username).To(Equal("username"))
			Expect(updateCredentialOptions.VSphereUpdateClusterOptions.Password).To(Equal("password"))
			Expect(updateCredentialOptions.IsRegionalCluster).To(Equal(true))
			Expect(updateCredentialOptions.IsCascading).To(Equal(true))
		})
	})
})


text:
@manual{tsrgd,
	title={The Traffic Signs Regulations and General Directions},
	organization={UK Government},
	year={2016},
	url={http://www.legislation.gov.uk/uksi/2016/362/contents/made}
}

@manual{dps,
	title={The Design of Pedestrian Crossings},
	organization={Department for Transport},
	key={DfT},
	month={April},
	year={1995},
	edition={LTS 2/95},
	url={https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/330214/ltn-2-95_pedestrian-crossings.pdf}
}

@manual{psaepc,
	title={Performance Specification for Audible Equipment for use at
		Pedestrian Crossings},
	organization={Highways Agency, Department for Transport},
	key={HA},
	month={July},
	year={2005},
	url={http://www.ukroads.org/webfiles/TR%202509%20A.pdf}
}

extension: bib


text:
DESCRIPTION = "DBus-enabled dhcp client"
SECTION = "net"
LICENSE = "GPL"
DEPENDS = "dbus"
RDEPENDS_${PN} = "dhcp-client"
PR = "r2"

SRC_URI = "https://fedorahosted.org/releases/d/h/dhcdbd/dhcdbd-${PV}.tar.bz2 \
           file://dbus_connection_unref.patch \
           file://paths.patch \
           file://no-ext-options.patch \
           file://dhcdbd"

inherit update-rc.d

do_compile() {
	CC=${TARGET_SYS}-gcc DESTDIR=${prefix} make
}

do_install() {
	DESTDIR=${D} make install
	install -d ${D}/etc/init.d
	install -m 0755 ${WORKDIR}/dhcdbd ${D}/etc/init.d/
}

INITSCRIPT_NAME = dhcdbd
INITSCRIPT_PARAMS = "start 30 2 3 4 5 . stop 30 0 1 6 ."
FILES_${PN} += "${sysconfdir} ${datadir}/dbus-1 ${base_sbindir}/*"

SRC_URI[md5sum] = "d71de5c2f8aea4c8a18659bfa8387414"
SRC_URI[sha256sum] = "51d36747b8386e18631e5b2a278cf9ef077441cb116a66b72edddecb939724c4"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD

extension: bb