button_debounce.drawio 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <mxfile host="65bd71144e" modified="2021-01-21T12:39:13.224Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.52.1 Chrome/83.0.4103.122 Electron/9.3.5 Safari/537.36" etag="U1DblBtae2Tq2P1CyZ1p" version="13.10.0" type="embed">
  2. <diagram id="mV5jdOatQLIAx37v0qYi" name="Page-1">
  3. <mxGraphModel dx="461" dy="417" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
  4. <root>
  5. <mxCell id="0"/>
  6. <mxCell id="1" parent="0"/>
  7. <mxCell id="4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="2" target="3" edge="1">
  8. <mxGeometry relative="1" as="geometry"/>
  9. </mxCell>
  10. <mxCell id="2" value="button_debounce&lt;br&gt;start" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
  11. <mxGeometry x="80" y="1120" width="120" height="80" as="geometry"/>
  12. </mxCell>
  13. <mxCell id="27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="3" target="26" edge="1">
  14. <mxGeometry relative="1" as="geometry"/>
  15. </mxCell>
  16. <mxCell id="3" value="button_timer &amp;lt;= 0;" style="whiteSpace=wrap;html=1;align=center;spacingLeft=0;" parent="1" vertex="1">
  17. <mxGeometry x="80" y="1240" width="120" height="40" as="geometry"/>
  18. </mxCell>
  19. <mxCell id="33" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="5" target="32">
  20. <mxGeometry relative="1" as="geometry"/>
  21. </mxCell>
  22. <mxCell id="40" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="5" target="39">
  23. <mxGeometry relative="1" as="geometry"/>
  24. </mxCell>
  25. <mxCell id="5" value="button_timer = 2**20-1" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
  26. <mxGeometry x="85" y="1440" width="110" height="100" as="geometry"/>
  27. </mxCell>
  28. <mxCell id="28" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="26" target="5" edge="1">
  29. <mxGeometry relative="1" as="geometry"/>
  30. </mxCell>
  31. <mxCell id="26" value="wait for&amp;nbsp;rising_edge(clk)" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;align=center;" parent="1" vertex="1">
  32. <mxGeometry x="47" y="1360" width="186" height="40" as="geometry"/>
  33. </mxCell>
  34. <mxCell id="35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="32" target="34">
  35. <mxGeometry relative="1" as="geometry"/>
  36. </mxCell>
  37. <mxCell id="32" value="button_timer &amp;lt;= 0;" style="whiteSpace=wrap;html=1;align=center;spacingLeft=0;" vertex="1" parent="1">
  38. <mxGeometry x="80" y="1580" width="120" height="40" as="geometry"/>
  39. </mxCell>
  40. <mxCell id="37" value="loop" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="34">
  41. <mxGeometry x="-0.3333" y="14" relative="1" as="geometry">
  42. <mxPoint x="140" y="1790" as="targetPoint"/>
  43. <mxPoint as="offset"/>
  44. </mxGeometry>
  45. </mxCell>
  46. <mxCell id="41" value="finally" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="34">
  47. <mxGeometry x="-0.9621" y="7" relative="1" as="geometry">
  48. <mxPoint x="140" y="1320" as="targetPoint"/>
  49. <Array as="points">
  50. <mxPoint x="450" y="1704"/>
  51. <mxPoint x="450" y="1320"/>
  52. </Array>
  53. <mxPoint as="offset"/>
  54. </mxGeometry>
  55. </mxCell>
  56. <mxCell id="34" value="for id in 0 to 7" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
  57. <mxGeometry x="85" y="1654" width="110" height="100" as="geometry"/>
  58. </mxCell>
  59. <mxCell id="38" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="36" target="34">
  60. <mxGeometry relative="1" as="geometry">
  61. <Array as="points">
  62. <mxPoint x="140" y="1850"/>
  63. <mxPoint x="30" y="1850"/>
  64. <mxPoint x="30" y="1704"/>
  65. </Array>
  66. </mxGeometry>
  67. </mxCell>
  68. <mxCell id="36" value="button_states(id) &amp;lt;= buttons(id);" style="whiteSpace=wrap;html=1;align=center;spacingLeft=0;" vertex="1" parent="1">
  69. <mxGeometry x="50" y="1790" width="180" height="40" as="geometry"/>
  70. </mxCell>
  71. <mxCell id="42" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="39">
  72. <mxGeometry relative="1" as="geometry">
  73. <mxPoint x="140" y="1320" as="targetPoint"/>
  74. <Array as="points">
  75. <mxPoint x="335" y="1704"/>
  76. <mxPoint x="450" y="1704"/>
  77. <mxPoint x="450" y="1320"/>
  78. </Array>
  79. </mxGeometry>
  80. </mxCell>
  81. <mxCell id="39" value="button_timer &amp;lt;= button_timer + 1;" style="whiteSpace=wrap;html=1;align=center;spacingLeft=0;" vertex="1" parent="1">
  82. <mxGeometry x="240" y="1580" width="190" height="40" as="geometry"/>
  83. </mxCell>
  84. </root>
  85. </mxGraphModel>
  86. </diagram>
  87. </mxfile>