text:
3" y1="-3" x2="-3" y2="3" width="0.127" layer="21"/>
</package>
</packages>
<symbols>
<symbol name="MKL02Z32VFK4">
<pin name="VDD_VREFH" x="-55.88" y="17.78" length="middle" direction="pwr"/>
<pin name="PTA0/IRQ_0/SWD_CLK" x="-55.88" y="12.7" length="middle"/>
<pin name="PTA1/IRQ_1/LPTMR0_ALT1/RESET_B" x="-55.88" y="10.16" length="middle"/>
<pin name="PTA2/SWD_DIO" x="-55.88" y="7.62" length="middle"/>
<pin name="PTA3/EXTAL0/I2C0_SCL/I2C1_SDA" x="-55.88" y="5.08" length="middle"/>
<pin name="PTA4/XTAL0/I2C0_SDA/I2C1_SCL" x="-55.88" y="2.54" length="middle"/>
<pin name="PTA5/SPI0_SS_B" x="-55.88" y="0" length="middle"/>
<pin name="PTA6/SPI0_MISO" x="-55.88" y="-2.54" length="middle"/>
<pin name="PTA7/IRQ_4/SPI0_MOSI/SPI0_MISO" x="-55.88" y="-5.08" length="middle"/>
<pin name="PTA8/I2C1_SCL" x="-55.88" y="-7.62" length="middle"/>
<pin name="PTA9/I2C1_SDA" x="-55.88" y="-10.16" length="middle"/>
<pin name="PTA12/IRQ_13/LPTMR0_ALT2" x="-55.88" y="-12.7" length="middle"/>
<pin name="E_PAD" x="-55.88" y="-17.78" length="middle" direction="pas"/>
<pin name="VREFL_VSS" x="-55.88" y="-22.86" length="middle" direction="pas"/>
<pin name="PTB0/IRQ_5/SPI0_SCK" x="55.88" y="17.78" length="middle" rot="R180"/>
<pin name="PTB1/IRQ_6/UART0_RX/UART0_TX" x="55.88" y="15.24" length="middle" rot="R180"/>
<pin name="PTB2/IRQ_7/UART0_TX/UART0_RX" x="55.88" y="12.7" length="middle" rot="R180"/>
<pin name="PTB3/IRQ_10/I2C0_SCL/UART0_TX" x="55.88" y="10.16" length="middle" rot="R180"/>
<pin name="PTB4/IRQ_11/I2C0_SDA/UART0_RX" x="55.88" y="7.62" length="middle" rot="R180"/>
<pin name="PTB5/IRQ_12/NMI_B" x="55.88" y="5.08" length="middle" rot="R180"/>
<pin name="PTB6/IRQ_2/LPTMR0_ALT3" x="55.88" y="2.54" length="middle" rot="R180"/>
<pin name="PTB7/IRQ_3" x="55.88" y="0" length="middle" rot="R180"/>
<pin name="PTB10" x="55.88" y="-2.54" length="middle" rot="R180"/>
<pin name="PTB11" x="55.88" y="-5.08" length="middle" rot="R180"/>
<pin name="PTB13" x="55.88" y="-7.62" length="middle" rot="R180"/>
<wire x1="-50.8" y1="22.86" x2="-50.8" y2="-27.94" width="0.4064" layer="94"/>
<wire x1="-50.8" y1="-27.94" x2="50.8" y2="-27.94" width="0.4064" layer="94"/>
<wire x1="50.8" y1="-27.94" x2="50.8" y2="22.86" width="0.4064" layer="94"/>
<wire x1="50.8" y1="22.86" x2="-50.8" y2="22.86" width="0.4064" layer="94"/>
<text x="-5.5118" y="25.5524" size="2.0828" layer="95" ratio="10" rot="SR0">>NAME</text>
<text x="-5.8674" y="-32.4612" size="2.0828" layer="96" ratio="10" rot="SR0">>VALUE</text>
<text x="-11.43" y="-5.08" size="1.27" layer="94" align="center-left">ADC-7</text>
<text x="24.13" y="17.78" size="1.27" layer="94" rot="R180" align="center-left">ADC-6</text>
<text x="11.43" y="15.24" size="1.27" layer="94" rot="R180" align="center-left">ADC-5</text>
<text x="11.43" y="12.7" size="1.27" layer="94" rot="R180" align="center-left">ADC-4</text>
<text x="-31.75" y="-7.62" size="1.27" layer="94" align="center-left">ADC-3</text>
<text x="-31.75" y="-10.16" size="1.27" layer="94" align="center-left">ADC-2</text>
<text x="26.67" y="5.08" size="1.27" layer="94" rot="R180" align="center-left">ADC-1</text>
<text x="-16.51" y="-12.7" size="1.27" layer="94" align="center-left">ADC-0</text>
<text x="-24.13" y="12.7" size="1.27" layer="94" align="center-left">ADC-12</text>
<text x="40.64" y="-7.62" size="1.27" layer="94" rot="R180" align="center-left">ADC-13</text>
<text x="40.64" y="-2.54" size="1.27" layer="94" rot="R180" align="center-left">ADC-9</text>
<text x="40.64" y="-5.08" size="1.27" layer="94" rot="R180" align="center-left">ADC-8</text>
<text x="12.7" y="10.16" size="1.27" layer="94" rot="R180" align="center-left">OPENDRAIN</text>
<text x="12.7" y="7.62" size="1.27" layer="94" rot="R180" align="center-left">OPENDRAIN</text>
<text x="-29.21" y="0" size="1.27" layer="94" align="center-left">PWM0-1</text>
<text x="-29.21" y="-2.54" size="1.27" layer="94" align="center-left">PWM0-0</text>
<text x="26.67" y="-5.08" size="1.27" layer="94" align="center-left">PWM0-0</text>
<text x="26.67" y="-2.54" size="1.27" layer="94" align="center-left">PWM0-1</text>
<text x="19.05" y="2.54" size="1.27" layer="94" rot="R180" align="center-left">PWM1-1</text>
<text x="34.29" y="0" size="1.27" layer="94" rot="R180" align="center-left">PWM1-0</text>
<text x="19.05" y="5.08" size="1.27" layer="94" rot="R180" align="center-left">PWM1-1</text>
<text x="-8.89" y="-12.7" size="1.27" layer="94" align="center-left">PWM1-0</text>
<text x="-15.24" y="12.7" size="1.27" layer="94" align="center-left">PWM1-0</text>
<text x="33.02" y="-7.62" size="1.27" layer="94" rot="R180" align="center-left">PWM1-1</text>
</symbol>
</symbols>
<devicesets>
<deviceset name="MKL02Z32VFK4" prefix="U">
<description>IC, MCU, 32BIT, CORTEX M0+, 48MHZ, QFN-24</description>
<gates>
<gate name="A" symbol="MKL02Z32VFK4" x="0" y="0"/>
</gates>
<devices>
<device name="" package="QFN50P400X400X100-25N">
<connects>
<connect gate="A" pin="E_PAD" pad="25"/>
<connect gate="A" pin="PTA0/IRQ_0/SWD_CLK" pad="22"/>
<connect gate="A" pin="PTA1/IRQ_1/LPTMR0_ALT1/RESET_B" pad="23"/>
<connect gate="A" pin="PTA12/IRQ_13/LPTMR0_ALT2" pad="20"/>
<connect gate="A" pin="PTA2/SWD_DIO" pad="24"/>
<connect gate="A" pin="PTA3/EXTAL0/I2C0_SCL/I2C1_SDA" pad="5"/>
<connect gate="A" pin="PTA4/XTAL0/I2C0_SDA/I2C1_SCL" pad="6"/>
<connect gate="A" pin="PTA5/SPI0_SS_B" pad="7"/>
<connect gate="A" pin="PTA6/SPI0_MISO" pad="8"/>
<connect gate="A" pin="PTA7/IRQ_4/SPI0_MOSI/SPI0_MISO" pad="11"/>
<connect gate="A" pin="PTA8/I2C1_SCL" pad="15"/>
<connect gate="A" pin="PTA9/I2C1_SDA" pad="16"/>
<connect gate="A" pin="PTB0/IRQ_5/SPI0_SCK" pad="12"/>
<connect gate="A" pin="PTB1/IRQ_6/UART0_RX/UART0_TX" pad="13"/>
<connect gate="A" pin="PTB10" pad="9"/>
<connect gate="A" pin="PTB11" pad="10"/>
<connect gate="A" pin="PTB13" pad="21"/>
<connect gate="A" pin="PTB2/IRQ_7/UART0_TX/UART0_RX" pad="14"/>
<connect gate="A" pin="PTB3/IRQ_10/I2C0_SCL/UART0_TX" pad="17"/>
<connect gate="A" pin="PTB4/IRQ_11/I2C0_SDA/UART0_RX" pad="18"/>
<connect gate="A" pin="PTB5/IRQ_12/NMI_B" pad="19"/>
<connect gate="A" pin="PTB6/IRQ_2/LPTMR0_ALT3" pad="1"/>
<connect gate="A" pin="PTB7/IRQ_3" pad="2"/>
<connect gate="A" pin="VDD_VREFH" pad="3"/>
<connect gate="A" pin="VREFL_VSS" pad="4"/>
</connects>
<technologies>
<technology name="">
<attribute name="MPN" value="MKL02Z32VFK4" constant="no"/>
<attribute name="OC_FARNELL" value="2321481" constant="no"/>
<attribute name="OC_NEWARK" value="61W9887" constant="no"/>
<attribute name="PACKAGE" value="QFN-24" constant="no"/>
<attribute name="SUPPLIER" value="FREESCALE SEMICONDUCTOR" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
<library name="zephod-components">
<packages>
<package name="4P-6.0X6.0X5.0H">
<wire x1="-3" y1="3" x2="3" y2="3" width="0.127" layer="21"/>
<wire x1="3" y1="3" x2="3" y2="-3" width="0.127" layer="21"/>
<wire x1="3" y1="-3" x2="-3" y2="-3" width="0.127" layer="21"/>
<wire x1="-3" y1="-3" x2="-3" y2="3" width="0.127" layer="21"/>
<pad name="1" x="-3.937" y="2.159" drill="1.016" diameter="1.651" shape="square"/>
<pad name="2" x="-3.937" y="-2.159" drill="1.016" diameter="1.651"/>
<pad name="3" x="3.937" y="-2.159" drill="1.016" diameter="1.651"/>
<pad name="4" x="3.937" y="2.159" drill="1.016" diameter="1.651"/>
<rectangle x1="-3" y1="-3" x2="3" y2="3" layer="39"/>
<text x="-1.905" y="3.175" size="0.889" layer="25" ratio="11">>NAME</text>
<text x="-1.905" y="0" size="0.635" layer="27" ratio="10">>VALUE</text>
</package>
<package name="4P-SMD-6.0X6.0X5.0H">
<wire x1="-3.048" y1="3.048" x2="3.048" y2="3.048" width="0.127" layer="21"/>
<wire x1="3.048" y1="3.048" x2="3.048" y2="-3.048" width="0.127" layer="21"/>
<wire x1="3.048" y1="-3.048" x2="-3.048" y2="-3.048" width="0.127" layer="21"/>
<wire x1="-3.048" y1="-3.048" x2="-3.048" y2="3.048" width="0.127" layer="21"/>
<smd name="1" x="-4.129" y="2.159" dx="2.54" dy="1.27" layer="1"/>
<smd name="2" x="-4.129" y="-2.159" dx="2.54" dy="1.27" layer="1"/>
<smd name="3" x="4.129" y="-2.159" dx="2.54" dy="1.27" layer="1"/>
<smd name="4" x="4.129" y="2.159" dx="2.54" dy="1.27" layer="1"/>
<text x="-1.905" y="3.175" size="0.889" layer="25" ratio="11">>NAME</text>
<text x="-1.905" y="0" size="0.635" layer="27" ratio="10">>VALUE</text>
<rectangle x1="-3.048" y1="-3.048" x2="3.048" y2="3.048" layer="39"/>
<circle x="0" y="0" radius="1.875" width="0.127" layer="255"/>
</package>
</packages>
<symbols>
<symbol name="BOTTON-4P">
<wire x1="-5.08" y1="5.08" x2="5.08" y2="5.08" width="0.254" layer="94"/>
<wire x1="5.08" y1="5.08" x2="5.08" y2="2.54" width="0.254" layer="94"/>
<wire x1="5.08" y1="2.54" x2="5.08" y2="-2.54" width="0.254" layer="94"/>
<wire x1="5.08" y1="-2.54" x2="5.08" y2="-5.08" width="0.254" layer="94"/>
<wire x1="5.08" y1="-5.08" x2="-5.08" y2="-5.08" width="0.254" layer="94"/>
<text x="-5.08" y="5.08" size="1.27" layer="95" ratio="10">>NAME</text>
<text x="0" y="5.08" size="1.27" layer="96" ratio="10">>VALUE</text>
<pin name="A0" x="-8.89" y="2.54" length="short"/>
<pin name="A1" x="8.89" y="2.54" length="short" rot="R180"/>
<pin name="B0" x="-8.89" y="-2.54" length="short"/>
<pin name="B1" x="8.89" y="-2.54" length="short" rot="R180"/>
<wire x1="-5.08" y1="-5.08" x2="-5.08" y2="-2.54" width="0.254" layer="94"/>
<wire x1="-5.08" y1="-2.54" x2="-5.08" y2="2.54" width="0.254" layer="94"/>
<wire x1="-5.08" y1="2.54" x2="-5.08" y2="5.08" width="0.254" layer="94"/>
<wire x1="-5.08" y1="2.54" x2="0" y2="2.54" width="0.1524" layer="94"/>
<wire x1="0" y1="2.54" x2="5.08" y2="2.54" width="0.1524" layer="94"/>
<wire x1="0" y1="2.54" x2="0" y2="1.27" width="0.1524" layer="94"/>
<wire x1="0" y1="1.27" x2="-1.27" y2="-0.762" width="0.1524" layer="94"/>
<wire x1="0" y1="-1.27" x2="0" y2="-2.54" width="0.1524" layer="94"/>
<wire x1="0" y1="-2.54" x2="5.08" y2="-2.54" width="0.1524" layer="94"/>
<wire x1="0" y1="-2.54" x2="-5.08" y2="-2.54" width="0.1524" layer="94"/>
<wire x1="-6.35" y1="2.54" x2="-5.08" y2="2.54" width="0.1524" layer="94"/>
<wire x1="-6.35" y1="-2.54" x2="-5.08" y2="-2.54" width="0.1524" layer="94"/>
<wire x1="6.35" y1="-2.54" x2="5.08" y2="-2.54" width="0.1524" layer="94"/>
<wire x1="6.35" y1="2.54" x2="5.08" y2="2.54" width="0.1524" layer="94"/>
<circle x="-1.27" y="-0.762" radius="0.254" width="0" layer="94"/>
<circle x="0" y="-1.27" radius="0.254" width="0" layer="94"/>
</symbol>
</symbols>
<devicesets>
<deviceset name="BUTTON-4P" prefix="K">
<gates>
<gate name="K" symbol="BOTTON-4P" x="0" y="0"/>
</gates>
<devices>
<device name="-3110040P1" package="4P-6.0X6.0X5.0H">
<connects>
<connect gate="K" pin="A0" pad="1"/>
<connect gate="K" pin="A1" pad="4"/>
<connect gate="K" pin="B0" pad="2"/>
<connect gate="K" pin="B1" pad="3"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="-3100010P1" package="4P-SMD-6.0X6.0X5.0H">
<connects>
<connect gate="K" pin="A0" pad="1"/>
<connect gate="K" pin="A1" pad="4"/>
<connect gate="K" pin="B0" pad="2"/>
<connect gate="K" pin="B1" pad="3"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
<library name="SparkFun-Connectors">
<description>
SparkFun Electronics' preferred foot prints

