mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-07-13 07:36:35 +02:00
75 lines
3.7 KiB
XML
75 lines
3.7 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800">
|
|
<style>
|
|
.bg{fill:#0a0a0f}.pnl{fill:#12121a;stroke:#1a1a2e}.hdr{fill:#12121a}
|
|
.title{font:bold 42px 'Courier New',monospace;fill:#00ff41}
|
|
.sub{font:bold 28px 'Courier New',monospace;fill:#00d4ff}
|
|
.txt{font:24px 'Courier New',monospace;fill:#c0c0c0}
|
|
.dim{font:20px 'Courier New',monospace;fill:#888}
|
|
.grn{font:bold 24px 'Courier New',monospace;fill:#00ff41}
|
|
.red{font:bold 24px 'Courier New',monospace;fill:#ff0040}
|
|
.cyn{font:bold 24px 'Courier New',monospace;fill:#00d4ff}
|
|
.amb{font:bold 24px 'Courier New',monospace;fill:#ffaa00}
|
|
.badge{stroke:#00ff41;rx:14}
|
|
</style>
|
|
<rect class="bg" width="1200" height="800"/>
|
|
|
|
<!-- Title -->
|
|
<text x="600" y="52" text-anchor="middle" class="title">Inline Assembly GPIO</text>
|
|
<text x="600" y="88" text-anchor="middle" class="dim">Direct Hardware Control via ASM</text>
|
|
|
|
<!-- Init Loop -->
|
|
<rect x="40" y="110" width="1120" height="310" rx="8" class="pnl"/>
|
|
<text x="600" y="148" text-anchor="middle" class="sub">GPIO Init Loop (pins 16-19)</text>
|
|
|
|
<rect x="60" y="168" width="340" height="120" rx="6" fill="#0a0a0f" stroke="#00d4ff" stroke-width="1"/>
|
|
<text x="230" y="198" text-anchor="middle" class="cyn">1. Config Pad</text>
|
|
<text x="80" y="228" class="dim">PADS_BANK0</text>
|
|
<text x="80" y="255" class="dim">Clear OD+ISO, set IE</text>
|
|
<text x="80" y="275" class="amb">0x40038000</text>
|
|
|
|
<rect x="420" y="168" width="340" height="120" rx="6" fill="#0a0a0f" stroke="#ffaa00" stroke-width="1"/>
|
|
<text x="590" y="198" text-anchor="middle" class="amb">2. Set Function</text>
|
|
<text x="440" y="228" class="dim">IO_BANK0</text>
|
|
<text x="440" y="255" class="dim">FUNCSEL = 5 (SIO)</text>
|
|
<text x="440" y="275" class="grn">0x40028004</text>
|
|
|
|
<rect x="780" y="168" width="340" height="120" rx="6" fill="#0a0a0f" stroke="#00ff41" stroke-width="1"/>
|
|
<text x="950" y="198" text-anchor="middle" class="grn">3. Enable Out</text>
|
|
<text x="800" y="228" class="dim">GPIO Coprocessor</text>
|
|
<text x="800" y="255" class="dim">mcrr p0,#4,r4,r5,c4</text>
|
|
<text x="800" y="275" class="red">Output Enable</text>
|
|
|
|
<text x="60" y="330" class="txt">Loop: r0 = 16 to 19</text>
|
|
<text x="400" y="330" class="dim">Red, Green, Blue, Yellow LEDs</text>
|
|
<text x="60" y="398" class="dim">Each pin: pad config + function select + OE</text>
|
|
|
|
<!-- Blink Loop -->
|
|
<rect x="40" y="440" width="540" height="190" rx="8" class="pnl"/>
|
|
<text x="310" y="478" text-anchor="middle" class="sub">Blink Loop</text>
|
|
|
|
<rect x="60" y="498" width="500" height="40" rx="4" fill="#0a0a0f" stroke="#00ff41" stroke-width="1"/>
|
|
<text x="80" y="525" class="grn">mcrr p0,#4,r4,r5,c0</text>
|
|
|
|
<text x="60" y="565" class="txt">r4 = pin, r5 = value</text>
|
|
<text x="60" y="595" class="dim">c0 = output value register</text>
|
|
<text x="60" y="615" class="dim">r5=1 ON, r5=0 OFF</text>
|
|
|
|
<!-- Pin Cycling -->
|
|
<rect x="620" y="440" width="540" height="190" rx="8" class="pnl"/>
|
|
<text x="890" y="478" text-anchor="middle" class="sub">Pin Cycling</text>
|
|
|
|
<rect x="640" y="498" width="500" height="75" rx="6" fill="#0a0a0f" stroke="#ffaa00" stroke-width="1"/>
|
|
<text x="660" y="528" class="amb">pin++;</text>
|
|
<text x="660" y="558" class="txt">if (pin > 18) pin=16;</text>
|
|
|
|
<text x="640" y="600" class="dim">Cycles: 16 -> 17 -> 18 -> 16</text>
|
|
<text x="640" y="620" class="dim">Red -> Green -> Blue -> repeat</text>
|
|
|
|
<!-- Key Takeaway -->
|
|
<rect x="40" y="650" width="1120" height="130" rx="8" class="pnl"/>
|
|
<text x="600" y="688" text-anchor="middle" class="sub">Why Inline Assembly?</text>
|
|
<text x="60" y="722" class="txt">gpio_put(16,1) calls</text>
|
|
<text x="390" y="722" class="grn">mcrr</text>
|
|
<text x="470" y="722" class="txt">underneath</text>
|
|
<text x="60" y="752" class="dim">Inline ASM shows what the SDK does at hardware level</text>
|
|
</svg> |