rushabhcodes/usb-c-e-paper-display

USB-C powered RP2354B controller board with protected power regulation, EPD display interface and charge-pump rails, crystal timing, user/boot switches, status LEDs, and SWD test points.

Version
1.4.1
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone rushabhcodes/usb-c-e-paper-display  # download the package files into ./usb-c-e-paper-display
tsci add rushabhcodes/usb-c-e-paper-display    # add it to your project as @tsci/rushabhcodes.usb-c-e-paper-display

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

product/rp2354b-pin-metadata.ts

import type { AnyCircuitElement } from "circuit-json"

// The supplier's generated record assigns UART/I2C GPIO functions to the USB
// and dedicated QMI pins. Correct those facts from Raspberry Pi's RP2350
// datasheet, RP2350B pin table and RP2354 stacked-flash section. All electrical
// checks remain enabled; other supplier metadata is preserved.
export function correctRp2354bPinMetadata(elements: AnyCircuitElement[]) {
  const dedicated = new Set([66, 67, 70, 71, 72, 73, 74, 75])
  return elements.map(element => {
    if (element.type !== "source_port" || !dedicated.has(element.pin_number!)) return element
    const corrected = {...element}
    for (const key of Object.keys(corrected)) {
      if (key.startsWith("supports_")) delete (corrected as Record<string, unknown>)[key]
    }
    return {...corrected, is_gpio: false}
  })
}