In this library you'll find connectors and sockets- basically anything that can be plugged into or onto.

We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com.

Licensing: CC v3.0 Share-Alike 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_LONGPAD">
<wire x1="-1.27" y1="0.635" x2="-1.27" y2="-0.635" width="0.2032" layer="21"/>
<wire x1="1.27" y1="0.635" x2="1.27" y2="-0.635" width="0.2032" layer="21"/>
<pad name="1" x="0" y="0" drill="1.1176" diameter="1.8796" shape="long" rot="R90"/>
<text x="-1.3462" y="1.8288" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-1.27" y="-3.175" size="1.27" layer="27">>VALUE</text>
<rectangle x1="-0.254" y1="-0.254" x2="0.254" y2="0.254" layer="51"/>
</package>
<package name="LUXEON-PAD">
<smd name="P$1" x="0" y="0" dx="3.9" dy="2.4" layer="1" roundness="25"/>
<text x="-1.5" y="2" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-1.5" y="-3" size="1.27" layer="27">>VALUE</text>
</package>
<package name="SMTSO-256-ET">
<wire x1="-2.286" y1="1.016" x2="-1.016" y2="2.286" width="1.016" layer="31" curve="-42.075022"/>
<wire x1="1.016" y1="2.286" x2="2.286" y2="1.016" width="1.016" layer="31" curve="-42.075022"/>
<wire x1="2.286" y1="-1.016" x2="1.016" y2="-2.286" width="1.016" layer="31" curve="-42.075022"/>
<wire x1="-1.016" y1="-2.286" x2="-2.286" y2="-1.016" width="1.016" layer="31" curve="-42.075022"/>
<circle x="0" y="0" radius="1.016" width="0.127" layer="51"/>
<pad name="P$1" x="0" y="0" drill="3.81" diameter="6.1976"/>
</package>
<package name="SMTRA-256-8-6">
<pad name="P$1" x="-1.9939" y="0" drill="1.3462"/>
<pad name="P$2" x="1.9939" y="0" drill="1.3462"/>
<smd name="P$3" x="0" y="0" dx="6.6548" dy="4.3434" layer="1" cream="no"/>
<text x="1.27" y="2.54" size="0.4064" layer="27">>Value</text>
<text x="-2.54" y="2.54" size="0.4064" layer="25">>Name</text>
<rectangle x1="-3.302" y1="0.762" x2="3.302" y2="2.032" layer="31"/>
<rectangle x1="-1.016" y1="0.508" x2="1.016" y2="0.762" layer="31"/>
<rectangle x1="-1.016" y1="-1.016" x2="1.016" y2="-0.762" layer="31"/>
<rectangle x1="-3.302" y1="-2.032" x2="3.302" y2="-0.762" layer="31"/>
<rectangle x1="-1.016" y1="-0.762" x2="1.016" y2="-0.508" layer="31"/>
<rectangle x1="2.794" y1="0.508" x2="3.302" y2="0.762" layer="31"/>
<rectangle x1="2.794" y1="-0.762" x2="3.302" y2="-0.508" layer="31"/>
<rectangle x1="-3.302" y1="-0.762" x2="-2.794" y2="-0.508" layer="31"/>
<rectangle x1="-3.302" y1="0.508" x2="-2.794" y2="0.762" layer="31"/>
</package>
<package name="1X01NS">
<pad name="1" x="0" y="0" drill="1.016" diameter="1.8796" rot="R90"/>
</package>
<package name="1X01">
<wire x1="1.27" y1="0.635" x2="0.635" y2="1.27" width="0.2032" layer="21"/>
<wire x1="0.635" y1="1.27" x2="-0.635" y2="1.27" width="0.2032" layer="21"/>
<wire x1="-0.635" y1="1.27" x2="-1.27" y2="0.635" width="0.2032" layer="21"/>
<wire x1="-1.27" y1="0.635" x2="-1.27" y2="-0.635" width="0.2032" layer="21"/>
<wire x1="-1.27" y1="-0.635" x2="-0.635" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="-0.635" y1="-1.27" x2="0.635" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="0.635" y1="-1.27" x2="1.27" y2="-0.635" width="0.2032" layer="21"/>
<wire x1="1.27" y1="-0.635" x2="1.27" y2="0.635" width="0.2032" layer="21"/>
<pad name="1" x="0" y="0" drill="1.016" diameter="1.8796" rot="R90"/>
<text x="-1.3462" y="1.8288" size="0.508" layer="25">>NAME</text>
<rectangle x1="-0.254" y1="-0.254" x2="0.254" y2="0.254" layer="51"/>
</package>
<package name="1X01_2MM">
<pad name="1" x="0" y="0" drill="2" diameter="3.302" rot="R90"/>
<text x="-1.3462" y="1.8288" size="1.27" layer="25">>NAME</text>
<text x="-1.27" y="-3.175" size="1.27" layer="27">>VALUE</text>
</package>
<package name="1X01_OFFSET">
<wire x1="-1.27" y1="0.635" x2="-1.27" y2="-0.635" width="0.2032" layer="21"/>
<wire x1="-1.27" y1="-0.635" x2="-0.635" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="-0.635" y1="-1.27" x2="0.635" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="0.635" y1="-1.27" x2="1.27" y2="-0.635" width="0.2032" layer="21"/>
<wire x1="1.27" y1="-0.635" x2="1.27" y2="0.635" width="0.2032" layer="21"/>
<pad name="1" x="0" y="0" drill="1.1176" diameter="1.8796" shape="offset" rot="R90"/>
<text x="1.1938" y="1.8288" size="1.27" layer="25">>NAME</text>
<text x="-1.27" y="-3.175" size="1.27" layer="27">>VALUE</text>
<rectangle x1="-0.254" y1="-0.254" x2="0.254" y2="0.254" layer="51"/>
</package>
<package name="PAD-1.5X4.5">
<smd name="P$1" x="0" y="0" dx="1.5" dy="2" layer="1"/>
</package>
<package name="1X01_POGOPIN_HOLE_LARGE">
<circle x="0" y="0" radius="0.635" width="0.127" layer="51"/>
<pad name="1" x="0" y="0" drill="0.9" diameter="0.8128" rot="R90" thermals="no"/>
<hole x="0" y="0" drill="1.5494"/>
</package>
<package name="1X01_POGOPIN_HOLE_0.58">
<circle x="0" y="0" radius="0.635" width="0.127" layer="51"/>
<pad name="1" x="0" y="0" drill="0.9" diameter="0.8128" rot="R90" thermals="no"/>
<hole x="0" y="0" drill="1.4732"/>
</package>
<package name="SNAP-FEMALE">
<pad name="1" x="0" y="0" drill="2.921" diameter="4.572"/>
<polygon width="0.254" layer="1">
<vertex x="-4.0005" y="0" curve="-89.997136"/>
<vertex x="0" y="4.0005" curve="-90.002865"/>
<vertex x="4.0005" y="0" curve="-89.997136"/>
<vertex x="0" y="-4.0005" curve="-89.997136"/>
</polygon>
<polygon width="0.3556" layer="29">
<vertex x="-4.0005" y="0" curve="-90.002865"/>
<vertex x="0" y="4.0005" curve="-90.002865"/>
<vertex x="4.0005" y="0" curve="-89.997136"/>
<vertex x="0" y="-4.0005" curve="-89.997136"/>
</polygon>
<polygon width="0.3556" layer="31">
<vertex x="-4.0005" y="0" curve="-89.997136"/>
<vertex x="0" y="4.0005" curve="-90.002865"/>
<vertex x="4.0005" y="0" curve="-89.997136"/>
<vertex x="0" y="-4.0005" curve="-89.997136"/>
</polygon>
<polygon width="0.3556" layer="41">
<vertex x="-4.0005" y="0" curve="-89.997136"/>
<vertex x="0" y="4.0005" curve="-90.002865"/>
<vertex x="4.0005" y="0" curve="-89.997136"/>
<vertex x="0" y="-4.0005" curve="-89.997136"/>
</polygon>
</package>
<package name="SNAP-MALE">
<smd name="2" x="0" y="0" dx="7.62" dy="7.62" layer="1" roundness="100"/>
</package>
<package name="SPRING-CONNECTOR">
<smd name="P$2" x="0" y="0" dx="7.112" dy="7.112" layer="1" roundness="100"/>
<text x="-1.3462" y="5.6388" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-1.27" y="-5.715" size="1.27" layer="27">>VALUE</text>
</package>
</packages>
<symbols>
<symbol name="M01">
<wire x1="3.81" y1="-2.54" x2="-2.54" y2="-2.54" width="0.4064" layer="94"/>
<wire x1="1.27" y1="0" x2="2.54" y2="0" width="0.6096" layer="94"/>
<wire x1="-2.54" y1="2.54" x2="-2.54" y2="-2.54" width="0.4064" layer="94"/>
<wire x1="3.81" y1="-2.54" x2="3.81" y2="2.54" width="0.4064" layer="94"/>
<wire x1="-2.54" y1="2.54" x2="3.81" y2="2.54" width="0.4064" layer="94"/>
<text x="-2.54" y="-5.08" size="1.778" layer="96">>VALUE</text>
<text x="-2.54" y="3.302" size="1.778" layer="95">>NAME</text>
<pin name="1" x="7.62" y="0" visible="off" length="middle" direction="pas" swaplevel="1" rot="R180"/>
</symbol>
</symbols>
<devicesets>
<deviceset name="M01" prefix="JP">
<description>Header 1
Standard 1-pin 0.1" header. Use with straight break away headers (SKU : PRT-00116), right angle break away headers (PRT-00553), swiss pins (PRT-00743), machine pins (PRT-00117), and female headers (PRT-00115).</description>
<gates>
<gate name="G$1" symbol="M01" x="0" y="0"/>
</gates>
<devices>
<device name="PTH_LONGPAD" package="1X01_LONGPAD">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SMD" package="LUXEON-PAD">
<connects>
<connect gate="G$1" pin="1" pad="P$1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="-SMTSO-256-ET" package="SMTSO-256-ET">
<connects>
<connect gate="G$1" pin="1" pad="P$1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SMTRA-256-8-6" package="SMTRA-256-8-6">
<connects>
<connect gate="G$1" pin="1" pad="P$1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SMDNS" package="1X01NS">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="PTH" package="1X01">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="PTH_2MM" package="1X01_2MM">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="OFFSET" package="1X01_OFFSET">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SMD-4.5X1.5" package="PAD-1.5X4.5">
<connects>
<connect gate="G$1" pin="1" pad="P$1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="POGOPIN_HOLE_LARGE" package="1X01_POGOPIN_HOLE_LARGE">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="POGOPIN_HOLE_0.58" package="1X01_POGOPIN_HOLE_0.58">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SNAP-FEMALE" package="SNAP-FEMALE">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SNAP-MALE" package="SNAP-MALE">
<connects>
<connect gate="G$1" pin="1" pad="2"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SPRING-CONN" package="SPRING-CONNECTOR">
<connects>
<connect gate="G$1" pin="1" pad="P$2"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
<clearance class="0" value="0.1778"/>
</class>
<class number="1" name="GND" width="0.2032" drill="0.2032">
<clearance class="1" value="0.2032"/>
</class>
</classes>
<parts>
<part name="U$1" library="EurorackModularParts" deviceset="EURORACK_PCB" device="6HP" value="EURORACK_PCB6HP"/>
<part name="U$2" library="EurorackModularParts" deviceset="POWER" device=""/>
<part name="U$3" library="EurorackModularParts" deviceset="AUDIO-JACK" device="INPUT" value="PJ-341">
<attribute name="DESC" value="PlayPause"/>
</part>
<part name="U$4" library="EurorackModularParts" deviceset="AUDIO-JACK" device="OUTPUT" value="PJ-341">
<attribute name="DESC" value="CLOCK1"/>
</part>
<part name="U$5" library="EurorackModularParts" deviceset="AUDIO-JACK" device="OUTPUT" value="PJ-341">
<attribute name="DESC" value="CLOCK2"/>
</part>
<part name="U$6" library="EurorackModularParts" deviceset="AUDIO-JACK" device="OUTPUT" value="PJ-341">
<attribute name="DESC" value="CLOCK3"/>
</part>
<part name="U$7" library="EurorackModularParts" deviceset="AUDIO-JACK" device="OUTPUT" value="PJ-341">
<attribute name="DESC" value="CLOCK4"/>
</part>
<part name="U$8" library="EurorackModularParts" deviceset="POT" device="ZEPHPOT">
<attribute name="DESC" value="Tempo"/>
</part>
<part name="U$9" library="zephod-tft" deviceset="0.49"OLED" device="FOLDED" value="0.49"OLEDFOLDED"/>
<part name="C1" library="OPL" deviceset="C*" device="-0603" value="2.2uF"/>
<part name="C2" library="OPL" deviceset="C*" device="-0603" value="4.7uF"/>
<part name="C3" library="OPL" deviceset="C*" device="-0603" value="1uF"/>
<part name="C4" library="OPL" deviceset="C*" device="-0603" value="1uF"/>
<part name="C5" library="OPL" deviceset="C*" device="-0603" value="1uF"/>
<part name="C6" library="OPL" deviceset="C*" device="-0603" value="1uF"/>
<part name="R3" library="OPL" deviceset="R*" device="-0603" value="390K"/>
<part name="GND1" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND2" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="SUPPLY3" library="SparkFun-Aesthetics" deviceset="3.3V" device=""/>
<part name="SUPPLY4" library="SparkFun-Aesthetics" deviceset="3.3V" device=""/>
<part name="U1" library="FarnellThings" deviceset="MKL02Z32VFK4" device=""/>
<part name="SUPPLY6" library="SparkFun-Aesthetics" deviceset="3.3V" device=""/>
<part name="R4" library="OPL" deviceset="R*" device="-0603" value="2K"/>
<part name="R5" library="OPL" deviceset="R*" device="-0603" value="2K"/>
<part name="SUPPLY7" library="SparkFun-Aesthetics" deviceset="3.3V" device=""/>
<part name="SUPPLY8" library="SparkFun-Aesthetics" deviceset="3.3V" device=""/>
<part name="GND6" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="C9" library="OPL" deviceset="C*" device="-0603" value="1uF"/>
<part name="C10" library="OPL" deviceset="C*" device="-0603" value="100nF"/>
<part name="SUPPLY11" library="SparkFun-Aesthetics" deviceset="3.3V" device=""/>
<part name="GND10" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="K1" library="zephod-components" deviceset="BUTTON-4P" device="-3110040P1" value="BUTTON-4P-3110040P1"/>
<part name="K2" library="zephod-components" deviceset="BUTTON-4P" device="-3110040P1" value="BUTTON-4P-3110040P1"/>
<part name="K3" library="zephod-components" deviceset="BUTTON-4P" device="-3110040P1" value="BUTTON-4P-3110040P1"/>
<part name="K4" library="zephod-components" deviceset="BUTTON-4P" device="-3110040P1" value="BUTTON-4P-3110040P1"/>
<part name="GND3" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND19" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND20" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND21" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND22" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND23" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND24" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND25" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="PTA6_MISO1" library="SparkFun-Connectors" deviceset="M01" device="SMD-4.5X1.5"/>
<part name="PTA6_MISO2" library="SparkFun-Connectors" deviceset="M01" device="SMD-4.5X1.5"/>
<part name="PTA6_MISO3" library="SparkFun-Connectors" deviceset="M01" device="SMD-4.5X1.5"/>
<part name="PTA6_MISO4" library="SparkFun-Connectors" deviceset="M01" device="SMD-4.5X1.5"/>
<part name="PTA6_MISO5" library="SparkFun-Connectors" deviceset="M01" device="SMD-4.5X1.5"/>
<part name="SUPPLY1" library="SparkFun-Aesthetics" deviceset="3.3V" device=""/>
<part name="SUPPLY2" library="SparkFun-Aesthetics" deviceset="3.3V" device=""/>
<part name="GND5" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="K5" library="zephod-components" deviceset="BUTTON-4P" device="-3110040P1" value="BUTTON-4P-3110040P1"/>
<part name="GND4" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND7" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
</parts>
<sheets>
<sheet>
<plain>
</plain>
<instances>
<instance part="U$1" gate="G$1" x="22.86" y="68.58"/>
<instance part="U$2" gate="G$1" x="22.86" y="27.94"/>
<instance part="U$3" gate="G$1" x="-25.4" y="116.84"/>
<instance part="U$4" gate="G$1" x="127" y="-40.64"/>
<instance part="U$5" gate="G$1" x="127" y="-68.58"/>
<instance part="U$6" gate="G$1" x="127" y="-99.06"/>
<instance part="U$7" gate="G$1" x="127" y="-127"/>
<instance part="U$8" gate="G$1" x="73.66" y="127"/>
<instance part="U$9" gate="G$1" x="260.35" y="54.61"/>
<instance part="C1" gate="C" x="236.22" y="31.75" rot="R180"/>
<instance part="C2" gate="C" x="236.22" y="36.83"/>
<instance part="C3" gate="C" x="247.65" y="64.77" rot="R180"/>
<instance part="C4" gate="C" x="247.65" y="59.69" rot="R180"/>
<instance part="C5" gate="C" x="232.41" y="58.42" rot="R90"/>
<instance part="C6" gate="C" x="232.41" y="50.8" rot="R270"/>
<instance part="R3" gate="R" x="236.22" y="39.37"/>
<instance part="GND1" gate="1" x="229.87" y="54.61" rot="R270"/>
<instance part="GND2" gate="1" x="223.52" y="34.29"/>
<instance part="SUPPLY3" gate="G$1" x="232.41" y="62.23" rot="R90"/>
<instance part="SUPPLY4" gate="G$1" x="232.41" y="46.99" rot="R90"/>
<instance part="U1" gate="A" x="350.52" y="160.02"/>
<instance part="SUPPLY6" gate="G$1" x="265.43" y="182.88"/>
<instance part="R4" gate="R" x="430.53" y="184.15" rot="R90"/>
<instance part="R5" gate="R" x="435.61" y="184.15" rot="R90"/>
<instance part="SUPPLY7" gate="G$1" x="435.61" y="190.5"/>
<instance part="SUPPLY8" gate="G$1" x="430.53" y="190.5"/>
<instance part="GND6" gate="1" x="292.1" y="142.24" rot="R270"/>
<instance part="C9" gate="C" x="250.19" y="143.51" rot="R90"/>
<instance part="C10" gate="C" x="246.38" y="143.51" rot="R90"/>
<instance part="SUPPLY11" gate="G$1" x="246.38" y="147.32"/>
<instance part="GND10" gate="1" x="246.38" y="137.16"/>
<instance part="K1" gate="K" x="335.28" y="109.22" smashed="yes">
<attribute name="NAME" x="330.2" y="114.3" size="1.27" layer="95" ratio="10"/>
</instance>
<instance part="K2" gate="K" x="388.62" y="109.22" smashed="yes">
<attribute name="NAME" x="383.54" y="114.3" size="1.27" layer="95" ratio="10"/>
</instance>
<instance part="K3" gate="K" x="335.28" y="87.63" smashed="yes">
<attribute name="NAME" x="330.2" y="92.71" size="1.27" layer="95" ratio="10"/>
</instance>
<instance part="K4" gate="K" x="388.62" y="87.63" smashed="yes">
<attribute name="NAME" x="383.54" y="92.71" size="1.27" layer="95" ratio="10"/>
</instance>
<instance part="GND3" gate="1" x="344.17" y="81.28"/>
<instance part="GND19" gate="1" x="344.17" y="104.14" smashed="yes">
<attribute name="VALUE" x="341.63" y="101.6" size="1.778" layer="96"/>
</instance>
<instance part="GND20" gate="1" x="400.05" y="104.14"/>
<instance part="GND21" gate="1" x="378.46" y="104.14"/>
<instance part="GND22" gate="1" x="378.46" y="82.55"/>
<instance part="GND23" gate="1" x="397.51" y="82.55"/>
<instance part="GND24" gate="1" x="326.39" y="81.28"/>
<instance part="GND25" gate="1" x="326.39" y="104.14" smashed="yes">
<attribute name="VALUE" x="323.85" y="101.6" size="1.778" layer="96"/>
</instance>
<instance part="PTA6_MISO1" gate="G$1" x="212.09" y="195.58" smashed="yes"/>
<instance part="PTA6_MISO2" gate="G$1" x="212.09" y="190.5" smashed="yes"/>
<instance part="PTA6_MISO3" gate="G$1" x="212.09" y="185.42" smashed="yes"/>
<instance part="PTA6_MISO4" gate="G$1" x="212.09" y="180.34" smashed="yes"/>
<instance part="PTA6_MISO5" gate="G$1" x="212.09" y="175.26" smashed="yes"/>
<instance part="SUPPLY1" gate="G$1" x="223.52" y="195.58"/>
<instance part="SUPPLY2" gate="G$1" x="219.71" y="195.58"/>
<instance part="GND5" gate="1" x="219.71" y="172.72"/>
<instance part="K5" gate="K" x="350.52" y="49.53" smashed="yes">
<attribute name="NAME" x="345.44" y="54.61" size="1.27" layer="95" ratio="10"/>
</instance>
<instance part="GND4" gate="1" x="359.41" y="43.18"/>
<instance part="GND7" gate="1" x="341.63" y="43.18"/>
</instances>
<busses>
</busses>
<nets>
<net name="N$3" class="0">
<segment>
<pinref part="U$9" gate="G$1" pin="C2P"/>
<pinref part="C3" gate="C" pin="2"/>
<wire x1="243.84" y1="64.77" x2="246.38" y2="67.31" width="0.1524" layer="91"/>
<wire x1="246.38" y1="67.31" x2="255.27" y2="67.31" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$4" class="0">
<segment>
<pinref part="U$9" gate="G$1" pin="C1P"/>
<pinref part="C4" gate="C" pin="2"/>
<wire x1="243.84" y1="59.69" x2="246.38" y2="62.23" width="0.1524" layer="91"/>
<wire x1="246.38" y1="62.23" x2="255.27" y2="62.23" width="0.1524" layer="91"/>
</segment>
</net>
<net name="GND" class="1">
<segment>
<pinref part="U$9" gate="G$1" pin="VSS(GND)"/>
<pinref part="C6" gate="C" pin="1"/>
<wire x1="232.41" y1="54.61" x2="234.95" y2="54.61" width="0.1524" layer="91"/>
<wire x1="234.95" y1="54.61" x2="237.49" y2="52.07" width="0.1524" layer="91"/>
<wire x1="237.49" y1="52.07" x2="255.27" y2="52.07" width="0.1524" layer="91"/>
<pinref part="C5" gate="C" pin="1"/>
<junction x="232.41" y="54.61"/>
<pinref part="GND1" gate="1" pin="GND"/>
<junction x="232.41" y="54.61"/>
</segment>
<segment>
<pinref part="GND2" gate="1" pin="GND"/>
<pinref part="R3" gate="R" pin="1"/>
<wire x1="232.41" y1="39.37" x2="232.41" y2="36.83" width="0.1524" layer="91"/>
<pinref part="C1" gate="C" pin="2"/>
<junction x="232.41" y="36.83"/>
<wire x1="232.41" y1="36.83" x2="223.52" y2="36.83" width="0.1524" layer="91"/>
<pinref part="C2" gate="C" pin="1"/>
<wire x1="232.41" y1="36.83" x2="232.41" y2="31.75" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U1" gate="A" pin="E_PAD"/>
<pinref part="GND6" gate="1" pin="GND"/>
</segment>
<segment>
<pinref part="C10" gate="C" pin="1"/>
<pinref part="GND10" gate="1" pin="GND"/>
<pinref part="C9" gate="C" pin="1"/>
<wire x1="250.19" y1="139.7" x2="246.38" y2="139.7" width="0.1524" layer="91"/>
<junction x="246.38" y="139.7"/>
</segment>
<segment>
<pinref part="K3" gate="K" pin="B1"/>
<pinref part="GND3" gate="1" pin="GND"/>
<wire x1="344.17" y1="85.09" x2="344.17" y2="83.82" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="K1" gate="K" pin="B1"/>
<pinref part="GND19" gate="1" pin="GND"/>
</segment>
<segment>
<pinref part="K2" gate="K" pin="B1"/>
<pinref part="GND20" gate="1" pin="GND"/>
<wire x1="397.51" y1="106.68" x2="400.05" y2="106.68" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="K2" gate="K" pin="B0"/>
<pinref part="GND21" gate="1" pin="GND"/>
<wire x1="379.73" y1="106.68" x2="378.46" y2="106.68" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="K4" gate="K" pin="B0"/>
<pinref part="GND22" gate="1" pin="GND"/>
<wire x1="379.73" y1="85.09" x2="378.46" y2="85.09" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="K4" gate="K" pin="B1"/>
<pinref part="GND23" gate="1" pin="GND"/>
</segment>
<segment>
<pinref part="K3" gate="K" pin="B0"/>
<pinref part="GND24" gate="1" pin="GND"/>
<wire x1="326.39" y1="85.09" x2="326.39" y2="83.82" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="K1" gate="K" pin="B0"/>
<pinref part="GND25" gate="1" pin="GND"/>
</segment>
<segment>
<pinref part="PTA6_MISO5" gate="G$1" pin="1"/>
<pinref part="GND5" gate="1" pin="GND"/>
</segment>
<segment>
<pinref part="K5" gate="K" pin="B1"/>
<pinref part="GND4" gate="1" pin="GND"/>
<wire x1="359.41" y1="46.99" x2="359.41" y2="45.72" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="K5" gate="K" pin="B0"/>
<pinref part="GND7" gate="1" pin="GND"/>
<wire x1="341.63" y1="46.99" x2="341.63" y2="45.72" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$9" class="0">
<segment>
<pinref part="U$9" gate="G$1" pin="IREF"/>
<pinref part="R3" gate="R" pin="2"/>
<wire x1="240.03" y1="39.37" x2="255.27" y2="39.37" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$10" class="0">
<segment>
<pinref part="U$9" gate="G$1" pin="VCCPANEL"/>
<pinref part="C1" gate="C" pin="1"/>
<wire x1="255.27" y1="34.29" x2="243.84" y2="34.29" width="0.1524" layer="91"/>
<wire x1="243.84" y1="34.29" x2="240.03" y2="31.75" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$11" class="0">
<segment>
<pinref part="U$9" gate="G$1" pin="VCOMH"/>
<pinref part="C2" gate="C" pin="2"/>
<wire x1="255.27" y1="36.83" x2="240.03" y2="36.83" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$12" class="0">
<segment>
<pinref part="U$9" gate="G$1" pin="C2N"/>
<pinref part="C3" gate="C" pin="1"/>
<wire x1="251.46" y1="64.77" x2="255.27" y2="64.77" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$13" class="0">
<segment>
<pinref part="U$9" gate="G$1" pin="C1N"/>
<pinref part="C4" gate="C" pin="1"/>
<wire x1="251.46" y1="59.69" x2="255.27" y2="59.69" width="0.1524" layer="91"/>
</segment>
</net>
<net name="3.3V" class="0">
<segment>
<pinref part="U$9" gate="G$1" pin="VBAT"/>
<pinref part="C5" gate="C" pin="2"/>
<wire x1="232.41" y1="62.23" x2="237.49" y2="62.23" width="0.1524" layer="91"/>
<wire x1="237.49" y1="62.23" x2="242.57" y2="57.15" width="0.1524" layer="91"/>
<wire x1="242.57" y1="57.15" x2="255.27" y2="57.15" width="0.1524" layer="91"/>
<pinref part="SUPPLY3" gate="G$1" pin="3.3V"/>
<junction x="232.41" y="62.23"/>
</segment>
<segment>
<pinref part="U$9" gate="G$1" pin="VDDLOGIC"/>
<pinref part="C6" gate="C" pin="2"/>
<wire x1="232.41" y1="46.99" x2="234.95" y2="46.99" width="0.1524" layer="91"/>
<wire x1="234.95" y1="46.99" x2="237.49" y2="49.53" width="0.1524" layer="91"/>
<wire x1="237.49" y1="49.53" x2="255.27" y2="49.53" width="0.1524" layer="91"/>
<pinref part="SUPPLY4" gate="G$1" pin="3.3V"/>
<junction x="232.41" y="46.99"/>
</segment>
<segment>
<pinref part="U1" gate="A" pin="VDD_VREFH"/>
<pinref part="SUPPLY6" gate="G$1" pin="3.3V"/>
<wire x1="294.64" y1="177.8" x2="265.43" y2="177.8" width="0.1524" layer="91"/>
<wire x1="265.43" y1="177.8" x2="265.43" y2="182.88" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="R5" gate="R" pin="2"/>
<pinref part="SUPPLY7" gate="G$1" pin="3.3V"/>
<wire x1="435.61" y1="187.96" x2="435.61" y2="190.5" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="R4" gate="R" pin="2"/>
<pinref part="SUPPLY8" gate="G$1" pin="3.3V"/>
<wire x1="430.53" y1="187.96" x2="430.53" y2="190.5" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C10" gate="C" pin="2"/>
<pinref part="SUPPLY11" gate="G$1" pin="3.3V"/>
<pinref part="C9" gate="C" pin="2"/>
<wire x1="246.38" y1="147.32" x2="250.19" y2="147.32" width="0.1524" layer="91"/>
<junction x="246.38" y="147.32"/>
</segment>
<segment>
<pinref part="PTA6_MISO1" gate="G$1" pin="1"/>
<pinref part="SUPPLY2" gate="G$1" pin="3.3V"/>
</segment>
</net>
<net name="OLED_SCL" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTB3/IRQ_10/I2C0_SCL/UART0_TX"/>
<pinref part="R4" gate="R" pin="1"/>
<wire x1="420.37" y1="170.18" x2="430.53" y2="180.34" width="0.1524" layer="91"/>
<wire x1="420.37" y1="170.18" x2="406.4" y2="170.18" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U$9" gate="G$1" pin="SCL"/>
<wire x1="242.57" y1="44.45" x2="255.27" y2="44.45" width="0.1524" layer="91"/>

