rushabhcodes/wireless-split-keyboard

Wireless Split Keyboard — custom routed nRF52840 split PCBs with a printable enclosure

Version
0.4.5
License
unset
Stars
0

Use with the tscircuit CLI

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

tsci clone rushabhcodes/wireless-split-keyboard  # download the package files into ./wireless-split-keyboard
tsci add rushabhcodes/wireless-split-keyboard    # add it to your project as @tsci/rushabhcodes.wireless-split-keyboard

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.

src/UsbC.tsx

import * as React from 'react'
import type { Half } from './mechanicalGeometry'
import { placement,offsetPlacement,pcbProps } from './componentPlacement'
import { USB4105_GF_A } from '../imports/USB4105_GF_A'
import { TPD2EUSB30ADRTR } from '../imports/TPD2EUSB30ADRTR'
import { Passives,type PassiveSpec } from './components'
export function UsbC({half}:{half:Half}) {
 const specs:PassiveSpec[]=[
 {ref:'R_CC1',kind:'R',value:'5.1k',from:'CC1',to:'GND',dx:-3,dy:7},
 {ref:'R_CC2',kind:'R',value:'5.1k',from:'CC2',to:'GND',dx:0,dy:7,rotation:180},
 {ref:'R_USB_VBUS',kind:'R',value:'2.2',from:'VBUS',to:'VBUS_NRF',dx:3,dy:7},
 ]
 return <>
 <schematicsection name="usb" displayName="USB-C sink + ESD" sectionTitleFontSize={.4}/>
 <USB4105_GF_A name="J_USB" allowOffBoard {...pcbProps(placement(half,'J_USB',{x:-64,y:22,rotation:90,side:'bottom'}))}
  pinAttributes={{SBU1:{doNotConnect:true},SBU2:{doNotConnect:true}}}
  schX={8} schY={-40} schSectionName="usb" schWidth={1.5} schHeight={2.826}
  connections={{VBUS1:'net.VBUS',VBUS2:'net.VBUS',GND1:'net.GND',GND2:'net.GND',CC1:'net.CC1',CC2:'net.CC2',
   DP1:'net.USB_DP',DP2:'net.USB_DP',DN1:'net.USB_DM',DN2:'net.USB_DM',
   VBUS3:'net.VBUS',VBUS4:'net.VBUS',GND3:'net.GND',GND4:'net.GND',EH1:'net.GND',EH2:'net.GND',EH3:'net.GND',EH4:'net.GND'}}/>
 <TPD2EUSB30ADRTR name="U_ESD" {...pcbProps(offsetPlacement(half,'U_ESD','J_USB',0,5))} schX={16} schY={-38} schSectionName="usb"
  pinAttributes={{pin1:{isPassive:true,requiresPower:false,requiresGround:false},pin2:{isPassive:true,requiresPower:false,requiresGround:false},pin3:{requiresGround:true,requiresPower:false}}}
  connections={{pin1:'net.USB_DP',pin2:'net.USB_DM',pin3:'net.GND'}}/>
 <Passives half={half} anchor="J_USB" section="usb" specs={specs} schX={15} schY={-43}/>
 </>
}