ShiboSoftwareDev/mspm0g3507-usb-c-dev-board

This circuit features a USB Type-C connector with integrated resistors and passives, a USB ESD protection device, a CH340 USB-to-serial interface chip, a 3.3V regulator (AP2112K), multiple decoupling and bulk capacitors, and a Microcontroller (MSPM0G3507) with associated I2C and SPI connections, providing USB communication, power regulation, and RGB LED control.

Version
1.4.1
License
unset
Stars
0

scripts/sync-gerber-assembly.mjs

import { copyFileSync, mkdtempSync, rmSync } from "node:fs"
import { tmpdir } from "node:os"
import { basename, join, resolve } from "node:path"
import { execFileSync } from "node:child_process"

const zipPath = resolve("outputs/MSPM0G3507_USB_C_JLCPCB_Gerbers.zip")
const bomPath = resolve("outputs/MSPM0G3507_USB_C_JLCPCB_BOM.csv")
const cplPath = resolve("outputs/MSPM0G3507_USB_C_JLCPCB_CPL.csv")
const stagingDirectory = mkdtempSync(join(tmpdir(), "mspm0-gerber-assembly-"))

try {
  const stagedBom = join(stagingDirectory, "bom.csv")
  const stagedCpl = join(stagingDirectory, "pick_and_place.csv")
  copyFileSync(bomPath, stagedBom)
  copyFileSync(cplPath, stagedCpl)
  execFileSync("zip", ["-d", zipPath, basename(stagedBom), basename(stagedCpl)], {
    stdio: "ignore",
  })
  execFileSync("zip", ["-j", zipPath, stagedBom, stagedCpl], { stdio: "ignore" })
  console.log("Synchronized manufacturer-rich BOM and CPL into the Gerber ZIP")
} finally {
  rmSync(stagingDirectory, { recursive: true, force: true })
}