</segment>
</net>
<net name="OLED_SDA" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTB4/IRQ_11/I2C0_SDA/UART0_RX"/>
<pinref part="R5" gate="R" pin="1"/>
<wire x1="422.91" y1="167.64" x2="435.61" y2="180.34" width="0.1524" layer="91"/>
<wire x1="422.91" y1="167.64" x2="406.4" y2="167.64" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U$9" gate="G$1" pin="SDA"/>
<wire x1="242.57" y1="41.91" x2="255.27" y2="41.91" width="0.1524" layer="91"/>

</segment>
</net>
<net name="PTB2" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTB2/IRQ_7/UART0_TX/UART0_RX"/>
<wire x1="439.42" y1="172.72" x2="406.4" y2="172.72" width="0.1524" layer="91"/>

</segment>
</net>
<net name="OLED_RESET" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTB5/IRQ_12/NMI_B"/>
<wire x1="444.5" y1="165.1" x2="406.4" y2="165.1" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U$9" gate="G$1" pin="RESET"/>
<wire x1="255.27" y1="46.99" x2="243.84" y2="46.99" width="0.1524" layer="91"/>

</segment>
</net>
<net name="AUDIO" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTA5/SPI0_SS_B"/>
<wire x1="294.64" y1="160.02" x2="292.1" y2="160.02" width="0.1524" layer="91"/>

