Files
Kevin Thomas f62db776e1 Initial commit
2026-07-06 14:32:12 -04:00

80 lines
3.6 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"/>
<rect class="hdr" x="0" y="0" width="1200" height="100" rx="0"/>
<text class="title" x="600" y="52" text-anchor="middle">Pico SDK Macro Chain</text>
<text class="dim" x="600" y="88" text-anchor="middle">From I2C_PORT to Hardware Registers</text>
<!-- Chain visualization -->
<rect class="pnl" x="30" y="110" width="1140" height="480" rx="8"/>
<text class="sub" x="50" y="145">Macro Expansion Chain</text>
<!-- Step 1 -->
<rect x="50" y="165" width="280" height="55" rx="6" fill="#00ff41" fill-opacity="0.1" stroke="#00ff41"/>
<text class="grn" x="70" y="200">I2C_PORT</text>
<text class="dim" x="50" y="240">#define I2C_PORT i2c1</text>
<!-- Arrow 1 -->
<text class="txt" x="350" y="200">--></text>
<!-- Step 2 -->
<rect x="400" y="165" width="280" height="55" rx="6" fill="#00d4ff" fill-opacity="0.1" stroke="#00d4ff"/>
<text class="cyn" x="420" y="200">i2c1</text>
<text class="dim" x="400" y="240">#define i2c1 (&amp;i2c1_inst)</text>
<!-- Arrow 2 -->
<text class="txt" x="700" y="200">--></text>
<!-- Step 3 -->
<rect x="750" y="165" width="380" height="55" rx="6" fill="#ffaa00" fill-opacity="0.1" stroke="#ffaa00"/>
<text class="amb" x="770" y="200">&amp;i2c1_inst</text>
<text class="dim" x="750" y="240">Address of global struct</text>
<!-- Step 4: struct contents -->
<text class="sub" x="50" y="285">Struct Contents at 0x2000062C</text>
<rect x="50" y="300" width="1080" height="130" rx="6" fill="#0a0a0f" stroke="#1a1a2e"/>
<text class="txt" x="70" y="335">i2c_inst_t i2c1_inst = {</text>
<text class="txt" x="100" y="365">.hw = (i2c_hw_t *)0x40098000,</text>
<text class="txt" x="100" y="395">.restart_on_next = false</text>
<text class="txt" x="70" y="420">};</text>
<!-- Arrow to hardware -->
<text class="sub" x="50" y="445">Hardware Register Access</text>
<rect x="50" y="460" width="1080" height="110" rx="6" fill="#0a0a0f" stroke="#ff0040" stroke-width="1"/>
<text class="txt" x="70" y="490">i2c1_inst.hw</text>
<text class="txt" x="290" y="490">--></text>
<text class="amb" x="340" y="490">i2c1_hw</text>
<text class="txt" x="460" y="490">--></text>
<text class="red" x="510" y="490">(i2c_hw_t*)0x40098000</text>
<text class="dim" x="70" y="525">I2C1_BASE = 0x40098000</text>
<text class="dim" x="500" y="525">I2C0_BASE = 0x40090000</text>
<text class="dim" x="70" y="555">Direct memory-mapped I/O to RP2350 peripheral</text>
<!-- Bottom: Summary Box -->
<rect class="pnl" x="30" y="605" width="1140" height="85" rx="8"/>
<text class="red" x="50" y="640">FULL CHAIN:</text>
<text class="grn" x="240" y="640">I2C_PORT</text>
<text class="txt" x="390" y="640">--></text>
<text class="cyn" x="435" y="640">i2c1</text>
<text class="txt" x="510" y="640">--></text>
<text class="amb" x="555" y="640">&amp;i2c1_inst</text>
<text class="txt" x="720" y="640">--></text>
<text class="red" x="770" y="640">0x40098000</text>
<text class="dim" x="50" y="670">Macro --> Macro --> Struct pointer --> HW register base</text>
<!-- Footer -->
</svg>