/** * RISC-V Board visual component — CH32V003F4P6 SOP-20 style. * * Renders a minimal chip outline with: * - 10 pins on each side (PA0-PA7, PC0-PC1 left; PC2-PC7, PD0-PD5 right) * - Built-in LED on PD6 (common test LED on CH32V003 eval boards) * - Green accent color distinct from Arduino blue */ interface RiscVBoardProps { id?: string; x?: number; y?: number; /** PD6 state — built-in LED */ ledBuiltIn?: boolean; } const W = 200; const H = 140; const BX = 40; const BY = 10; const BW = 120; const BH = 120; const PIN_LEN = 34; const PIN_SPACING = 12; const PINS_PER_SIDE = 10; // Y positions for 10 pins, centred in the body const PIN_Y = Array.from({ length: PINS_PER_SIDE }, (_, i) => BY + 5 + i * PIN_SPACING); // Left-side labels (top → bottom): PA0-PA7, PC0, PC1 const LEFT_LABELS = ['PA0', 'PA1', 'PA2', 'PA3', 'PA4', 'PA5', 'PA6', 'PA7', 'PC0', 'PC1']; // Right-side labels (top → bottom): PC2-PC7, PD0-PD5 const RIGHT_LABELS = ['PC2', 'PC3', 'PC4', 'PC5', 'PC6', 'PC7', 'PD0', 'PD1', 'PD2', 'PD3']; export const RiscVBoard = ({ id = 'riscv-generic', x = 0, y = 0, ledBuiltIn = false, }: RiscVBoardProps) => { return ( {/* Pin stubs — left side */} {PIN_Y.map((py, i) => ( ))} {/* Pin stubs — right side */} {PIN_Y.map((py, i) => ( ))} {/* IC body */} {/* Orientation notch */} {/* Pin 1 dot */} {/* Chip label */} CH32V003 RISC-V RV32EC 48 MHz · 16K Flash {/* Built-in LED (PD6) — right side below body */} PD6 {/* Pin labels — left */} {LEFT_LABELS.map((label, i) => ( {label} ))} {/* Pin labels — right */} {RIGHT_LABELS.map((label, i) => ( {label} ))} ); };