</segment>
</net>
<net name="LED1" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTA7/IRQ_4/SPI0_MOSI/SPI0_MISO"/>
<wire x1="294.64" y1="154.94" x2="284.48" y2="154.94" width="0.1524" layer="91"/>

</segment>
</net>
<net name="BUTTON2" class="0">
<segment>
<pinref part="K3" gate="K" pin="A0"/>
<wire x1="308.61" y1="90.17" x2="326.39" y2="90.17" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U1" gate="A" pin="PTA8/I2C1_SCL"/>
<wire x1="294.64" y1="152.4" x2="285.75" y2="152.4" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="K5" gate="K" pin="A0"/>
<wire x1="323.85" y1="52.07" x2="341.63" y2="52.07" width="0.1524" layer="91"/>

</segment>
</net>
<net name="BUTTON1" class="0">
<segment>
<pinref part="K1" gate="K" pin="A0"/>
<wire x1="308.61" y1="111.76" x2="326.39" y2="111.76" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U1" gate="A" pin="PTB11"/>
<wire x1="406.4" y1="154.94" x2="416.56" y2="154.94" width="0.1524" layer="91"/>

</segment>
</net>
<net name="BUTTON4" class="0">
<segment>
<pinref part="K2" gate="K" pin="A0"/>
<wire x1="359.41" y1="111.76" x2="379.73" y2="111.76" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U1" gate="A" pin="PTB10"/>
<wire x1="406.4" y1="157.48" x2="416.56" y2="157.48" width="0.1524" layer="91"/>

