mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
This PR adds a software SPI implementation. Firstly this removes the absolute necessity for spidev (#140), which also means when it's not present things still work (effectively fixes #185), and also enables any four pins to be used for SPI devices (which don't require the hardware implementation). The software implementation is simplistic but still supports clock polarity and phase, select-high, and variable bits per word. However it doesn't allow precise speeds to be implemented because it just wibbles the clock as fast as it can (which being pure Python isn't actually that fast). Finally, because this PR involves creating a framework for "shared" devices (like SPI devices with multiple channels), it made sense to bung Energenie (#69) in as wells as this is a really simple shared device.
159 lines
9.6 KiB
XML
159 lines
9.6 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
|
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
<!-- Generated by graphviz version 2.36.0 (20140111.2315)
|
|
-->
|
|
<!-- Title: classes Pages: 1 -->
|
|
<svg width="557pt" height="404pt"
|
|
viewBox="0.00 0.00 557.00 404.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 400)">
|
|
<title>classes</title>
|
|
<polygon fill="white" stroke="none" points="-4,4 -4,-400 553,-400 553,4 -4,4"/>
|
|
<!-- Device -->
|
|
<g id="node1" class="node"><title>Device</title>
|
|
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="341,-396 287,-396 287,-360 341,-360 341,-396"/>
|
|
<text text-anchor="middle" x="314" y="-375.5" font-family="Sans" font-size="10.00" fill="#000000">Device</text>
|
|
</g>
|
|
<!-- GPIODevice -->
|
|
<g id="node2" class="node"><title>GPIODevice</title>
|
|
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="350,-324 278,-324 278,-288 350,-288 350,-324"/>
|
|
<text text-anchor="middle" x="314" y="-303.5" font-family="Sans" font-size="10.00" fill="#000000">GPIODevice</text>
|
|
</g>
|
|
<!-- GPIODevice->Device -->
|
|
<g id="edge1" class="edge"><title>GPIODevice->Device</title>
|
|
<path fill="none" stroke="black" d="M314,-324.303C314,-332.017 314,-341.288 314,-349.888"/>
|
|
<polygon fill="black" stroke="black" points="310.5,-349.896 314,-359.896 317.5,-349.896 310.5,-349.896"/>
|
|
</g>
|
|
<!-- WaitableInputDevice -->
|
|
<g id="node3" class="node"><title>WaitableInputDevice</title>
|
|
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="296.5,-180 183.5,-180 183.5,-144 296.5,-144 296.5,-180"/>
|
|
<text text-anchor="middle" x="240" y="-159.5" font-family="Sans" font-size="10.00" fill="#000000">WaitableInputDevice</text>
|
|
</g>
|
|
<!-- InputDevice -->
|
|
<g id="node5" class="node"><title>InputDevice</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="294.5,-252 221.5,-252 221.5,-216 294.5,-216 294.5,-252"/>
|
|
<text text-anchor="middle" x="258" y="-231.5" font-family="Sans" font-size="10.00" fill="#ffffff">InputDevice</text>
|
|
</g>
|
|
<!-- WaitableInputDevice->InputDevice -->
|
|
<g id="edge3" class="edge"><title>WaitableInputDevice->InputDevice</title>
|
|
<path fill="none" stroke="black" d="M244.449,-180.303C246.455,-188.102 248.869,-197.491 251.101,-206.171"/>
|
|
<polygon fill="black" stroke="black" points="247.722,-207.082 253.602,-215.896 254.501,-205.339 247.722,-207.082"/>
|
|
</g>
|
|
<!-- SmoothedInputDevice -->
|
|
<g id="node4" class="node"><title>SmoothedInputDevice</title>
|
|
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="174.5,-108 51.5,-108 51.5,-72 174.5,-72 174.5,-108"/>
|
|
<text text-anchor="middle" x="113" y="-87.5" font-family="Sans" font-size="10.00" fill="#000000">SmoothedInputDevice</text>
|
|
</g>
|
|
<!-- SmoothedInputDevice->WaitableInputDevice -->
|
|
<g id="edge5" class="edge"><title>SmoothedInputDevice->WaitableInputDevice</title>
|
|
<path fill="none" stroke="black" d="M144.068,-108.124C160.827,-117.361 181.706,-128.869 199.702,-138.788"/>
|
|
<polygon fill="black" stroke="black" points="198.366,-142.048 208.813,-143.81 201.745,-135.918 198.366,-142.048"/>
|
|
</g>
|
|
<!-- InputDevice->GPIODevice -->
|
|
<g id="edge2" class="edge"><title>InputDevice->GPIODevice</title>
|
|
<path fill="none" stroke="black" d="M271.843,-252.303C278.489,-260.611 286.578,-270.723 293.887,-279.859"/>
|
|
<polygon fill="black" stroke="black" points="291.336,-282.273 300.317,-287.896 296.803,-277.901 291.336,-282.273"/>
|
|
</g>
|
|
<!-- DigitalInputDevice -->
|
|
<g id="node6" class="node"><title>DigitalInputDevice</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="295.5,-108 192.5,-108 192.5,-72 295.5,-72 295.5,-108"/>
|
|
<text text-anchor="middle" x="244" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">DigitalInputDevice</text>
|
|
</g>
|
|
<!-- DigitalInputDevice->WaitableInputDevice -->
|
|
<g id="edge4" class="edge"><title>DigitalInputDevice->WaitableInputDevice</title>
|
|
<path fill="none" stroke="black" d="M243.011,-108.303C242.57,-116.017 242.041,-125.288 241.549,-133.888"/>
|
|
<polygon fill="black" stroke="black" points="238.054,-133.712 240.977,-143.896 245.042,-134.112 238.054,-133.712"/>
|
|
</g>
|
|
<!-- Button -->
|
|
<g id="node7" class="node"><title>Button</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="271,-36 217,-36 217,-0 271,-0 271,-36"/>
|
|
<text text-anchor="middle" x="244" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">Button</text>
|
|
</g>
|
|
<!-- Button->DigitalInputDevice -->
|
|
<g id="edge6" class="edge"><title>Button->DigitalInputDevice</title>
|
|
<path fill="none" stroke="black" d="M244,-36.3034C244,-44.0173 244,-53.2875 244,-61.8876"/>
|
|
<polygon fill="black" stroke="black" points="240.5,-61.8956 244,-71.8957 247.5,-61.8957 240.5,-61.8956"/>
|
|
</g>
|
|
<!-- MotionSensor -->
|
|
<g id="node8" class="node"><title>MotionSensor</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="82.5,-36 -0.5,-36 -0.5,-0 82.5,-0 82.5,-36"/>
|
|
<text text-anchor="middle" x="41" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">MotionSensor</text>
|
|
</g>
|
|
<!-- MotionSensor->SmoothedInputDevice -->
|
|
<g id="edge7" class="edge"><title>MotionSensor->SmoothedInputDevice</title>
|
|
<path fill="none" stroke="black" d="M58.7978,-36.3034C67.604,-44.865 78.3821,-55.3438 88.0011,-64.6955"/>
|
|
<polygon fill="black" stroke="black" points="85.7972,-67.4343 95.407,-71.8957 90.6768,-62.4154 85.7972,-67.4343"/>
|
|
</g>
|
|
<!-- LightSensor -->
|
|
<g id="node9" class="node"><title>LightSensor</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="175,-36 101,-36 101,-0 175,-0 175,-36"/>
|
|
<text text-anchor="middle" x="138" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">LightSensor</text>
|
|
</g>
|
|
<!-- LightSensor->SmoothedInputDevice -->
|
|
<g id="edge8" class="edge"><title>LightSensor->SmoothedInputDevice</title>
|
|
<path fill="none" stroke="black" d="M131.82,-36.3034C129.005,-44.1868 125.609,-53.6958 122.481,-62.4536"/>
|
|
<polygon fill="black" stroke="black" points="119.176,-61.301 119.109,-71.8957 125.768,-63.6554 119.176,-61.301"/>
|
|
</g>
|
|
<!-- OutputDevice -->
|
|
<g id="node10" class="node"><title>OutputDevice</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="412,-252 330,-252 330,-216 412,-216 412,-252"/>
|
|
<text text-anchor="middle" x="371" y="-231.5" font-family="Sans" font-size="10.00" fill="#ffffff">OutputDevice</text>
|
|
</g>
|
|
<!-- OutputDevice->GPIODevice -->
|
|
<g id="edge9" class="edge"><title>OutputDevice->GPIODevice</title>
|
|
<path fill="none" stroke="black" d="M356.91,-252.303C350.077,-260.695 341.743,-270.93 334.244,-280.139"/>
|
|
<polygon fill="black" stroke="black" points="331.528,-277.931 327.928,-287.896 336.956,-282.351 331.528,-277.931"/>
|
|
</g>
|
|
<!-- DigitalOutputDevice -->
|
|
<g id="node11" class="node"><title>DigitalOutputDevice</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="427,-180 315,-180 315,-144 427,-144 427,-180"/>
|
|
<text text-anchor="middle" x="371" y="-159.5" font-family="Sans" font-size="10.00" fill="#ffffff">DigitalOutputDevice</text>
|
|
</g>
|
|
<!-- DigitalOutputDevice->OutputDevice -->
|
|
<g id="edge10" class="edge"><title>DigitalOutputDevice->OutputDevice</title>
|
|
<path fill="none" stroke="black" d="M371,-180.303C371,-188.017 371,-197.288 371,-205.888"/>
|
|
<polygon fill="black" stroke="black" points="367.5,-205.896 371,-215.896 374.5,-205.896 367.5,-205.896"/>
|
|
</g>
|
|
<!-- LED -->
|
|
<g id="node12" class="node"><title>LED</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="375,-108 321,-108 321,-72 375,-72 375,-108"/>
|
|
<text text-anchor="middle" x="348" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">LED</text>
|
|
</g>
|
|
<!-- LED->DigitalOutputDevice -->
|
|
<g id="edge11" class="edge"><title>LED->DigitalOutputDevice</title>
|
|
<path fill="none" stroke="black" d="M353.685,-108.303C356.248,-116.102 359.333,-125.491 362.185,-134.171"/>
|
|
<polygon fill="black" stroke="black" points="358.933,-135.488 365.38,-143.896 365.584,-133.303 358.933,-135.488"/>
|
|
</g>
|
|
<!-- Buzzer -->
|
|
<g id="node13" class="node"><title>Buzzer</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="447,-108 393,-108 393,-72 447,-72 447,-108"/>
|
|
<text text-anchor="middle" x="420" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">Buzzer</text>
|
|
</g>
|
|
<!-- Buzzer->DigitalOutputDevice -->
|
|
<g id="edge12" class="edge"><title>Buzzer->DigitalOutputDevice</title>
|
|
<path fill="none" stroke="black" d="M407.888,-108.303C402.132,-116.526 395.138,-126.517 388.794,-135.579"/>
|
|
<polygon fill="black" stroke="black" points="385.84,-133.696 382.973,-143.896 391.575,-137.71 385.84,-133.696"/>
|
|
</g>
|
|
<!-- PWMOutputDevice -->
|
|
<g id="node14" class="node"><title>PWMOutputDevice</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="549,-180 445,-180 445,-144 549,-144 549,-180"/>
|
|
<text text-anchor="middle" x="497" y="-159.5" font-family="Sans" font-size="10.00" fill="#ffffff">PWMOutputDevice</text>
|
|
</g>
|
|
<!-- PWMOutputDevice->OutputDevice -->
|
|
<g id="edge13" class="edge"><title>PWMOutputDevice->OutputDevice</title>
|
|
<path fill="none" stroke="black" d="M466.177,-180.124C449.55,-189.361 428.835,-200.869 410.981,-210.788"/>
|
|
<polygon fill="black" stroke="black" points="408.983,-207.894 401.942,-215.81 412.383,-214.013 408.983,-207.894"/>
|
|
</g>
|
|
<!-- PWMLED -->
|
|
<g id="node15" class="node"><title>PWMLED</title>
|
|
<polygon fill="#2980b9" stroke="#2980b9" points="526,-108 468,-108 468,-72 526,-72 526,-108"/>
|
|
<text text-anchor="middle" x="497" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">PWMLED</text>
|
|
</g>
|
|
<!-- PWMLED->PWMOutputDevice -->
|
|
<g id="edge14" class="edge"><title>PWMLED->PWMOutputDevice</title>
|
|
<path fill="none" stroke="black" d="M497,-108.303C497,-116.017 497,-125.288 497,-133.888"/>
|
|
<polygon fill="black" stroke="black" points="493.5,-133.896 497,-143.896 500.5,-133.896 493.5,-133.896"/>
|
|
</g>
|
|
</g>
|
|
</svg>
|