Add files via upload
This commit is contained in:
parent
2e1e656c82
commit
883b324a9f
4 changed files with 1495 additions and 0 deletions
BIN
Example_Keyboards/Logitech_K120/Logitech K120 Keyboard.pdf
Normal file
BIN
Example_Keyboards/Logitech_K120/Logitech K120 Keyboard.pdf
Normal file
Binary file not shown.
697
Example_Keyboards/Logitech_K120/Logitech_K120.brd
Normal file
697
Example_Keyboards/Logitech_K120/Logitech_K120.brd
Normal file
|
@ -0,0 +1,697 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE eagle SYSTEM "eagle.dtd">
|
||||
<eagle version="9.6.2">
|
||||
<drawing>
|
||||
<settings>
|
||||
<setting alwaysvectorfont="yes"/>
|
||||
<setting verticaltext="up"/>
|
||||
</settings>
|
||||
<grid distance="0.1" unitdist="mm" unit="mm" style="lines" multiple="1" display="no" altdistance="5" altunitdist="mil" altunit="mil"/>
|
||||
<layers>
|
||||
<layer number="1" name="Top" color="4" fill="1" visible="yes" active="yes"/>
|
||||
<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="24" 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="yes" 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="50" name="dxf" color="7" fill="1" visible="no" active="no"/>
|
||||
<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="53" name="tGND_GNDA" color="7" fill="9" visible="no" active="no"/>
|
||||
<layer number="54" name="bGND_GNDA" color="1" fill="9" visible="no" active="no"/>
|
||||
<layer number="56" name="wert" color="7" fill="1" visible="no" active="no"/>
|
||||
<layer number="57" name="tCAD" color="7" fill="1" visible="no" active="no"/>
|
||||
<layer number="59" name="tCarbon" color="7" fill="1" visible="no" active="no"/>
|
||||
<layer number="60" name="bCarbon" color="7" fill="1" visible="no" active="no"/>
|
||||
<layer number="88" name="SimResults" color="9" fill="1" visible="no" active="no"/>
|
||||
<layer number="89" name="SimProbes" color="9" fill="1" visible="no" active="no"/>
|
||||
<layer number="90" name="Modules" color="5" fill="1" visible="no" active="no"/>
|
||||
<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"/>
|
||||
<layer number="99" name="SpiceOrder" color="7" fill="1" visible="no" active="no"/>
|
||||
<layer number="100" name="Muster" color="7" fill="1" visible="no" active="no"/>
|
||||
<layer number="101" name="Patch_Top" color="12" fill="4" visible="yes" active="yes"/>
|
||||
<layer number="102" name="Vscore" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="103" name="tMap" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="104" name="Name" color="16" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="105" name="tPlate" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="106" name="bPlate" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="107" name="Crop" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="108" name="tplace-old" color="10" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="109" name="ref-old" color="11" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="110" name="fp0" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="111" name="LPC17xx" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="112" name="tSilk" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="113" name="IDFDebug" color="4" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="114" name="Badge_Outline" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="115" name="ReferenceISLANDS" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="116" name="Patch_BOT" color="9" fill="4" visible="yes" active="yes"/>
|
||||
<layer number="118" name="Rect_Pads" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="121" name="_tsilk" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="122" name="_bsilk" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="123" name="tTestmark" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="124" name="bTestmark" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="125" name="_tNames" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="126" name="_bNames" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="127" name="_tValues" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="128" name="_bValues" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="129" name="Mask" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="131" name="tAdjust" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="132" name="bAdjust" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="144" name="Drill_legend" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="150" name="Notes" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="151" name="HeatSink" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="152" name="_bDocu" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="153" name="FabDoc1" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="154" name="FabDoc2" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="155" name="FabDoc3" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="199" name="Contour" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="200" name="200bmp" color="1" fill="10" visible="yes" active="yes"/>
|
||||
<layer number="201" name="201bmp" color="2" fill="10" visible="yes" active="yes"/>
|
||||
<layer number="202" name="202bmp" color="3" fill="10" visible="yes" active="yes"/>
|
||||
<layer number="203" name="203bmp" color="4" fill="10" visible="yes" active="yes"/>
|
||||
<layer number="204" name="204bmp" color="5" fill="10" visible="yes" active="yes"/>
|
||||
<layer number="205" name="205bmp" color="6" fill="10" visible="yes" active="yes"/>
|
||||
<layer number="206" name="206bmp" color="7" fill="10" visible="yes" active="yes"/>
|
||||
<layer number="207" name="207bmp" color="8" fill="10" visible="yes" active="yes"/>
|
||||
<layer number="208" name="208bmp" color="9" fill="10" visible="yes" active="yes"/>
|
||||
<layer number="209" name="209bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="210" name="210bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="211" name="211bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="212" name="212bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="213" name="213bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="214" name="214bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="215" name="215bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="216" name="216bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="217" name="217bmp" color="18" fill="1" visible="no" active="no"/>
|
||||
<layer number="218" name="218bmp" color="19" fill="1" visible="no" active="no"/>
|
||||
<layer number="219" name="219bmp" color="20" fill="1" visible="no" active="no"/>
|
||||
<layer number="220" name="220bmp" color="21" fill="1" visible="no" active="no"/>
|
||||
<layer number="221" name="221bmp" color="22" fill="1" visible="no" active="no"/>
|
||||
<layer number="222" name="222bmp" color="23" fill="1" visible="no" active="no"/>
|
||||
<layer number="223" name="223bmp" color="24" fill="1" visible="no" active="no"/>
|
||||
<layer number="224" name="224bmp" color="25" fill="1" visible="no" active="no"/>
|
||||
<layer number="225" name="225bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="226" name="226bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="227" name="227bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="228" name="228bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="229" name="229bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="230" name="230bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="231" name="231bmp" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="232" name="Eagle3D_PG2" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="233" name="Eagle3D_PG3" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="248" name="Housing" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="249" name="Edge" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="250" name="Descript" color="3" fill="1" visible="no" active="no"/>
|
||||
<layer number="251" name="SMDround" color="12" fill="11" visible="no" active="no"/>
|
||||
<layer number="254" name="cooling" color="7" fill="1" visible="yes" active="yes"/>
|
||||
<layer number="255" name="routoute" color="7" fill="1" visible="yes" active="yes"/>
|
||||
</layers>
|
||||
<board>
|
||||
<plain>
|
||||
<wire x1="0" y1="0" x2="59.4" y2="0" width="0" layer="20"/>
|
||||
<wire x1="59.4" y1="0" x2="59.4" y2="16" width="0" layer="20"/>
|
||||
<wire x1="59.4" y1="16" x2="0" y2="16" width="0" layer="20"/>
|
||||
<wire x1="0" y1="16" x2="0" y2="0" width="0" layer="20"/>
|
||||
<hole x="35.44" y="8.9" drill="1.45"/>
|
||||
<hole x="53.75" y="9.55" drill="2.75"/>
|
||||
<text x="1" y="11.1" size="0.8128" layer="21">GND</text>
|
||||
<text x="56.7" y="11.6" size="0.8128" layer="21">GND</text>
|
||||
<text x="4.3" y="12.8" size="0.8128" layer="21">1</text>
|
||||
<text x="6.3" y="14.2" size="0.8128" layer="21">2</text>
|
||||
<text x="8.3" y="12.7" size="0.8128" layer="21">3</text>
|
||||
<text x="10.3" y="14.2" size="0.8128" layer="21">4</text>
|
||||
<text x="12.4" y="12.7" size="0.8128" layer="21">5</text>
|
||||
<text x="14.3" y="14.1" size="0.8128" layer="21">6</text>
|
||||
<text x="16.3" y="12.6" size="0.8128" layer="21">7</text>
|
||||
<text x="18.3" y="14.2" size="0.8128" layer="21">8</text>
|
||||
<text x="20.3" y="12.7" size="0.8128" layer="21">9</text>
|
||||
<text x="21.9" y="14.1" size="0.8128" layer="21">10</text>
|
||||
<text x="23.9" y="12.7" size="0.8128" layer="21">11</text>
|
||||
<text x="25.8" y="14.2" size="0.8128" layer="21">12</text>
|
||||
<text x="27.9" y="12.7" size="0.8128" layer="21">13</text>
|
||||
<text x="29.9" y="14.2" size="0.8128" layer="21">14</text>
|
||||
<text x="31.9" y="12.7" size="0.8128" layer="21">15</text>
|
||||
<text x="33.8" y="14.2" size="0.8128" layer="21">16</text>
|
||||
<text x="36.4" y="14.2" size="0.8128" layer="21">17</text>
|
||||
<text x="38.3" y="12.7" size="0.8128" layer="21">18</text>
|
||||
<text x="40.3" y="14.2" size="0.8128" layer="21">19</text>
|
||||
<text x="42.4" y="12.7" size="0.8128" layer="21">20</text>
|
||||
<text x="44.4" y="14.2" size="0.8128" layer="21">21</text>
|
||||
<text x="46.3" y="12.7" size="0.8128" layer="21">22</text>
|
||||
<text x="48.4" y="14.2" size="0.8128" layer="21">23</text>
|
||||
<text x="50.5" y="12.6" size="0.8128" layer="21">24</text>
|
||||
<text x="52.2" y="14.2" size="0.8128" layer="21">25</text>
|
||||
<text x="54.9" y="14.2" size="0.8128" layer="21">26</text>
|
||||
</plain>
|
||||
<libraries>
|
||||
<library name="Logitech_K120_FPC">
|
||||
<packages>
|
||||
<package name="LOGITECH_K120_FPC">
|
||||
<smd name="P$1" x="0" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$27" x="-2.3" y="-1.07" dx="1.7" dy="4.65" layer="1" rot="R180"/>
|
||||
<smd name="P$28" x="52.3" y="-1.07" dx="1.7" dy="4.65" layer="1" rot="R180"/>
|
||||
<smd name="P$2" x="2" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$3" x="4" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$4" x="6" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$5" x="8" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$6" x="10" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$7" x="12" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$8" x="14" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$9" x="16" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$10" x="18" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$11" x="20" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$12" x="22" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$13" x="24" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$14" x="26" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$15" x="28" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$16" x="30" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$17" x="32" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$18" x="34" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$19" x="36" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$20" x="38" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$21" x="40" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$22" x="42" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$23" x="44" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$24" x="46" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$25" x="48" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
<smd name="P$26" x="50" y="0" dx="2.4" dy="1" layer="1" rot="R90"/>
|
||||
</package>
|
||||
</packages>
|
||||
</library>
|
||||
<library name="SparkFun-Connectors" urn="urn:adsk.eagle:library:513">
|
||||
<description><h3>SparkFun Connectors</h3>
|
||||
This library contains electrically-functional connectors.
|
||||
<br>
|
||||
<br>
|
||||
We've spent an enormous amount of time creating and checking these footprints and parts, but it is <b> the end user's responsibility</b> to ensure correctness and suitablity for a given componet or application.
|
||||
<br>
|
||||
<br>If you enjoy using this library, please buy one of our products at <a href=" www.sparkfun.com">SparkFun.com</a>.
|
||||
<br>
|
||||
<br>
|
||||
<b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/
|
||||
<br>
|
||||
<br>
|
||||
You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage.</description>
|
||||
<packages>
|
||||
<package name="1X01_NO_SILK" urn="urn:adsk.eagle:footprint:37651/1" library_version="1">
|
||||
<description><h3>Plated Through Hole - No Silk Outline</h3>
|
||||
<p>Specifications:
|
||||
<ul><li>Pin count:1</li>
|
||||
<li>Pin pitch:0.1"</li>
|
||||
</ul></p>
|
||||
<p>Example device(s):
|
||||
<ul><li>CONN_01</li>
|
||||
</ul></p></description>
|
||||
<pad name="1" x="0" y="0" drill="1.016" diameter="1.8796" rot="R90"/>
|
||||
<text x="-1.27" y="1.143" size="0.6096" layer="25" font="vector" ratio="20">>NAME</text>
|
||||
<text x="-1.27" y="-1.778" size="0.6096" layer="27" font="vector" ratio="20">>VALUE</text>
|
||||
<rectangle x1="-0.254" y1="-0.254" x2="0.254" y2="0.254" layer="51"/>
|
||||
</package>
|
||||
</packages>
|
||||
<packages3d>
|
||||
<package3d name="1X01_NO_SILK" urn="urn:adsk.eagle:package:38041/1" type="box" library_version="1">
|
||||
<description>Plated Through Hole - No Silk Outline
|
||||
Specifications:
|
||||
Pin count:1
|
||||
Pin pitch:0.1"
|
||||
|
||||
Example device(s):
|
||||
CONN_01
|
||||
</description>
|
||||
<packageinstances>
|
||||
<packageinstance name="1X01_NO_SILK"/>
|
||||
</packageinstances>
|
||||
</package3d>
|
||||
</packages3d>
|
||||
</library>
|
||||
</libraries>
|
||||
<attributes>
|
||||
</attributes>
|
||||
<variantdefs>
|
||||
</variantdefs>
|
||||
<classes>
|
||||
<class number="0" name="default" width="0" drill="0">
|
||||
</class>
|
||||
</classes>
|
||||
<designrules name="oshpark-2layer">
|
||||
<description language="en"><b>OSH Park Design Rules</b>
|
||||
<p>
|
||||
Please make sure your boards conform to these design rules.
|
||||
</p>
|
||||
<p>
|
||||
Note, that not all DRC settings must be set by the manufacturer. Several can be adjusted for the design, including those listed on our docs page here.
|
||||
<a href="http://docs.oshpark.com/design-tools/eagle/design-rules-files/">Adjustable Settings</a>
|
||||
</p></description>
|
||||
<param name="layerSetup" value="(1*16)"/>
|
||||
<param name="mtCopper" value="0.035559375mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.035559375mm"/>
|
||||
<param name="mtIsolate" value="1.6mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm"/>
|
||||
<param name="mdWireWire" value="6mil"/>
|
||||
<param name="mdWirePad" value="6mil"/>
|
||||
<param name="mdWireVia" value="6mil"/>
|
||||
<param name="mdPadPad" value="6mil"/>
|
||||
<param name="mdPadVia" value="6mil"/>
|
||||
<param name="mdViaVia" value="6mil"/>
|
||||
<param name="mdSmdPad" value="6mil"/>
|
||||
<param name="mdSmdVia" value="6mil"/>
|
||||
<param name="mdSmdSmd" value="6mil"/>
|
||||
<param name="mdViaViaSameLayer" value="8mil"/>
|
||||
<param name="mnLayersViaInSmd" value="2"/>
|
||||
<param name="mdCopperDimension" value="15mil"/>
|
||||
<param name="mdDrill" value="6mil"/>
|
||||
<param name="mdSmdStop" value="0mil"/>
|
||||
<param name="msWidth" value="6mil"/>
|
||||
<param name="msDrill" value="10mil"/>
|
||||
<param name="msMicroVia" value="10mil"/>
|
||||
<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="5mil"/>
|
||||
<param name="rlMaxPadTop" value="20mil"/>
|
||||
<param name="rlMinPadInner" value="5mil"/>
|
||||
<param name="rlMaxPadInner" value="20mil"/>
|
||||
<param name="rlMinPadBottom" value="5mil"/>
|
||||
<param name="rlMaxPadBottom" value="20mil"/>
|
||||
<param name="rlMinViaOuter" value="5mil"/>
|
||||
<param name="rlMaxViaOuter" value="20mil"/>
|
||||
<param name="rlMinViaInner" value="5mil"/>
|
||||
<param name="rlMaxViaInner" value="20mil"/>
|
||||
<param name="rlMinMicroViaOuter" value="5mil"/>
|
||||
<param name="rlMaxMicroViaOuter" value="20mil"/>
|
||||
<param name="rlMinMicroViaInner" value="5mil"/>
|
||||
<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="2.5mil"/>
|
||||
<param name="mlMaxStopFrame" value="2.5mil"/>
|
||||
<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="checkAngle" value="0"/>
|
||||
<param name="checkFont" value="1"/>
|
||||
<param name="checkRestrict" value="1"/>
|
||||
<param name="checkStop" value="0"/>
|
||||
<param name="checkValues" value="0"/>
|
||||
<param name="checkNames" value="1"/>
|
||||
<param name="checkWireStubs" value="1"/>
|
||||
<param name="checkPolygonWidth" value="0"/>
|
||||
<param name="useDiameter" value="13"/>
|
||||
<param name="maxErrors" value="50"/>
|
||||
</designrules>
|
||||
<autorouter>
|
||||
<pass name="Default">
|
||||
<param name="RoutingGrid" value="50mil"/>
|
||||
<param name="AutoGrid" value="1"/>
|
||||
<param name="Efforts" value="0"/>
|
||||
<param name="TopRouterVariant" value="1"/>
|
||||
<param name="tpViaShape" value="round"/>
|
||||
<param name="PrefDir.1" value="a"/>
|
||||
<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="a"/>
|
||||
<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>
|
||||
<pass name="Optimize1" refer="Default" active="yes">
|
||||
<param name="cfVia" value="99"/>
|
||||
<param name="cfExtdStep" value="10"/>
|
||||
<param name="cfHugging" value="1"/>
|
||||
<param name="mnExtdSteps" value="1"/>
|
||||
<param name="mnRipupLevel" value="0"/>
|
||||
</pass>
|
||||
<pass name="Optimize2" refer="Optimize1" active="yes">
|
||||
<param name="cfNonPref" value="0"/>
|
||||
<param name="cfChangeDir" value="6"/>
|
||||
<param name="cfExtdStep" value="0"/>
|
||||
<param name="cfBonusStep" value="2"/>
|
||||
<param name="cfMalusStep" value="2"/>
|
||||
<param name="cfPadImpact" value="2"/>
|
||||
<param name="cfSmdImpact" value="2"/>
|
||||
<param name="cfHugging" value="0"/>
|
||||
</pass>
|
||||
<pass name="Optimize3" refer="Optimize2" active="yes">
|
||||
<param name="cfChangeDir" value="8"/>
|
||||
<param name="cfPadImpact" value="0"/>
|
||||
<param name="cfSmdImpact" value="0"/>
|
||||
</pass>
|
||||
<pass name="Optimize4" refer="Optimize3" active="yes">
|
||||
<param name="cfChangeDir" value="25"/>
|
||||
</pass>
|
||||
</autorouter>
|
||||
<elements>
|
||||
<element name="E$1" library="Logitech_K120_FPC" package="LOGITECH_K120_FPC" value="" x="4.7" y="5.3" smashed="yes"/>
|
||||
<element name="E$18" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="4.5" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="3.23" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$2" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="6.5" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="5.23" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$3" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="8.5" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="7.23" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$4" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="10.5" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="9.23" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$5" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="12.5" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="11.23" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$6" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="14.5" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="13.23" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$7" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="16.5" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="15.23" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$8" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="18.5" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="17.23" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$9" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="20.5" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="19.23" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$10" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="22.5" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="21.23" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$11" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="24.5" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="23.23" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$12" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="26.5" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="25.23" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$13" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="28.5" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="27.23" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$14" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="30.5" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="29.23" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$15" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="32.5" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="31.23" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$16" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="34.5" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="33.23" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$17" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="37" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="35.73" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$19" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="39" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="37.73" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$20" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="41" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="39.73" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$21" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="43" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="41.73" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$22" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="45" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="43.73" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$23" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="47" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="45.73" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$24" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="49" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="47.73" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$25" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="51" y="11.5" smashed="yes">
|
||||
<attribute name="VALUE" x="49.73" y="9.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$26" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="53" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="51.73" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$27" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="55.5" y="13" smashed="yes">
|
||||
<attribute name="VALUE" x="54.23" y="11.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$28" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="57" y="10.5" smashed="yes">
|
||||
<attribute name="VALUE" x="55.73" y="8.722" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
<element name="E$29" library="SparkFun-Connectors" library_urn="urn:adsk.eagle:library:513" package="1X01_NO_SILK" package3d_urn="urn:adsk.eagle:package:38041/1" value="" x="2.5" y="10" smashed="yes">
|
||||
<attribute name="VALUE" x="1.23" y="8.222" size="0.6096" layer="27" font="vector" ratio="20"/>
|
||||
</element>
|
||||
</elements>
|
||||
<signals>
|
||||
<signal name="S$1">
|
||||
<wire x1="2" y1="9.5" x2="2" y2="1.6" width="2" layer="1"/>
|
||||
<wire x1="2" y1="1.6" x2="57.4" y2="1.6" width="2" layer="1"/>
|
||||
<wire x1="57.4" y1="1.6" x2="57.4" y2="10.2" width="2" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$2">
|
||||
<wire x1="55.7" y1="13" x2="55.7" y2="8" width="0.254" layer="1"/>
|
||||
<wire x1="55.7" y1="8" x2="54.8" y2="7.1" width="0.254" layer="1"/>
|
||||
<wire x1="54.8" y1="7.1" x2="54.8" y2="5.4" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$3">
|
||||
<wire x1="53" y1="12.9" x2="53" y2="11.5" width="0.254" layer="1"/>
|
||||
<wire x1="53" y1="11.5" x2="51.7" y2="10.2" width="0.254" layer="1"/>
|
||||
<wire x1="51.7" y1="10.2" x2="51.7" y2="8.6" width="0.254" layer="1"/>
|
||||
<wire x1="51.7" y1="8.6" x2="52.7" y2="7.6" width="0.254" layer="1"/>
|
||||
<wire x1="52.7" y1="7.6" x2="52.7" y2="5.6" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$4">
|
||||
<wire x1="51.1" y1="11.4" x2="50.7" y2="11" width="0.254" layer="1"/>
|
||||
<wire x1="50.7" y1="11" x2="50.7" y2="5.8" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$5">
|
||||
<wire x1="49.1" y1="13" x2="49.1" y2="12.7" width="0.254" layer="1"/>
|
||||
<wire x1="49.1" y1="12.7" x2="48.8" y2="12.4" width="0.254" layer="1"/>
|
||||
<wire x1="48.8" y1="12.4" x2="48.8" y2="5.8" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$6">
|
||||
<contactref element="E$23" pad="1"/>
|
||||
<wire x1="47" y1="11.5" x2="46.7" y2="11.2" width="0.254" layer="1"/>
|
||||
<wire x1="46.7" y1="11.2" x2="46.7" y2="5.7" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$7">
|
||||
<wire x1="45" y1="12.9" x2="44.7" y2="12.6" width="0.254" layer="1"/>
|
||||
<wire x1="44.7" y1="12.6" x2="44.7" y2="5.7" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$8">
|
||||
<contactref element="E$21" pad="1"/>
|
||||
<wire x1="43" y1="11.5" x2="42.7" y2="11.2" width="0.254" layer="1"/>
|
||||
<wire x1="42.7" y1="11.2" x2="42.7" y2="5.7" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$9">
|
||||
<contactref element="E$20" pad="1"/>
|
||||
<wire x1="41" y1="13" x2="40.7" y2="12.7" width="0.254" layer="1"/>
|
||||
<wire x1="40.7" y1="12.7" x2="40.7" y2="5.5" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$10">
|
||||
<contactref element="E$19" pad="1"/>
|
||||
<wire x1="39" y1="11.5" x2="38.7" y2="11.2" width="0.254" layer="1"/>
|
||||
<wire x1="38.7" y1="11.2" x2="38.7" y2="5.7" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$11">
|
||||
<wire x1="37" y1="12.9" x2="37" y2="7.3" width="0.254" layer="1"/>
|
||||
<wire x1="37" y1="7.3" x2="36.7" y2="7" width="0.254" layer="1"/>
|
||||
<wire x1="36.7" y1="7" x2="36.7" y2="5.6" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$12">
|
||||
<wire x1="34.5" y1="12.9" x2="34.5" y2="10.2" width="0.254" layer="1"/>
|
||||
<wire x1="34.5" y1="10.2" x2="33.8" y2="9.5" width="0.254" layer="1"/>
|
||||
<wire x1="33.8" y1="9.5" x2="33.8" y2="8.1" width="0.254" layer="1"/>
|
||||
<wire x1="33.8" y1="8.1" x2="34.7" y2="7.2" width="0.254" layer="1"/>
|
||||
<wire x1="34.7" y1="7.2" x2="34.7" y2="5.8" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$13">
|
||||
<wire x1="32.5" y1="11.4" x2="32.7" y2="11.2" width="0.254" layer="1"/>
|
||||
<wire x1="32.7" y1="11.2" x2="32.7" y2="5.7" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$14">
|
||||
<contactref element="E$14" pad="1"/>
|
||||
<wire x1="30.5" y1="13" x2="30.7" y2="12.8" width="0.254" layer="1"/>
|
||||
<wire x1="30.7" y1="12.8" x2="30.7" y2="5.6" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$15">
|
||||
<wire x1="28.5" y1="11.6" x2="28.7" y2="11.4" width="0.254" layer="1"/>
|
||||
<wire x1="28.7" y1="11.4" x2="28.7" y2="5.7" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$16">
|
||||
<contactref element="E$12" pad="1"/>
|
||||
<wire x1="26.5" y1="13" x2="26.7" y2="12.8" width="0.254" layer="1"/>
|
||||
<wire x1="26.7" y1="12.8" x2="26.7" y2="5.6" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$17">
|
||||
<contactref element="E$11" pad="1"/>
|
||||
<wire x1="24.5" y1="11.5" x2="24.7" y2="11.3" width="0.254" layer="1"/>
|
||||
<wire x1="24.7" y1="11.3" x2="24.7" y2="5.8" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$18">
|
||||
<contactref element="E$10" pad="1"/>
|
||||
<wire x1="22.5" y1="13" x2="22.7" y2="12.8" width="0.254" layer="1"/>
|
||||
<wire x1="22.7" y1="12.8" x2="22.7" y2="5.7" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$19">
|
||||
<wire x1="20.6" y1="11.4" x2="20.7" y2="11.3" width="0.254" layer="1"/>
|
||||
<wire x1="20.7" y1="11.3" x2="20.7" y2="5.6" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$20">
|
||||
<contactref element="E$8" pad="1"/>
|
||||
<wire x1="18.5" y1="13" x2="18.7" y2="12.8" width="0.254" layer="1"/>
|
||||
<wire x1="18.7" y1="12.8" x2="18.7" y2="5.5" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$21">
|
||||
<contactref element="E$7" pad="1"/>
|
||||
<wire x1="16.5" y1="11.5" x2="16.7" y2="11.3" width="0.254" layer="1"/>
|
||||
<wire x1="16.7" y1="11.3" x2="16.7" y2="5.6" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$22">
|
||||
<contactref element="E$6" pad="1"/>
|
||||
<wire x1="14.5" y1="13" x2="14.7" y2="12.8" width="0.254" layer="1"/>
|
||||
<wire x1="14.7" y1="12.8" x2="14.7" y2="5.6" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$23">
|
||||
<contactref element="E$5" pad="1"/>
|
||||
<wire x1="12.5" y1="11.5" x2="12.7" y2="11.3" width="0.254" layer="1"/>
|
||||
<wire x1="12.7" y1="11.3" x2="12.7" y2="5.7" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$24">
|
||||
<contactref element="E$4" pad="1"/>
|
||||
<wire x1="10.5" y1="13" x2="10.7" y2="12.8" width="0.254" layer="1"/>
|
||||
<wire x1="10.7" y1="12.8" x2="10.7" y2="5.5" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$25">
|
||||
<contactref element="E$3" pad="1"/>
|
||||
<wire x1="8.5" y1="11.5" x2="8.7" y2="11.3" width="0.254" layer="1"/>
|
||||
<wire x1="8.7" y1="11.3" x2="8.7" y2="5.6" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$26">
|
||||
<wire x1="6.4" y1="13.1" x2="6.7" y2="12.8" width="0.254" layer="1"/>
|
||||
<wire x1="6.7" y1="12.8" x2="6.7" y2="5.5" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
<signal name="S$27">
|
||||
<contactref element="E$18" pad="1"/>
|
||||
<wire x1="4.5" y1="11.5" x2="4.7" y2="11.3" width="0.254" layer="1"/>
|
||||
<wire x1="4.7" y1="11.3" x2="4.7" y2="5.4" width="0.254" layer="1"/>
|
||||
</signal>
|
||||
</signals>
|
||||
<mfgpreviewcolors>
|
||||
<mfgpreviewcolor name="soldermaskcolor" color="0xC8008000"/>
|
||||
<mfgpreviewcolor name="silkscreencolor" color="0xFFFEFEFE"/>
|
||||
<mfgpreviewcolor name="backgroundcolor" color="0xFF282828"/>
|
||||
<mfgpreviewcolor name="coppercolor" color="0xFFFFBF00"/>
|
||||
<mfgpreviewcolor name="substratecolor" color="0xFF786E46"/>
|
||||
</mfgpreviewcolors>
|
||||
</board>
|
||||
</drawing>
|
||||
<compatibility>
|
||||
<note version="8.2" severity="warning">
|
||||
Since Version 8.2, EAGLE supports online libraries. The ids
|
||||
of those online libraries will not be understood (or retained)
|
||||
with this version.
|
||||
</note>
|
||||
<note version="8.3" severity="warning">
|
||||
Since Version 8.3, EAGLE supports URNs for individual library
|
||||
assets (packages, symbols, and devices). The URNs of those assets
|
||||
will not be understood (or retained) with this version.
|
||||
</note>
|
||||
<note version="8.3" severity="warning">
|
||||
Since Version 8.3, EAGLE supports the association of 3D packages
|
||||
with devices in libraries, schematics, and board files. Those 3D
|
||||
packages will not be understood (or retained) with this version.
|
||||
</note>
|
||||
</compatibility>
|
||||
</eagle>
|
391
Example_Keyboards/Logitech_K120/Logitech_K120_4p1.ino
Normal file
391
Example_Keyboards/Logitech_K120/Logitech_K120_4p1.ino
Normal file
|
@ -0,0 +1,391 @@
|
|||
/* Copyright 2021 Frank Adams
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
// This software implements a Logitech K120 Keyboard Controller using a Teensy 4.1 wired to a
|
||||
// pcb with pads. The flexible sheets with traces in the keyboard are pressed against the pcb pads
|
||||
// to make connection. No FPC connector is used.
|
||||
// Revision History
|
||||
// Initial Release Nov 22, 2021
|
||||
//
|
||||
#define MODIFIERKEY_FN 0x8f // give Fn key a HID code
|
||||
#define CAPS_LED 22 // Teensy LED shows Caps-Lock
|
||||
#define NUM_LED 23
|
||||
//
|
||||
const byte rows_max = 18; // sets the number of rows in the matrix
|
||||
const byte cols_max = 8; // sets the number of columns in the matrix
|
||||
//
|
||||
// Load the normal key matrix with the Teensyduino key names described at www.pjrc.com/teensy/td_keyboard.html
|
||||
// A zero indicates no normal key at that location.
|
||||
//
|
||||
int normal[rows_max][cols_max] = {
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{KEY_ESC,KEY_TILDE,KEY_TAB,KEY_Q,KEY_A,KEY_F,KEY_Z,KEY_CAPS_LOCK},
|
||||
{KEY_F8,KEY_F9,KEY_8,KEY_9,KEY_0,KEY_O,KEY_L,KEY_SLASH},
|
||||
{KEY_PRINTSCREEN,KEY_SCROLL_LOCK,KEY_PAUSE,KEY_PAGE_UP,KEY_NUM_LOCK,KEY_HOME,KEY_PAGE_DOWN,KEY_INSERT},
|
||||
{KEY_F10,KEY_F11,KEY_F12,KEY_MINUS,KEY_EQUAL,KEY_I,KEY_LEFT,0},
|
||||
{KEY_F6,KEY_F7,KEY_U,KEY_H,KEY_7,KEY_J,KEY_N,KEY_PERIOD},
|
||||
{KEY_F4,KEY_4,KEY_R,KEY_5,KEY_F,KEY_V,KEY_M,KEY_MENU},
|
||||
{KEY_F5,KEY_T,KEY_6,KEY_Y,KEY_G,KEY_B,KEY_COMMA,0},
|
||||
{0,0,0,0,0,0,0,0}, //
|
||||
{KEYPAD_SLASH,KEYPAD_8,KEY_END,KEYPAD_ASTERIX,KEYPAD_7,KEYPAD_9,KEYPAD_5,KEYPAD_6}, //
|
||||
{0,0,0,0,0,0,0,0}, //
|
||||
{0,KEY_BACKSPACE,KEY_P,KEY_LEFT_BRACE,KEY_SEMICOLON,KEY_QUOTE,KEY_K,KEY_DOWN},
|
||||
{KEY_RIGHT_BRACE,KEY_BACKSLASH,KEY_DELETE,KEY_ENTER,KEY_UP,KEY_RIGHT,KEYPAD_0,KEY_SPACE},
|
||||
{KEYPAD_4,KEYPAD_1,KEYPAD_2,KEYPAD_3,KEYPAD_MINUS,KEYPAD_PLUS,0,KEYPAD_ENTER},
|
||||
{KEY_F2,KEY_F3,KEY_3,KEY_E,KEY_D,KEY_C,0,0},
|
||||
{KEY_F1,KEY_1,KEY_2,KEY_W,KEY_9,KEY_X,KEY_S,KEYPAD_PERIOD},
|
||||
{0,0,0,0,0,0,0,0}, //
|
||||
{0,0,0,0,0,0,0,0} //
|
||||
};
|
||||
// Load the modifier key matrix with key names at the correct row-column location.
|
||||
// A zero indicates no modifier key at that location.
|
||||
int modifier[rows_max][cols_max] = {
|
||||
{0,0,MODIFIERKEY_CTRL,0,MODIFIERKEY_RIGHT_CTRL,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,MODIFIERKEY_SHIFT,0,0,0,MODIFIERKEY_RIGHT_SHIFT},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,MODIFIERKEY_GUI,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{MODIFIERKEY_ALT,0,0,0,0,MODIFIERKEY_RIGHT_ALT,0,0},
|
||||
{0,0,0,0,0,0,MODIFIERKEY_FN,0} // actually the MODIFIERKEY_RIGHT_GUI key
|
||||
};
|
||||
// Load the media key matrix with Fn key names at the correct row-column location.
|
||||
// A zero indicates no media key at that location.
|
||||
int media[rows_max][cols_max] = {
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{KEY_MEDIA_VOLUME_DEC,KEY_MEDIA_VOLUME_INC,0,0,0,0,0,0},
|
||||
{KEY_MEDIA_MUTE,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0}
|
||||
};
|
||||
// Initialize the old_key matrix with one's.
|
||||
// 1 = key not pressed, 0 = key is pressed
|
||||
boolean old_key[rows_max][cols_max] = {
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1}
|
||||
};
|
||||
//
|
||||
// Define the Teensy 4.1 I/O numbers (translated from the FPC pin #)
|
||||
int Row_IO[rows_max] = {0,1,10,11,12,24,25,26,27,28,29,30,31,32,36,35,34,33}; // Teensy 4.0 I/O numbers for rows
|
||||
//
|
||||
int Col_IO[cols_max] = {2,3,4,5,6,7,8,9}; // Teensy 4.1 I/O numbers for columns
|
||||
|
||||
// Declare variables that will be used by functions
|
||||
boolean slots_full = LOW; // Goes high when slots 1 thru 6 contain normal keys
|
||||
// slot 1 thru slot 6 hold the normal key values to be sent over USB.
|
||||
int slot1 = 0; //value of 0 means the slot is empty and can be used.
|
||||
int slot2 = 0;
|
||||
int slot3 = 0;
|
||||
int slot4 = 0;
|
||||
int slot5 = 0;
|
||||
int slot6 = 0;
|
||||
//
|
||||
int mod_shift_l = 0; // These variables are sent over USB as modifier keys.
|
||||
int mod_shift_r = 0; // Each is either set to 0 or MODIFIER_ ...
|
||||
int mod_ctrl_l = 0;
|
||||
int mod_ctrl_r = 0;
|
||||
int mod_alt_l = 0;
|
||||
int mod_alt_r = 0;
|
||||
int mod_gui = 0;
|
||||
//
|
||||
// Function to load the key name into the first available slot
|
||||
void load_slot(int key) {
|
||||
if (!slot1) {
|
||||
slot1 = key;
|
||||
}
|
||||
else if (!slot2) {
|
||||
slot2 = key;
|
||||
}
|
||||
else if (!slot3) {
|
||||
slot3 = key;
|
||||
}
|
||||
else if (!slot4) {
|
||||
slot4 = key;
|
||||
}
|
||||
else if (!slot5) {
|
||||
slot5 = key;
|
||||
}
|
||||
else if (!slot6) {
|
||||
slot6 = key;
|
||||
}
|
||||
if (!slot1 || !slot2 || !slot3 || !slot4 || !slot5 || !slot6) {
|
||||
slots_full = LOW; // slots are not full
|
||||
}
|
||||
else {
|
||||
slots_full = HIGH; // slots are full
|
||||
}
|
||||
}
|
||||
//
|
||||
// Function to clear the slot that contains the key name
|
||||
void clear_slot(int key) {
|
||||
if (slot1 == key) {
|
||||
slot1 = 0;
|
||||
}
|
||||
else if (slot2 == key) {
|
||||
slot2 = 0;
|
||||
}
|
||||
else if (slot3 == key) {
|
||||
slot3 = 0;
|
||||
}
|
||||
else if (slot4 == key) {
|
||||
slot4 = 0;
|
||||
}
|
||||
else if (slot5 == key) {
|
||||
slot5 = 0;
|
||||
}
|
||||
else if (slot6 == key) {
|
||||
slot6 = 0;
|
||||
}
|
||||
if (!slot1 || !slot2 || !slot3 || !slot4 || !slot5 || !slot6) {
|
||||
slots_full = LOW; // slots are not full
|
||||
}
|
||||
else {
|
||||
slots_full = HIGH; // slots are full
|
||||
}
|
||||
}
|
||||
//
|
||||
// Function to load the modifier key name into the appropriate mod variable
|
||||
void load_mod(int m_key) {
|
||||
if (m_key == MODIFIERKEY_LEFT_SHIFT) {
|
||||
mod_shift_l = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_SHIFT) {
|
||||
mod_shift_r = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_LEFT_CTRL) {
|
||||
mod_ctrl_l = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_CTRL) {
|
||||
mod_ctrl_r = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_LEFT_ALT) {
|
||||
mod_alt_l = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_ALT) {
|
||||
mod_alt_r = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_GUI) {
|
||||
mod_gui = m_key;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Function to load 0 into the appropriate mod variable
|
||||
void clear_mod(int m_key) {
|
||||
if (m_key == MODIFIERKEY_LEFT_SHIFT) {
|
||||
mod_shift_l = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_SHIFT) {
|
||||
mod_shift_r = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_LEFT_CTRL) {
|
||||
mod_ctrl_l = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_CTRL) {
|
||||
mod_ctrl_r = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_LEFT_ALT) {
|
||||
mod_alt_l = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_ALT) {
|
||||
mod_alt_r = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_GUI) {
|
||||
mod_gui = 0;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Function to send the modifier keys over usb
|
||||
void send_mod() {
|
||||
Keyboard.set_modifier(mod_shift_l | mod_shift_r | mod_ctrl_l | mod_ctrl_r | mod_alt_l | mod_alt_r | mod_gui);
|
||||
Keyboard.send_now();
|
||||
}
|
||||
//
|
||||
// Function to send the normal keys in the 6 slots over usb
|
||||
void send_normals() {
|
||||
Keyboard.set_key1(slot1);
|
||||
Keyboard.set_key2(slot2);
|
||||
Keyboard.set_key3(slot3);
|
||||
Keyboard.set_key4(slot4);
|
||||
Keyboard.set_key5(slot5);
|
||||
Keyboard.set_key6(slot6);
|
||||
Keyboard.send_now();
|
||||
}
|
||||
//
|
||||
// Function to set a pin as an input without a pullup
|
||||
void go_z(int pin)
|
||||
{
|
||||
pinMode(pin, INPUT);
|
||||
}
|
||||
//
|
||||
// Function to set a pin as an input with a pullup
|
||||
void go_pu(int pin)
|
||||
{
|
||||
pinMode(pin, INPUT_PULLUP);
|
||||
digitalWrite(pin, HIGH);
|
||||
}
|
||||
//
|
||||
// Function to send a pin to a logic low
|
||||
void go_0(int pin)
|
||||
{
|
||||
pinMode(pin, OUTPUT);
|
||||
digitalWrite(pin, LOW);
|
||||
}
|
||||
//
|
||||
// Function to send a pin to a logic high
|
||||
void go_1(int pin)
|
||||
{
|
||||
pinMode(pin, OUTPUT);
|
||||
digitalWrite(pin, HIGH);
|
||||
}
|
||||
//
|
||||
//----------------------------------Setup-------------------------------------------
|
||||
void setup() {
|
||||
for (int a = 0; a < cols_max; a++) { // loop thru all column pins
|
||||
go_z(Col_IO[a]); // set each column pin as an input without a pullup
|
||||
}
|
||||
//
|
||||
for (int b = 0; b < rows_max; b++) { // loop thru all row pins
|
||||
go_z(Row_IO[b]); // set each row pin as a floating output
|
||||
}
|
||||
}
|
||||
//
|
||||
boolean Fn_pressed = HIGH; // Initialize Fn key to HIGH = "not pressed"
|
||||
extern volatile uint8_t keyboard_leds; // 8 bits sent from Host to Teensy that give keyboard LED status. Caps lock is bit D1.
|
||||
//
|
||||
//---------------------------------Main Loop---------------------------------------------
|
||||
//
|
||||
void loop() {
|
||||
elapsedMillis loop_timer; // zero the loop timer. Timer is used at the end of the loop to determine when to repeat
|
||||
// Scan keyboard matrix with an outer loop that drives each row low and an inner loop that reads every column (with pull ups).
|
||||
// The routine looks at each key's present state (by reading the column input pin) and also the previous state from the last scan
|
||||
// that was 30msec ago. The status of a key that was just pressed or just released is sent over USB and the state is saved in the old_key matrix.
|
||||
// The keyboard keys will read as logic low if they are pressed (negative logic).
|
||||
// The old_key matrix also uses negative logic (low=pressed).
|
||||
//
|
||||
for (int x = 0; x < rows_max; x++) { // loop thru the rows
|
||||
go_0(Row_IO[x]); // Activate Row (send it low)
|
||||
delayMicroseconds(50); // give the row time to go low and settle out
|
||||
for (int y = 0; y < cols_max; y++) { // loop thru the columns
|
||||
// **********Modifier keys including the Fn special case
|
||||
if (modifier[x][y] != 0) { // check if modifier key exists at this location in the array (a non-zero value)
|
||||
if (!digitalRead(Col_IO[y]) && (old_key[x][y])) { // Read column to see if key is low (pressed) and was previously not pressed
|
||||
if (modifier[x][y] != MODIFIERKEY_FN) { // Exclude Fn modifier key
|
||||
load_mod(modifier[x][y]); // function reads which modifier key is pressed and loads it into the appropriate mod_... variable
|
||||
send_mod(); // function sends the state of all modifier keys over usb including the one that just got pressed
|
||||
old_key[x][y] = LOW; // Save state of key as "pressed"
|
||||
}
|
||||
else {
|
||||
Fn_pressed = LOW; // Fn status variable is active low
|
||||
old_key[x][y] = LOW; // old_key state is "pressed" (active low)
|
||||
}
|
||||
}
|
||||
else if (digitalRead(Col_IO[y]) && (!old_key[x][y])) { //check if key is not pressed and was previously pressed
|
||||
if (modifier[x][y] != MODIFIERKEY_FN) { // Exclude Fn modifier key
|
||||
clear_mod(modifier[x][y]); // function reads which modifier key was released and loads 0 into the appropriate mod_... variable
|
||||
send_mod(); // function sends all mod's over usb including the one that just released
|
||||
old_key[x][y] = HIGH; // Save state of key as "not pressed"
|
||||
}
|
||||
else {
|
||||
Fn_pressed = HIGH; // Fn is no longer active
|
||||
old_key[x][y] = HIGH; // old_key state is "not pressed"
|
||||
}
|
||||
}
|
||||
}
|
||||
// ***********end of modifier section
|
||||
//
|
||||
// ***********Normal keys and media keys in this section
|
||||
else if ((normal[x][y] != 0) || (media[x][y] != 0)) { // check if normal or media key exists at this location in the array
|
||||
if (!digitalRead(Col_IO[y]) && (old_key[x][y]) && (!slots_full)) { // check if key is pressed and was not previously pressed and slots not full
|
||||
old_key[x][y] = LOW; // Save state of key as "pressed"
|
||||
if (Fn_pressed) { // Fn_pressed is active low so it is not pressed and normal key needs to be sent
|
||||
load_slot(normal[x][y]); //update first available slot with normal key name
|
||||
send_normals(); // send all slots over USB including the key that just got pressed
|
||||
}
|
||||
else if (media[x][y] != 0) { // Fn is pressed so send media if a key exists in the matrix
|
||||
Keyboard.press(media[x][y]); // media key is sent using keyboard press function per PJRC
|
||||
//delay(5); // delay 5 milliseconds before releasing to make sure it gets sent over USB
|
||||
delayMicroseconds(300);
|
||||
Keyboard.release(media[x][y]); // send media key release
|
||||
}
|
||||
}
|
||||
else if (digitalRead(Col_IO[y]) && (!old_key[x][y])) { //check if key is not pressed, but was previously pressed
|
||||
old_key[x][y] = HIGH; // Save state of key as "not pressed"
|
||||
if (Fn_pressed) { // Fn is not pressed
|
||||
clear_slot(normal[x][y]); //clear the slot that contains the normal key name
|
||||
send_normals(); // send all slots over USB including the key that was just released
|
||||
}
|
||||
}
|
||||
}
|
||||
// **************end of normal and media key section
|
||||
//
|
||||
}
|
||||
go_z(Row_IO[x]); // De-activate Row (send it to hi-z)
|
||||
}
|
||||
//
|
||||
// **********keyboard scan complete
|
||||
//
|
||||
// Turn on the LEDs for Caps and Num Lock based on the keyboard_leds variable controlled by the USB host computer
|
||||
// CAPS LOCK
|
||||
if (keyboard_leds & 1<<1) { // mask off all bits but D1 and test if set
|
||||
go_1(CAPS_LED); // turn on the LED
|
||||
}
|
||||
else {
|
||||
go_0(CAPS_LED); // turn off the LED
|
||||
}
|
||||
// NUM LOCK
|
||||
if (keyboard_leds & 1) { // mask off all bits but D0 and test if set
|
||||
go_1(NUM_LED); // turn on the LED
|
||||
}
|
||||
else {
|
||||
go_0(NUM_LED); // turn off the LED
|
||||
}
|
||||
//
|
||||
delay(25);
|
||||
}
|
|
@ -0,0 +1,407 @@
|
|||
/* Copyright 2021 Frank Adams
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
// This software implements a Logitech K120 Keyboard Controller using a Teensy 4.1 wired to the 2 FPC cables,
|
||||
// (there is no circuit board). The standard USB keyboard code would sometimes miss a key press when scanning
|
||||
// at 30 msec. Changing the scan rate to under 1 msec allowed all key presses to be seen but sometimes
|
||||
// two presses would be seen. A debounce/noise filter function called “read_key” has been added to the
|
||||
// code. This function will read a key 5 times in a row with a fixed delay between reads. The function
|
||||
// returns a key-down or key-up result by majority voting.
|
||||
//
|
||||
// Revision History
|
||||
// Initial Release Oct 15, 2021 - Added debounce/noise filter when reading the keyboard
|
||||
//
|
||||
#define MODIFIERKEY_FN 0x8f // give Fn key a HID code
|
||||
#define CAPS_LED 13 // Teensy LED shows Caps-Lock
|
||||
//
|
||||
const byte rows_max = 18; // sets the number of rows in the matrix
|
||||
const byte cols_max = 8; // sets the number of columns in the matrix
|
||||
//
|
||||
// Load the normal key matrix with the Teensyduino key names described at www.pjrc.com/teensy/td_keyboard.html
|
||||
// A zero indicates no normal key at that location.
|
||||
//
|
||||
int normal[rows_max][cols_max] = {
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{KEY_C,KEY_X,KEY_DELETE,0,KEY_BACKSLASH,KEYPAD_PERIOD,KEYPAD_9,KEY_SPACE},
|
||||
{KEY_SLASH,KEY_O,KEY_P,KEYPAD_1,KEY_D,KEY_QUOTE,KEY_RIGHT,KEY_PAUSE},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{KEY_HOME,KEY_Y,KEY_T,KEY_R,KEY_6,KEY_5,KEYPAD_PLUS,KEY_BACKSPACE},
|
||||
{KEY_9,KEY_8,KEY_M,KEY_EQUAL,KEYPAD_3,KEY_COMMA,KEY_7,KEY_V},
|
||||
{KEY_SLASH,KEY_PAGE_DOWN,KEY_ENTER,KEY_NUM_LOCK,KEY_CAPS_LOCK,KEYPAD_0,KEY_END,0x65},
|
||||
{KEY_MINUS,KEY_TAB,KEY_H,KEY_Q,KEY_G,KEY_4,KEY_3,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{KEY_0,KEY_F,KEY_N,KEY_MINUS,KEY_F2,KEY_SEMICOLON,KEYPAD_2,KEY_Z},
|
||||
{0,KEY_F5,KEY_J,KEY_L,KEY_LEFT_BRACE,KEY_K,KEY_PERIOD,KEY_BACKSLASH},
|
||||
{KEY_F7,0,KEY_LEFT,KEY_A,0,KEYPAD_5,KEY_F6,KEYPAD_7},
|
||||
{KEYPAD_4,KEY_I,KEY_E,KEY_F11,KEY_U,KEY_UP,KEY_F12,KEY_INSERT},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{KEYPAD_ASTERIX,KEY_1,KEY_RIGHT_BRACE,KEY_PAGE_UP,KEY_B,KEY_TILDE,KEY_2,KEY_SCROLL_LOCK},
|
||||
{0,0,KEYPAD_6,KEY_DOWN,KEY_F3,KEY_F4,KEY_S,KEY_PRINTSCREEN},
|
||||
{KEY_F8,KEYPAD_8,KEY_ESC,KEY_F10,KEY_F1,KEY_W,KEY_F9,KEYPAD_ENTER},
|
||||
{0,0,0,0,0,0,0,0}
|
||||
};
|
||||
// Load the modifier key matrix with key names at the correct row-column location.
|
||||
// A zero indicates no modifier key at that location.
|
||||
int modifier[rows_max][cols_max] = {
|
||||
{0,0,MODIFIERKEY_RIGHT_SHIFT,0,0,MODIFIERKEY_SHIFT,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,MODIFIERKEY_RIGHT_GUI},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{MODIFIERKEY_GUI,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,MODIFIERKEY_CTRL,0,0,MODIFIERKEY_RIGHT_CTRL,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,MODIFIERKEY_RIGHT_ALT,0,0,MODIFIERKEY_ALT,0,0,0}
|
||||
};
|
||||
// Load the media key matrix with Fn key names at the correct row-column location.
|
||||
// A zero indicates no media key at that location.
|
||||
int media[rows_max][cols_max] = {
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,KEY_SYSTEM_SLEEP,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,KEY_SCROLL_LOCK,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0}
|
||||
};
|
||||
// Initialize the old_key matrix with one's.
|
||||
// 1 = key not pressed, 0 = key is pressed
|
||||
boolean old_key[rows_max][cols_max] = {
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1},
|
||||
{1,1,1,1,1,1,1,1}
|
||||
};
|
||||
//
|
||||
// Define the Teensy 4.1 I/O numbers (translated from the FPC pin #)
|
||||
int Row_IO[rows_max] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16, 17, 24, 25, 26}; // Teensy 4.0 I/O numbers for rows
|
||||
//
|
||||
int Col_IO[cols_max] = {27, 28, 29, 30, 31, 32, 14, 15}; // Teensy 4.1 I/O numbers for columns
|
||||
//
|
||||
// Declare variables that will be used by functions
|
||||
boolean slots_full = LOW; // Goes high when slots 1 thru 6 contain normal keys
|
||||
// slot 1 thru slot 6 hold the normal key values to be sent over USB.
|
||||
int slot1 = 0; //value of 0 means the slot is empty and can be used.
|
||||
int slot2 = 0;
|
||||
int slot3 = 0;
|
||||
int slot4 = 0;
|
||||
int slot5 = 0;
|
||||
int slot6 = 0;
|
||||
//
|
||||
int mod_shift_l = 0; // These variables are sent over USB as modifier keys.
|
||||
int mod_shift_r = 0; // Each is either set to 0 or MODIFIER_ ...
|
||||
int mod_ctrl_l = 0;
|
||||
int mod_ctrl_r = 0;
|
||||
int mod_alt_l = 0;
|
||||
int mod_alt_r = 0;
|
||||
int mod_gui = 0;
|
||||
//
|
||||
// Function to load the key name into the first available slot
|
||||
void load_slot(int key) {
|
||||
if (!slot1) {
|
||||
slot1 = key;
|
||||
}
|
||||
else if (!slot2) {
|
||||
slot2 = key;
|
||||
}
|
||||
else if (!slot3) {
|
||||
slot3 = key;
|
||||
}
|
||||
else if (!slot4) {
|
||||
slot4 = key;
|
||||
}
|
||||
else if (!slot5) {
|
||||
slot5 = key;
|
||||
}
|
||||
else if (!slot6) {
|
||||
slot6 = key;
|
||||
}
|
||||
if (!slot1 || !slot2 || !slot3 || !slot4 || !slot5 || !slot6) {
|
||||
slots_full = LOW; // slots are not full
|
||||
}
|
||||
else {
|
||||
slots_full = HIGH; // slots are full
|
||||
}
|
||||
}
|
||||
//
|
||||
// Function to clear the slot that contains the key name
|
||||
void clear_slot(int key) {
|
||||
if (slot1 == key) {
|
||||
slot1 = 0;
|
||||
}
|
||||
else if (slot2 == key) {
|
||||
slot2 = 0;
|
||||
}
|
||||
else if (slot3 == key) {
|
||||
slot3 = 0;
|
||||
}
|
||||
else if (slot4 == key) {
|
||||
slot4 = 0;
|
||||
}
|
||||
else if (slot5 == key) {
|
||||
slot5 = 0;
|
||||
}
|
||||
else if (slot6 == key) {
|
||||
slot6 = 0;
|
||||
}
|
||||
if (!slot1 || !slot2 || !slot3 || !slot4 || !slot5 || !slot6) {
|
||||
slots_full = LOW; // slots are not full
|
||||
}
|
||||
else {
|
||||
slots_full = HIGH; // slots are full
|
||||
}
|
||||
}
|
||||
//
|
||||
// Function to load the modifier key name into the appropriate mod variable
|
||||
void load_mod(int m_key) {
|
||||
if (m_key == MODIFIERKEY_LEFT_SHIFT) {
|
||||
mod_shift_l = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_SHIFT) {
|
||||
mod_shift_r = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_LEFT_CTRL) {
|
||||
mod_ctrl_l = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_CTRL) {
|
||||
mod_ctrl_r = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_LEFT_ALT) {
|
||||
mod_alt_l = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_ALT) {
|
||||
mod_alt_r = m_key;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_GUI) {
|
||||
mod_gui = m_key;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Function to load 0 into the appropriate mod variable
|
||||
void clear_mod(int m_key) {
|
||||
if (m_key == MODIFIERKEY_LEFT_SHIFT) {
|
||||
mod_shift_l = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_SHIFT) {
|
||||
mod_shift_r = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_LEFT_CTRL) {
|
||||
mod_ctrl_l = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_CTRL) {
|
||||
mod_ctrl_r = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_LEFT_ALT) {
|
||||
mod_alt_l = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_RIGHT_ALT) {
|
||||
mod_alt_r = 0;
|
||||
}
|
||||
else if (m_key == MODIFIERKEY_GUI) {
|
||||
mod_gui = 0;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Function to send the modifier keys over usb
|
||||
void send_mod() {
|
||||
Keyboard.set_modifier(mod_shift_l | mod_shift_r | mod_ctrl_l | mod_ctrl_r | mod_alt_l | mod_alt_r | mod_gui);
|
||||
Keyboard.send_now();
|
||||
}
|
||||
//
|
||||
// Function to send the normal keys in the 6 slots over usb
|
||||
void send_normals() {
|
||||
Keyboard.set_key1(slot1);
|
||||
Keyboard.set_key2(slot2);
|
||||
Keyboard.set_key3(slot3);
|
||||
Keyboard.set_key4(slot4);
|
||||
Keyboard.set_key5(slot5);
|
||||
Keyboard.set_key6(slot6);
|
||||
Keyboard.send_now();
|
||||
}
|
||||
//
|
||||
// Function to set a pin to high impedance (acts like open drain output)
|
||||
void go_z(int pin)
|
||||
{
|
||||
pinMode(pin, INPUT);
|
||||
digitalWrite(pin, HIGH);
|
||||
}
|
||||
//
|
||||
// Function to set a pin as an input with a pullup
|
||||
void go_pu(int pin)
|
||||
{
|
||||
pinMode(pin, INPUT_PULLUP);
|
||||
digitalWrite(pin, HIGH);
|
||||
}
|
||||
//
|
||||
// Function to send a pin to a logic low
|
||||
void go_0(int pin)
|
||||
{
|
||||
pinMode(pin, OUTPUT);
|
||||
digitalWrite(pin, LOW);
|
||||
}
|
||||
//
|
||||
// Function to send a pin to a logic high
|
||||
void go_1(int pin)
|
||||
{
|
||||
pinMode(pin, OUTPUT);
|
||||
digitalWrite(pin, HIGH);
|
||||
}
|
||||
//
|
||||
// Function to read a key multiple times and vote to filter any noise/debounce
|
||||
int read_key(int y) {
|
||||
int read1 = digitalRead(Col_IO[y]);
|
||||
delayMicroseconds(2); // increase delay between reads if necessary to filter noise or key bounce
|
||||
int read2 = digitalRead(Col_IO[y]);
|
||||
delayMicroseconds(2);
|
||||
int read3 = digitalRead(Col_IO[y]);
|
||||
delayMicroseconds(2);
|
||||
int read4 = digitalRead(Col_IO[y]);
|
||||
delayMicroseconds(2);
|
||||
int read5 = digitalRead(Col_IO[y]);
|
||||
int readsum = read1 + read2 + read3 + read4 + read5; // count how many 1's were read
|
||||
if (readsum <= 2) { // 0, 1, or 2 means there are more low reads than high reads
|
||||
return 0; // key is pressed
|
||||
}
|
||||
else {
|
||||
return 1; // key is not pressed
|
||||
}
|
||||
}
|
||||
//
|
||||
//----------------------------------Setup-------------------------------------------
|
||||
void setup() {
|
||||
for (int a = 0; a < cols_max; a++) { // loop thru all column pins
|
||||
go_pu(Col_IO[a]); // set each column pin as an input with a pullup
|
||||
}
|
||||
//
|
||||
for (int b = 0; b < rows_max; b++) { // loop thru all row pins
|
||||
go_z(Row_IO[b]); // set each row pin as a floating output
|
||||
}
|
||||
}
|
||||
//
|
||||
boolean Fn_pressed = HIGH; // Initialize Fn key to HIGH = "not pressed"
|
||||
extern volatile uint8_t keyboard_leds; // 8 bits sent from Host to Teensy that give keyboard LED status. Caps lock is bit D1.
|
||||
//
|
||||
//---------------------------------Main Loop---------------------------------------------
|
||||
//
|
||||
void loop() {
|
||||
// Scan keyboard matrix with an outer loop that drives each row low and an inner loop that reads every column (with pull ups).
|
||||
// The routine looks at each key's present state (by reading the column input pin) and also the previous state from the last scan
|
||||
// that was 30msec ago. The status of a key that was just pressed or just released is sent over USB and the state is saved in the old_key matrix.
|
||||
// The keyboard keys will read as logic low if they are pressed (negative logic).
|
||||
// The old_key matrix also uses negative logic (low=pressed).
|
||||
//
|
||||
for (int x = 0; x < rows_max; x++) { // loop thru the rows
|
||||
go_0(Row_IO[x]); // Activate Row (send it low)
|
||||
delayMicroseconds(15); // give the row time to go low and settle out
|
||||
for (int y = 0; y < cols_max; y++) { // loop thru the columns
|
||||
// **********Modifier keys including the Fn special case
|
||||
if (modifier[x][y] != 0) { // check if modifier key exists at this location in the array (a non-zero value)
|
||||
if (!read_key(y) && (old_key[x][y])) { // Read column to see if key is low (pressed) and was previously not pressed
|
||||
if (modifier[x][y] != MODIFIERKEY_FN) { // Exclude Fn modifier key
|
||||
load_mod(modifier[x][y]); // function reads which modifier key is pressed and loads it into the appropriate mod_... variable
|
||||
send_mod(); // function sends the state of all modifier keys over usb including the one that just got pressed
|
||||
old_key[x][y] = LOW; // Save state of key as "pressed"
|
||||
}
|
||||
else {
|
||||
Fn_pressed = LOW; // Fn status variable is active low
|
||||
old_key[x][y] = LOW; // old_key state is "pressed" (active low)
|
||||
}
|
||||
}
|
||||
else if (read_key(y) && (!old_key[x][y])) { //check if key is not pressed and was previously pressed
|
||||
if (modifier[x][y] != MODIFIERKEY_FN) { // Exclude Fn modifier key
|
||||
clear_mod(modifier[x][y]); // function reads which modifier key was released and loads 0 into the appropriate mod_... variable
|
||||
send_mod(); // function sends all mod's over usb including the one that just released
|
||||
old_key[x][y] = HIGH; // Save state of key as "not pressed"
|
||||
}
|
||||
else {
|
||||
Fn_pressed = HIGH; // Fn is no longer active
|
||||
old_key[x][y] = HIGH; // old_key state is "not pressed"
|
||||
}
|
||||
}
|
||||
}
|
||||
// ***********end of modifier section
|
||||
//
|
||||
// ***********Normal keys and media keys in this section
|
||||
else if ((normal[x][y] != 0) || (media[x][y] != 0)) { // check if normal or media key exists at this location in the array
|
||||
if (!read_key(y) && (old_key[x][y]) && (!slots_full)) { // check if key is pressed and was not previously pressed and slots not full
|
||||
old_key[x][y] = LOW; // Save state of key as "pressed"
|
||||
if (Fn_pressed) { // Fn_pressed is active low so it is not pressed and normal key needs to be sent
|
||||
load_slot(normal[x][y]); //update first available slot with normal key name
|
||||
send_normals(); // send all slots over USB including the key that just got pressed
|
||||
}
|
||||
else if (media[x][y] != 0) { // Fn is pressed so send media if a key exists in the matrix
|
||||
Keyboard.press(media[x][y]); // media key is sent using keyboard press function per PJRC
|
||||
//delay(5); // delay 5 milliseconds before releasing to make sure it gets sent over USB
|
||||
delayMicroseconds(300);
|
||||
Keyboard.release(media[x][y]); // send media key release
|
||||
}
|
||||
}
|
||||
else if (read_key(y) && (!old_key[x][y])) { //check if key is not pressed, but was previously pressed
|
||||
old_key[x][y] = HIGH; // Save state of key as "not pressed"
|
||||
if (Fn_pressed) { // Fn is not pressed
|
||||
clear_slot(normal[x][y]); //clear the slot that contains the normal key name
|
||||
send_normals(); // send all slots over USB including the key that was just released
|
||||
}
|
||||
}
|
||||
}
|
||||
// **************end of normal and media key section
|
||||
//
|
||||
}
|
||||
go_z(Row_IO[x]); // De-activate Row (send it to hi-z)
|
||||
}
|
||||
//
|
||||
// **********keyboard scan complete
|
||||
//
|
||||
// Turn on the LED on the Teensy for Caps Lock based on bit 1 in the keyboard_leds variable controlled by the USB host computer
|
||||
//
|
||||
if (keyboard_leds & 1<<1) { // mask off all bits but D1 and test if set
|
||||
go_1(CAPS_LED); // turn on the LED
|
||||
}
|
||||
else {
|
||||
go_0(CAPS_LED); // turn off the LED
|
||||
}
|
||||
//
|
||||
delay(5); // The overall keyboard scanning rate
|
||||
}
|
Loading…
Reference in a new issue