</segment>
</net>
<net name="BUTTON3" class="0">
<segment>
<pinref part="K4" gate="K" pin="A0"/>
<wire x1="359.41" y1="90.17" x2="379.73" y2="90.17" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U1" gate="A" pin="PTB7/IRQ_3"/>
<wire x1="444.5" y1="160.02" x2="406.4" y2="160.02" width="0.1524" layer="91"/>

</segment>
</net>
<net name="PTB1" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTB1/IRQ_6/UART0_RX/UART0_TX"/>
<wire x1="439.42" y1="175.26" x2="406.4" y2="175.26" width="0.1524" layer="91"/>

</segment>
</net>
<net name="SWDIO" class="0">
<segment>
<pinref part="PTA6_MISO2" gate="G$1" pin="1"/>
<wire x1="219.71" y1="190.5" x2="237.49" y2="190.5" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U1" gate="A" pin="PTA2/SWD_DIO"/>
<wire x1="280.67" y1="167.64" x2="294.64" y2="167.64" width="0.1524" layer="91"/>

</segment>
</net>
<net name="SWCLK" class="0">
<segment>
<pinref part="PTA6_MISO3" gate="G$1" pin="1"/>
<wire x1="219.71" y1="185.42" x2="237.49" y2="185.42" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U1" gate="A" pin="PTA0/IRQ_0/SWD_CLK"/>
<wire x1="294.64" y1="172.72" x2="280.67" y2="172.72" width="0.1524" layer="91"/>

</segment>
</net>
<net name="RESET" class="0">
<segment>
<pinref part="PTA6_MISO4" gate="G$1" pin="1"/>
<wire x1="219.71" y1="180.34" x2="237.49" y2="180.34" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U1" gate="A" pin="PTA1/IRQ_1/LPTMR0_ALT1/RESET_B"/>
<wire x1="294.64" y1="170.18" x2="280.67" y2="170.18" width="0.1524" layer="91"/>

</segment>
</net>
<net name="AUDIOSELECTOR" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTB13"/>
<wire x1="406.4" y1="152.4" x2="417.83" y2="152.4" width="0.1524" layer="91"/>

</segment>
</net>
<net name="DATAIN" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTA12/IRQ_13/LPTMR0_ALT2"/>
<wire x1="294.64" y1="147.32" x2="292.1" y2="147.32" width="0.1524" layer="91"/>

</segment>
</net>
<net name="LED2" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTA9/I2C1_SDA"/>
<wire x1="294.64" y1="149.86" x2="284.48" y2="149.86" width="0.1524" layer="91"/>

</segment>
</net>
<net name="AUDIOHEADPHONE" class="0">
<segment>
<pinref part="U1" gate="A" pin="PTA6/SPI0_MISO"/>
<wire x1="294.64" y1="157.48" x2="280.67" y2="157.48" width="0.1524" layer="91"/>

</segment>
</net>
<net name="N$1" class="1">
<segment>
<pinref part="U1" gate="A" pin="VREFL_VSS"/>
<wire x1="294.64" y1="137.16" x2="289.56" y2="137.16" width="0.1524" layer="91"/>
</segment>
</net>
</nets>
</sheet>
</sheets>
</schematic>
</drawing>
<compatibility>
<note version="6.3" minversion="6.2.2" severity="warning">
Since Version 6.2.2 text objects can contain more than one line,
which will not be processed correctly with this version.
</note>
</compatibility>
</eagle>


text:
// Copyright 2016-2018, Pulumi Corporation.
//
// 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.

package client

import (
	"bytes"
	"compress/gzip"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"net/http"
	"reflect"
	"runtime"
	"strings"
	"time"

	"github.com/google/go-querystring/query"
	"github.com/opentracing/opentracing-go"

	"github.com/pulumi/pulumi/pkg/v3/util/tracing"
	"github.com/pulumi/pulumi/pkg/v3/version"
	"github.com/pulumi/pulumi/sdk/v3/go/common/apitype"
	"github.com/pulumi/pulumi/sdk/v3/go/common/diag"
	"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
	"github.com/pulumi/pulumi/sdk/v3/go/common/util/httputil"
	"github.com/pulumi/pulumi/sdk/v3/go/common/util/logging"
)

const (
	apiRequestLogLevel       = 10 // log level for logging API requests and responses
	apiRequestDetailLogLevel = 11 // log level for logging extra details about API requests and responses
)

// StackIdentifier is the set of data needed to identify a Pulumi Cloud stack.
type StackIdentifier struct {
	Owner   string
	Project string
	Stack   string
}

func (s StackIdentifier) String() string {
	return fmt.Sprintf("%s/%s/%s", s.Owner, s.Project, s.Stack)
}

