MustafaMulla29/bluetooth-connected-pedometer
It defines a PCB footprint and schematic symbol for a row of solder pads used as wire connection points, featuring customizable spacing and label annotations.
- Version
- 0.3.0
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone MustafaMulla29/bluetooth-connected-pedometer # download the package files into ./bluetooth-connected-pedometer
tsci add MustafaMulla29/bluetooth-connected-pedometer # add it to your project as @tsci/MustafaMulla29.bluetooth-connected-pedometerIn 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.
scripts/check_architecture.py
#!/usr/bin/env python3
"""Electrical topology invariants not covered by a generic netlist syntax check."""
import json
from pathlib import Path
root = Path(__file__).resolve().parents[1]
items = json.loads((root/'dist/index/circuit.json').read_text())
parent={}
def find(x):
parent.setdefault(x,x)
if parent[x]!=x: parent[x]=find(parent[x])
return parent[x]
def union(a,b): parent[find(a)]=find(b)
for t in (o for o in items if o['type']=='source_trace'):
ids=t.get('connected_source_port_ids',[])+t.get('connected_source_net_ids',[])
for x in ids[1:]: union(ids[0],x)
components={o['source_component_id']:o['name'] for o in items if o['type']=='source_component'}
nets={o['name']:o['source_net_id'] for o in items if o['type']=='source_net'}
ports={(components[o['source_component_id']],o['name']):o['source_port_id'] for o in items if o['type']=='source_port' and o['source_component_id'] in components}
def on(component,pin,net):
assert find(ports[component,pin])==find(nets[net]),f'{component}.{pin} is not on {net}'
for component,pin,net in [
('U3','BAT','VBAT_PACK'),('U3','SRX','VBAT_SYS'),
('U2','BAT','VBAT_SYS'),('U2','SYS','VSYS'),
('U2','TS_MR','BAT_NTC'),('U2','THERMAL','GND'),
('U6','VIN','V3V3'),('U6','VOUT','OLED_VCC'),
('U6','ON','OLED_EN'),('U6','QOD','OLED_VCC'),
('C18','pin1','OLED_CT'),('C18','pin2','V3V3'),
('R1','pin1','OLED_EN'),('R1','pin2','GND'),
('U4','OUT','V3V3'),('U1','VCC','V3V3'),
('U1','GND1','GND'),('U1','GND2','GND'),('U1','GND3','GND'),('U1','GND4','GND'),
('U1','DIO23','OLED_SDA'),('U1','DIO5','OLED_SCL'),('U1','DIO21','OLED_EN'),
('U1','DIO18','ACC_INT'),('U1','DIO20','BUTTON_N'),('U1','DIO11','CHG_PG_N'),
('U1','DIO12','SDA'),('U1','DIO24','SCL'),
('U5','CSB','V3V3'),('U5','SDO','GND')]: on(component,pin,net)
independent=['GND','VCHG','VSYS','VBAT_PACK','VBAT_SYS','V3V3','OLED_VCC','SDA','SCL','OLED_SDA','OLED_SCL','OLED_EN','OLED_CT']
assert len({find(nets[n]) for n in independent})==len(independent),'Power rails or independent I2C signals have been shorted in the schematic'
print('PASS: gauge high-side path, logic voltage domain, display isolation and I2C straps.')