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-keyboardIn 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/RadioFrontend.tsx
import * as React from 'react'
import nordic from './generated/nordic-config5-layout.json'
import type { Half } from './mechanicalGeometry'
import { Passives,type PassiveSpec } from './components'
/** Protected surface RF paths are persisted with the complete routing solution.
* Three-component QIAA match v1.1, valid at initial TX ceiling +4 dBm.
* Antenna tee values require VNA tuning on the manufactured stackup.
*/
export const rfNets=['RF_ANT','RF_50','RF_TUNE','RF_FEED'] as const
export const antennaZone=(half:Half)=>({x:half==='right'?-61.5:47,y:49,width:6.5,height:6.5})
export function RadioFrontend({half}:{half:Half}) {
const zone=antennaZone(half)
const x=half==='right'?-62:47
const specs:PassiveSpec[]=[
{ref:'C_RF1',kind:'C',value:'0.8pF',from:'RF_ANT',to:'GND',...nordic.C3,rotation:(nordic.C3.rotation+180)%360},
{ref:'L_RF1',kind:'L',value:'4.7nH',from:'RF_ANT',to:'RF_50',...nordic.L1},
{ref:'C_RF2',kind:'C',value:'0.5pF',from:'RF_50',to:'GND',...nordic.C4,rotation:(nordic.C4.rotation+180)%360},
{ref:'R_RF_T1',kind:'R',value:'0',from:'RF_50',to:'RF_TUNE',dx:-8,dy:4,rotation:270},
{ref:'R_RF_T2',kind:'R',value:'0',from:'RF_TUNE',to:'RF_FEED',dx:-8,dy:8,rotation:270},
{ref:'C_ANT_TUNE',kind:'C',value:'1pF',from:'RF_TUNE',to:'GND',dx:-9,dy:6,doNotPlace:true},
]
return <>
<schematicsection name="rf" displayName="" sectionTitleFontSize={.4}/>
<schematictext text="RF match + antenna" schX={81.25} schY={10.5} fontSize={.4} anchor="left"/>
<Passives half={half} anchor="U1" section="rf" specs={specs} schX={82} schY={8}/>
<chip name="ANT1" manufacturerPartNumber="2450AT18A0100002E" pinLabels={{pin1:'FEED',pin2:'NC_ANCHOR'}}
pinAttributes={{pin1:{isPassive:true,requiresPower:false,requiresGround:false},pin2:{doNotConnect:true}}}
footprint={<footprint>
<smtpad shape="rect" width={0.8} height={1.6} pcbX={-1.7} pcbY={0} portHints={['pin1']}/>
<smtpad shape="rect" width={0.8} height={1.6} pcbX={1.7} pcbY={0} portHints={['pin2']}/>
<courtyardrect width={4.7} height={2.1}/>
</footprint>}
pcbX={x} pcbY={49} pcbRotation={270} layer="bottom" schX={88} schY={2} schSectionName="rf"
connections={{FEED:'net.RF_FEED'}} />
<keepout shape="rect" pcbX={zone.x} pcbY={zone.y} width={zone.width} height={zone.height}
layers={['top','inner1','inner2','bottom']} excludeRefs={['.ANT1']}/>
<keepout shape="rect" pcbX={half==='right'?-60:48} pcbY={34.3} width={4.75} height={2.4}
layers={['inner1','inner2']}/>
</>
}