// UpdateIdentifier is the set of data needed to identify an update to a Pulumi Cloud stack.
type UpdateIdentifier struct {
	StackIdentifier

	UpdateKind apitype.UpdateKind
	UpdateID   string
}

// accessTokenKind is enumerates the various types of access token used with the Pulumi API. These kinds correspond
// directly to the "method" piece of an HTTP `Authorization` header.
type accessTokenKind string

const (
	// accessTokenKindAPIToken denotes a standard Pulumi API token.
	accessTokenKindAPIToken accessTokenKind = "token"
	// accessTokenKindUpdateToken denotes an update lease token.
	accessTokenKindUpdateToken accessTokenKind = "update-token"
)

// accessToken is an abstraction over the two different kinds of access tokens used by the Pulumi API.
type accessToken interface {
	Kind() accessTokenKind
	Get(ctx context.Context) (string, error)
}

type httpCallOptions struct {
	// RetryPolicy defines the policy for retrying requests by httpClient.Do.
	//
	// By default, only GET requests are retried.
	RetryPolicy retryPolicy

	// GzipCompress compresses the request using gzip before sending it.
	GzipCompress bool
}

// apiAccessToken is an implementation of accessToken for Pulumi API tokens (i.e. tokens of kind
// accessTokenKindAPIToken)
type apiAccessToken string

func (apiAccessToken) Kind() accessTokenKind {
	return accessTokenKindAPIToken
}

func (t apiAccessToken) Get(_ context.Context) (string, error) {
	return string(t), nil
}

// UpdateTokenSource allows the API client to request tokens for an in-progress update as near as possible to the
// actual API call (e.g. after marshaling, etc.).
type UpdateTokenSource interface {
	GetToken(ctx context.Context) (string, error)
}

type updateTokenStaticSource string

func (t updateTokenStaticSource) GetToken(_ context.Context) (string, error) {
	return string(t), nil
}

// updateToken is an implementation of accessToken for update lease tokens (i.e. tokens of kind
// accessTokenKindUpdateToken)
type updateToken struct {
	source UpdateTokenSource
}

func updateAccessToken(source UpdateTokenSource) updateToken {
	return updateToken{source: source}
}

func (updateToken) Kind() accessTokenKind {
	return accessTokenKindUpdateToken
}

func (t updateToken) Get(ctx context.Context) (string, error) {
	return t.source.GetToken(ctx)
}

func float64Ptr(f float64) *float64 {
	return &f
}

func durationPtr(d time.Duration) *time.Duration {
	return &d
}

func intPtr(i int) *int {
	return &i
}

// retryPolicy defines the policy for retrying requests by httpClient.Do.
type retryPolicy int

const (
	// retryNone indicates that no retry should be attempted.
	retryNone retryPolicy = iota - 1

	// retryGetMethod indicates that only GET requests should be retried.
	//
	// This is the default retry policy.
	retryGetMethod // == 0

	// retryAllMethods indicates that all requests should be retried.
	retryAllMethods
)

func (p retryPolicy) String() string {
	switch p {
	case retryNone:
		return "none"
	case retryGetMethod:
		return "get"
	case retryAllMethods:
		return "all"
	default:
		return fmt.Sprintf("retryPolicy(%d)", p)
	}
}

func (p retryPolicy) shouldRetry(req *http.Request) bool {
	switch p {
	case retryNone:
		return false
	case retryGetMethod:
		return req.Method == http.MethodGet
	case retryAllMethods:
		return true
	default:
		contract.Failf("unknown retry policy: %v", p)
		return false // unreachable
	}
}

// httpClient is an HTTP client abstraction, used by defaultRESTClient.
type httpClient interface {
	Do(req *http.Request, policy retryPolicy) (*http.Response, error)
}

// defaultHTTPClient is an implementation of httpClient that provides a basic implementation of Do
// using the specified *http.Client, with retry support.
type defaultHTTPClient struct {
	client *http.Client
}

func (c *defaultHTTPClient) Do(req *http.Request, policy retryPolicy) (*http.Response, error) {
	if policy.shouldRetry(req) {
		// Wait 1s before retrying on failure. Then increase by 2x until the
		// maximum delay is reached. Stop after maxRetryCount requests have
		// been made.
		opts := httputil.RetryOpts{
			Delay:    durationPtr(time.Second),
			Backoff:  float64Ptr(2.0),
			MaxDelay: durationPtr(30 * time.Second),

			MaxRetryCount: intPtr(4),
		}
		return httputil.DoWithRetryOpts(req, c.client, opts)
	}
	return c.client.Do(req)
}

// pulumiAPICall makes an HTTP request to the Pulumi API.
func pulumiAPICall(ctx context.Context,
	requestSpan opentracing.Span,
	d diag.Sink, client httpClient, cloudAPI, method, path string, body []byte,
	tok accessToken, opts httpCallOptions,
) (string, *http.Response, error) {
	// Normalize URL components
	cloudAPI = strings.TrimSuffix(cloudAPI, "/")
	path = cleanPath(path)

	url := fmt.Sprintf("%s%s", cloudAPI, path)
	var bodyReader io.Reader
	if opts.GzipCompress {
		// If we're being asked to compress the payload, go ahead and do it here to an intermediate buffer.
		//
		// If this becomes a performance bottleneck, we may want to consider marshaling json directly to this
		// gzip.Writer instead of marshaling to a byte array and compressing it to another buffer.
		logging.V(apiRequestDetailLogLevel).Infoln("compressing payload using gzip")
		var buf bytes.Buffer
		writer := gzip.NewWriter(&buf)
		defer contract.IgnoreClose(writer)
		if _, err := writer.Write(body); err != nil {
			return "", nil, fmt.Errorf("compressing payload: %w", err)
		}

		// gzip.Writer will not actually write anything unless it is flushed,
		//  and it will not actually write the GZip footer unless it is closed. (Close also flushes)
		// Without this, the compressed bytes do not decompress properly e.g. in python.
		if err := writer.Close(); err != nil {
			return "", nil, fmt.Errorf("closing compressed payload: %w", err)
		}

		logging.V(apiRequestDetailLogLevel).Infof("gzip compression ratio: %f, original size: %d bytes",
			float64(len(body))/float64(len(buf.Bytes())), len(body))
		bodyReader = &buf
	} else {
		bodyReader = bytes.NewReader(body)
	}

	req, err := http.NewRequest(method, url, bodyReader)
	if err != nil {
		return "", nil, fmt.Errorf("creating new HTTP request: %w", err)
	}

	req = req.WithContext(ctx)
	req.Header.Set("Content-Type", "application/json")

	// Add a User-Agent header to allow for the backend to make breaking API changes while preserving
	// backwards compatibility.
	userAgent := fmt.Sprintf("pulumi-cli/1 (%s; %s)", version.Version, runtime.GOOS)
	req.Header.Set("User-Agent", userAgent)
	// Specify the specific API version we accept.
	req.Header.Set("Accept", "application/vnd.pulumi+8")

	// Apply credentials if provided.
	creds, err := tok.Get(ctx)
	if err != nil {
		return "", nil, fmt.Errorf("fetching credentials: %w", err)
	}
	if creds != "" {
		req.Header.Set("Authorization", fmt.Sprintf("%s %s", tok.Kind(), creds))
	}

	tracingOptions := tracing.OptionsFromContext(ctx)
	if tracingOptions.PropagateSpans {
		carrier := opentracing.HTTPHeadersCarrier(req.Header)
		if err = requestSpan.Tracer().Inject(requestSpan.Context(), opentracing.HTTPHeaders, carrier); err != nil {
			logging.Errorf("injecting tracing headers: %v", err)
		}
	}
	if tracingOptions.TracingHeader != "" {
		req.Header.Set("X-Pulumi-Tracing", tracingOptions.TracingHeader)
	}

	// Opt-in to accepting gzip-encoded responses from the service.
	req.Header.Set("Accept-Encoding", "gzip")
	if opts.GzipCompress {
		// If we're sending something that's gzipped, set that header too.
		req.Header.Set("Content-Encoding", "gzip")
	}

	logging.V(apiRequestLogLevel).Infof("Making Pulumi API call: %s", url)
	if logging.V(apiRequestDetailLogLevel) {
		logging.V(apiRequestDetailLogLevel).Infof(
			"Pulumi API call details (%s): headers=%v; body=%v", url, req.Header, string(body))
	}

	resp, err := client.Do(req, opts.RetryPolicy)
	if err != nil {
		// Don't wrap *apitype.ErrorResponse.
		if _, ok := err.(*apitype.ErrorResponse); ok {
			return "", nil, err
		}
		return "", nil, fmt.Errorf("performing HTTP request: %w", err)
	}
	logging.V(apiRequestLogLevel).Infof("Pulumi API call response code (%s): %v", url, resp.Status)

	requestSpan.SetTag("responseCode", resp.Status)

	if warningHeader, ok := resp.Header["X-Pulumi-Warning"]; ok {
		for _, warning := range warningHeader {
			d.Warningf(diag.RawMessage("", warning))
		}
	}

	// Provide a better error if using an authenticated call without having logged in first.
	if resp.StatusCode == 401 && tok.Kind() == accessTokenKindAPIToken && creds == "" {
		return "", nil, errors.New("this command requires logging in; try running `pulumi login` first")
	}

	// Provide a better error if rate-limit is exceeded(429: Too Many Requests)
	if resp.StatusCode == 429 {
		return "", nil, errors.New("pulumi service: request rate-limit exceeded")
	}

	// For 4xx and 5xx failures, attempt to provide better diagnostics about what may have gone wrong.
	if resp.StatusCode >= 400 && resp.StatusCode <= 599 {
		// 4xx and 5xx responses should be of type ErrorResponse. See if we can unmarshal as that
		// type, and if not just return the raw response text.
		respBody, err := readBody(resp)
		if err != nil {
			return "", nil, fmt.Errorf("API call failed (%s), could not read response: %w", resp.Status, err)
		}

		var errResp apitype.ErrorResponse
		if err = json.Unmarshal(respBody, &errResp); err != nil {
			errResp.Code = resp.StatusCode
			errResp.Message = strings.TrimSpace(string(respBody))
		}
		return "", nil, &errResp
	}

	return url, resp, nil
}

// restClient is an abstraction for calling the Pulumi REST API.
type restClient interface {
	Call(ctx context.Context, diag diag.Sink, cloudAPI, method, path string, queryObj, reqObj,
		respObj interface{}, tok accessToken, opts httpCallOptions) error
}

// defaultRESTClient is the default implementation for calling the Pulumi REST API.
type defaultRESTClient struct {
	client httpClient
}

