seveibar/adm6-breakout

This code defines PCB designs featuring a 60-pin fanout or direct routing layout with multiple signal and power layers, test pads, and component footprints for a high-density electronic breakout board.

Version
1.0.2
License
unset
Stars
0

pin-mapping.ts

// Seeded Fisher-Yates selection: 30 unique contacts from all 240 ADM6 pins.
// Keep the seed fixed so rerenders and routing comparisons use the same nets.
export const CONNECTOR_SELECTION_SEED = 0x2040060
export const CONNECTOR_ROWS = ["A", "B", "C", "D"] as const

const selectConnectorContacts = () => {
  let state = CONNECTOR_SELECTION_SEED
  const contacts = CONNECTOR_ROWS.flatMap((row) =>
    Array.from({ length: 60 }, (_, i) => `${row}${String(i + 1).padStart(2, "0")}`),
  )
  for (let i = contacts.length - 1; i > 0; i--) {
    state = (Math.imul(1664525, state) + 1013904223) >>> 0
    const j = Math.floor((state / 0x100000000) * (i + 1))
    ;[contacts[i], contacts[j]] = [contacts[j], contacts[i]]
  }
  return contacts.slice(0, 30)
}

export const pinMappings = selectConnectorContacts().map((contact, index) => ({
  contact,
  gpio: index < 26 ? `GPIO${index}` : `GPIO${index}_ADC${index - 26}`,
  name: `GPIO${index}_TO_ADM6_${contact}`,
}))