// Call calls the Pulumi REST API marshalling reqObj to JSON and using that as
// the request body (use nil for GETs), and if successful, marshalling the responseObj
// as JSON and storing it in respObj (use nil for NoContent). The error return type might
// be an instance of apitype.ErrorResponse, in which case will have the response code.
func (c *defaultRESTClient) Call(ctx context.Context, diag diag.Sink, cloudAPI, method, path string, queryObj, reqObj,
	respObj interface{}, tok accessToken, opts httpCallOptions,
) error {
	requestSpan, ctx := opentracing.StartSpanFromContext(ctx, getEndpointName(method, path),
		opentracing.Tag{Key: "method", Value: method},
		opentracing.Tag{Key: "path", Value: path},
		opentracing.Tag{Key: "api", Value: cloudAPI},
		opentracing.Tag{Key: "retry", Value: opts.RetryPolicy.String()})
	defer requestSpan.Finish()

	// Compute query string from query object
	querystring := ""
	if queryObj != nil {
		queryValues, err := query.Values(queryObj)
		if err != nil {
			return fmt.Errorf("marshalling query object as JSON: %w", err)
		}
		query := queryValues.Encode()
		if len(query) > 0 {
			querystring = "?" + query
		}
	}

	// Compute request body from request object
	var reqBody []byte
	var err error
	if reqObj != nil {
		// Send verbatim if already marshalled. This is
		// important when sending indented JSON is needed.
		if raw, ok := reqObj.(json.RawMessage); ok {
			reqBody = []byte(raw)
		} else {
			reqBody, err = json.Marshal(reqObj)
			if err != nil {
				return fmt.Errorf("marshalling request object as JSON: %w", err)
			}
		}
	}

	// Make API call
	url, resp, err := pulumiAPICall(
		ctx, requestSpan, diag, c.client, cloudAPI, method, path+querystring, reqBody, tok, opts)
	if err != nil {
		return err
	}

	// Read API response
	respBody, err := readBody(resp)
	if err != nil {
		return fmt.Errorf("reading response from API: %w", err)
	}
	if logging.V(apiRequestDetailLogLevel) {
		logging.V(apiRequestDetailLogLevel).Infof("Pulumi API call response body (%s): %v", url, string(respBody))
	}

	if respObj != nil {
		bytes := reflect.TypeOf([]byte(nil))
		if typ := reflect.TypeOf(respObj); typ == reflect.PtrTo(bytes) {
			// Return the raw bytes of the response body.
			*respObj.(*[]byte) = respBody
		} else if typ == bytes {
			return fmt.Errorf("Can't unmarshal response body to []byte. Try *[]byte")
		} else {
			// Else, unmarshal as JSON.
			if err = json.Unmarshal(respBody, respObj); err != nil {
				return fmt.Errorf("unmarshalling response object: %w", err)
			}
		}
	}

	return nil
}

// readBody reads the contents of an http.Response into a byte array, returning an error if one occurred while in the
// process of doing so. readBody uses the Content-Encoding of the response to pick the correct reader to use.
func readBody(resp *http.Response) ([]byte, error) {
	contentEncoding, ok := resp.Header["Content-Encoding"]
	defer contract.IgnoreClose(resp.Body)
	if !ok {
		// No header implies that there's no additional encoding on this response.
		return io.ReadAll(resp.Body)
	}

	if len(contentEncoding) > 1 {
		// We only know how to deal with gzip. We can't handle additional encodings layered on top of it.
		return nil, fmt.Errorf("can't handle content encodings %v", contentEncoding)
	}

	switch contentEncoding[0] {
	case "x-gzip":
		// The HTTP/1.1 spec recommends we treat x-gzip as an alias of gzip.
		fallthrough
	case "gzip":
		logging.V(apiRequestDetailLogLevel).Infoln("decompressing gzipped response from service")
		reader, err := gzip.NewReader(resp.Body)
		if reader != nil {
			defer contract.IgnoreClose(reader)
		}
		if err != nil {
			return nil, fmt.Errorf("reading gzip-compressed body: %w", err)
		}

		return io.ReadAll(reader)
	default:
		return nil, fmt.Errorf("unrecognized encoding %s", contentEncoding[0])
	}
}

repository: pulumi/pulumi

license_type: permissive

repo_name: pulumi/pulumi

branch_name: refs/heads/master

gha_language: Go

extension: go


text:
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Vokabular.MainService.DataContracts.Contracts.Type
{
    [JsonConverter(typeof(StringEnumConverter))]
    public enum ResourceTypeEnumContract
    {
        None = 0,
        ResourceGroup = 1,
        ProjectMetadata = 2,
        Chapter = 3,
        Page = 4,
        Headword = 5,
        Text = 6,
        Image = 7,
        Audio = 8,
        AudioTrack = 9,
        BookVersion = 10,
        EditionNote = 11
    }
}

repository: RIDICS/ITJakub

repo_name: RIDICS/ITJakub

gha_language: C#

extension: cs


text:
SUMMARY = "A coroutine-based Python networking library"
DESCRIPTION = "gevent is a coroutine-based Python networking library that uses greenlet to provide \
a high-level synchronous API on top of the libevent event loop."
HOMEPAGE = "http://www.gevent.org"
LICENSE = "MIT & Python-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4de99aac27b470c29c6c309e0c279b65"
DEPENDS += "${PYTHON_PN}-greenlet libev c-ares"

RDEPENDS:${PN} = "${PYTHON_PN}-greenlet \
		  ${PYTHON_PN}-mime \
		  ${PYTHON_PN}-pprint \
		 "

SRC_URI[sha256sum] = "43e93e1a4738c922a2416baf33f0afb0a20b22d3dba886720bc037cd02a98575"

inherit pypi setuptools3

# Don't embed libraries, link to the system instead
export GEVENTSETUP_EMBED = "0"

# Delete the embedded copies of libraries so we can't accidentally link to them
do_configure:append() {
	rm -rf ${S}/deps
}

repository: ibm-openbmc/openbmc

repo_name: ibm-openbmc/openbmc

gha_license_id: NOASSERTION

gha_language: Python

extension: bb


text:
# generated from ament/cmake/core/templates/nameConfig.cmake.in

# prevent multiple inclusion
if(_ros_ign_image_CONFIG_INCLUDED)
  # ensure to keep the found flag the same
  if(NOT DEFINED ros_ign_image_FOUND)
    # explicitly set it to FALSE, otherwise CMake will set it to TRUE
    set(ros_ign_image_FOUND FALSE)
  elseif(NOT ros_ign_image_FOUND)
    # use separate condition to avoid uninitialized variable warning
    set(ros_ign_image_FOUND FALSE)
  endif()
  return()
endif()
set(_ros_ign_image_CONFIG_INCLUDED TRUE)

# output package information
if(NOT ros_ign_image_FIND_QUIETLY)
  message(STATUS "Found ros_ign_image: 0.7.0 (${ros_ign_image_DIR})")
endif()

# warn when using a deprecated package
if(NOT "" STREQUAL "")
  set(_msg "Package 'ros_ign_image' is deprecated")
  # append custom deprecation text if available
  if(NOT "" STREQUAL "TRUE")
    set(_msg "${_msg} ()")
  endif()
  # optionally quiet the deprecation message
  if(NOT ${ros_ign_image_DEPRECATED_QUIET})
    message(DEPRECATION "${_msg}")
  endif()
endif()

# flag package as ament-based to distinguish it after being find_package()-ed
set(ros_ign_image_FOUND_AMENT_PACKAGE TRUE)

# include all config extra files
set(_extras "")
foreach(_extra ${_extras})
  include("${ros_ign_image_DIR}/${_extra}")
endforeach()

license: MIT

branch_name: refs/heads/main

extension: cmake


text:
using HoloIslandVis.Core.Metaphor;
using System;
using System.Collections.Generic;

namespace HoloIslandVis.Core.Builders
{
    public class IslandGameObjectsBuiltEventArgs : EventArgs
    {
        public List<Island> Islands { get; private set; }

        public IslandGameObjectsBuiltEventArgs(List<Island> islands)
        {
            Islands = islands;
        }
    }
}

repository: DLR-SC/islandviz-hololens

repo_name: DLR-SC/islandviz-hololens


text:
DESCRIPTION = "NVIDIA Tegra Multimedia API headers and examples"
HOMEPAGE = "http://developer.nvidia.com"
LICENSE = "Proprietary & BSD"

require recipes-multimedia/argus/tegra-mmapi-${PV}.inc

SRC_URI += "file://jpeg-fixups.patch \
           file://cross-build-fixups.patch \
           file://make-getpixel-python3-compatible.patch \
           file://fix-dq-thread-race.patch \
           file://sample-bounding-box.txt \
           file://0001-Support-tegra_udrm-in-NvDrmRenderer.patch \
           file://0002-Remove-DO-NOT-USE-declarations-from-v4l2_nv_extensio.patch \
           "

DEPENDS = "libdrm tegra-mmapi virtual/egl virtual/libgles1 virtual/libgles2 jpeg expat gstreamer1.0 glib-2.0 v4l-utils tensorrt cudnn opencv"

LIC_FILES_CHKSUM = "file://LICENSE;md5=2cc00be68c1227a7c42ff3620ef75d05"

inherit pkgconfig cuda python3native

B = "${S}"

CLEANBROKEN = "1"

do_configure() {
    rm -f ${S}/include/nvbuf_utils.h
    find samples -name 'Makefile' -exec sed -i -e's,^LDFLAGS,NVLDFLAGS,' -e's,\$(LDFLAGS),$(LDFLAGS) $(NVLDFLAGS),' {} \;
}

do_compile() {
    export CPP="${@cuda_extract_compiler('CXX', d)[0]}"
    CXX_EXTRA="${@cuda_extract_compiler('CXX', d, prefix='')[1]}"
    export CUDA_PATH=${STAGING_DIR_NATIVE}/usr/local/cuda-${CUDA_VERSION}
    PATH=$CUDA_PATH/bin:$PATH
    export CPPFLAGS="${CXX_EXTRA} ${CXXFLAGS} -I${CUDA_PATH}/include"
    CPPFLAGS="$CPPFLAGS `pkg-config --cflags libdrm`"
    CPPFLAGS="$CPPFLAGS `pkg-config --cflags opencv4`"
    export LDFLAGS="-L${CUDA_PATH}/lib ${LDFLAGS}"
    CCBIN=`which $CPP`
    oe_runmake -j1 all TEGRA_ARMABI=${HOST_ARCH} TARGET_ROOTFS=${STAGING_DIR_HOST} NVCC=nvcc NVCCFLAGS="--shared -ccbin=${CCBIN}" GENCODE_FLAGS="${CUDA_NVCC_ARCH_FLAGS}" PYTHON="${PYTHON}"
}

do_install() {
    install -d ${D}/opt/tegra-mmapi
    cp -R --preserve=mode,timestamps ${S}/data ${D}/opt/tegra-mmapi/
    install -m 0644 ${WORKDIR}/sample-bounding-box.txt ${D}/opt/tegra-mmapi/data/
    install -d ${D}/opt/tegra-mmapi/bin
    install -m 0755 ${S}/samples/00_video_decode/video_decode ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/01_video_encode/video_encode ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/02_video_dec_cuda/video_dec_cuda ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/03_video_cuda_enc/video_cuda_enc ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/04_video_dec_trt/video_dec_trt ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/05_jpeg_encode/jpeg_encode ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/06_jpeg_decode/jpeg_decode ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/07_video_convert/video_convert ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/08_video_dec_drm/video_dec_drm ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/09_camera_jpeg_capture/camera_jpeg_capture ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/10_camera_recording/camera_recording ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/12_camera_v4l2_cuda/camera_v4l2_cuda ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/13_multi_camera/multi_camera ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/backend/backend ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/frontend/frontend ${D}/opt/tegra-mmapi/bin/
    install -m 0755 ${S}/samples/v4l2cuda/capture-cuda ${D}/opt/tegra-mmapi/bin/
}

FILES:${PN} += "/opt/tegra-mmapi"
RDEPENDS:${PN} += "tegra-libraries-libv4l-plugins"


text:
package cluster

import (
	log "github.com/Sirupsen/logrus"

	"github.com/hashicorp/memberlist"
)

// ==========================================================
// memberlist.EventDelegate implementation for cluster struct
// ==========================================================

func (cluster *Cluster) NotifyJoin(node *memberlist.Node) {
	cluster.numJoins++
	cluster.eventLog(node, "Cluster Node Join")

	cluster.sendPartitions(node)
}

func (cluster *Cluster) NotifyLeave(node *memberlist.Node) {
	cluster.numLeaves++
	cluster.eventLog(node, "Cluster Node Leave")
}

func (cluster *Cluster) NotifyUpdate(node *memberlist.Node) {
	cluster.numUpdates++
	cluster.eventLog(node, "Cluster Node Update")
}

func (cluster *Cluster) eventLog(node *memberlist.Node, message string) {
	logger.WithFields(log.Fields{
		"node":       node.Name,
		"numJoins":   cluster.numJoins,
		"numLeaves":  cluster.numLeaves,
		"numUpdates": cluster.numUpdates,
	}).Debug(message)
}

func (cluster *Cluster) sendPartitions(node *memberlist.Node) {
	if _, inSync := cluster.synchronizer.inSync(node.Name); inSync {
		logger.WithField("node", node.Name).Debug("Already in sync with node")
		return
	}

	logger.WithField("node", node.Name).Debug("Sending partitions info")

	// Send message partitions to the new node
	store, err := cluster.Router.MessageStore()
	if err != nil {
		logger.WithError(err).Error("Error retriving message store to get partitions")
		return
	}

	partitionsSlice := partitionsFromStore(store)

	// sending partitions
	data, err := partitionsSlice.encode()
	if err != nil {
		logger.WithError(err).Error("Error encoding partitions")
		return
	}
	cmsg := cluster.newMessage(mtSyncPartitions, data)

	// send message to node
	err = cluster.sendMessageToNode(node, cmsg)
	if err != nil {
		logger.WithField("node", node.Name).WithError(err).Error("Error sending partitions info to node")
	}
}

repository: cosminrentea/gobbler

repo_name: cosminrentea/gobbler


text:
//go:build !purego

package xxhash

// Sum64 computes the 64-bit xxHash digest of b.
func Sum64(b []byte) uint64

repository: neevaco/segmentio-parquet-go

repo_name: neevaco/segmentio-parquet-go

branch_name: refs/heads/neeva


text:
package flags2

import (
	"crypto/sha1"
	"encoding/binary"
	"encoding/json"
	"fmt"
	"sort"

	"github.com/stripe/goforit/clamp"
	"github.com/stripe/goforit/flags"
)

type Operation2 string

const (
	OpIn      = "in"
	OpNotIn   = "not_in"
	OpIsNil   = "is_nil"
	OptNotNil = "is_not_nil"

	PercentOn  = 1.0
	PercentOff = 0.0

	HashByRandom = "_random"
)

// Predicate2 is a newer, more sophisticated type of flag!
//
// Each Flag2 contains a list of rules, and each rule contains a list of predicates.
// When querying a flag, the first rule whose predicates match is applied.
type Predicate2 struct {
	Attribute string          `json:"attribute"`
	Operation Operation2      `json:"operation"`
	Values    map[string]bool `json:"values"`
}
type Rule2 struct {
	HashBy     string       `json:"hash_by"`
	Percent    float64      `json:"percent"`
	Predicates []Predicate2 `json:"predicates"`
}
type Flag2 struct {
	Name    string  `json:"name"`
	Seed    string  `json:"seed"`
	Rules   []Rule2 `json:"rules"`
	Deleted bool    `json:"deleted"`
}

type JSONFormat2 struct {
	Flags   []*Flag2 `json:"flags"`
	Updated float64  `json:"updated"`
}

type predicate2Json struct {
	Attribute string     `json:"attribute"`
	Operation Operation2 `json:"operation"`
	Values    []string   `json:"values"`
}

func (p *Predicate2) UnmarshalJSON(data []byte) error {
	var raw predicate2Json
	err := json.Unmarshal(data, &raw)
	if err != nil {
		return err
	}

	*p = Predicate2{Attribute: raw.Attribute, Operation: raw.Operation, Values: map[string]bool{}}
	for _, v := range raw.Values {
		p.Values[v] = true
	}
	return nil
}

func (p *Predicate2) MarshalJSON() ([]byte, error) {
	raw := predicate2Json{
		Attribute: p.Attribute,
		Operation: p.Operation,
	}

	if len(p.Values) > 0 {
		raw.Values = make([]string, 0, len(p.Values))
		for k := range p.Values {
			raw.Values = append(raw.Values, k)
		}
		sort.Strings(raw.Values)
	}

	return json.Marshal(&raw)
}

func (f *Flag2) FlagName() string {
	return f.Name
}

func (f *Flag2) Enabled(rnd flags.Rand, properties, defaultTags map[string]string) (bool, error) {
	for i := range f.Rules {
		rule := &f.Rules[i]
		match, err := rule.matches(properties, defaultTags)
		if err != nil {
			return false, err
		}
		if !match {
			continue
		}

		return rule.evaluate(rnd, f.Seed, properties, defaultTags)
	}

	// If no rules match, the flag is off
	return false, nil
}

func (f *Flag2) Clamp() clamp.Clamp {
	if len(f.Rules) == 0 {
		return clamp.AlwaysOff
	}
	if len(f.Rules) == 1 && len(f.Rules[0].Predicates) == 0 {
		if f.Rules[0].Percent <= PercentOff {
			return clamp.AlwaysOff
		} else if f.Rules[0].Percent >= PercentOn {
			return clamp.AlwaysOn
		}
	}
	return clamp.MayVary
}

func (p *Predicate2) equal(o Predicate2) bool {
	if p.Attribute != o.Attribute || p.Operation != o.Operation || len(p.Values) != len(o.Values) {
		return false
	}

	for v := range p.Values {
		if !o.Values[v] {
			return false
		}
	}
	// Since cardinality is the same, the whole set must be the same
	return true
}

func (r *Rule2) equal(o Rule2) bool {
	if r.HashBy != o.HashBy || r.Percent != o.Percent || len(r.Predicates) != len(o.Predicates) {
		return false
	}
	for i := range r.Predicates {
		if !r.Predicates[i].equal(o.Predicates[i]) {
			return false
		}
	}
	return true
}

func (f *Flag2) Equal(o *Flag2) bool {
	if f.Name != o.Name || f.Seed != o.Seed || len(f.Rules) != len(o.Rules) {
		return false
	}
	for i := range f.Rules {
		if !f.Rules[i].equal(o.Rules[i]) {
			return false
		}
	}
	return true
}

func (f *Flag2) IsDeleted() bool {
	return f.Deleted
}

func (p *Predicate2) matches(properties, defaultTags map[string]string) (bool, error) {
	val, present := properties[p.Attribute]
	if !present {
		val, present = defaultTags[p.Attribute]
	}
	switch p.Operation {
	case OpIn:
		return p.Values[val], nil
	case OpNotIn:
		return !p.Values[val], nil
	case OpIsNil:
		return !present, nil
	case OptNotNil:
		return present, nil
	default:
		return false, fmt.Errorf("unknown predicate %q", p.Operation)
	}
}

func (r *Rule2) matches(properties, defaultTags map[string]string) (bool, error) {
	_, hashPresent := properties[r.HashBy]
	if !hashPresent {
		_, hashPresent = defaultTags[r.HashBy]
	}
	if !hashPresent && r.HashBy != HashByRandom && r.Percent > PercentOff && r.Percent < PercentOn {
		// We have no way to calculate a percentage, so the specced behavior is to skip this rule
		return false, nil
	}

	for i := range r.Predicates {
		pred := &r.Predicates[i]
		match, err := pred.matches(properties, defaultTags)
		if err != nil {
			return false, err
		}
		// ALL predicates must match
		if !match {
			return false, nil
		}
	}
	return true, nil
}

func (r *Rule2) hashValue(seed, val string) float64 {
	h := sha1.New()
	h.Write([]byte(seed))
	h.Write([]byte{'.'})
	h.Write([]byte(val))
	buf := make([]byte, 0, sha1.Size)
	sum := h.Sum(buf)
	ival := binary.BigEndian.Uint16(sum)
	return float64(ival) / float64(1<<16)
}

func (r *Rule2) evaluate(rnd flags.Rand, seed string, properties, defaultTags map[string]string) (bool, error) {
	if r.Percent >= PercentOn {
		return true, nil
	}
	if r.Percent <= PercentOff {
		return false, nil
	}

	if r.HashBy == HashByRandom {
		return rnd.Float64() < r.Percent, nil
	}

	val, found := properties[r.HashBy]
	if !found {
		val = defaultTags[r.HashBy]
	}
	return r.hashValue(seed, val) < r.Percent, nil
}

repository: stripe/goforit

repo_name: stripe/goforit

gha_license_id: MIT


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

namespace BraviaControl.Extensions
{
    public static class BraviaControlClientExtension
    {
        public static async Task<bool> IsStandbyAsync(this BraviaControlClient.ISystem system)
        {
            return ((await system.GetPowerStatusAsync().ConfigureAwait(false)).Status == "standby");
        }
        public static async Task<bool> IsActiveAsync(this BraviaControlClient.ISystem system)
        {
            return ((await system.GetPowerStatusAsync().ConfigureAwait(false)).Status == "active");
        }
    }
}

repository: xiaolaba/BraviaControl

repo_name: xiaolaba/BraviaControl