ShiboSoftwareDev/am69-cm5
A 55×40 mm 10-layer CM5 carrier board integrating an AM69A98 SoC, 8‑GiB LPDDR4, 32‑GB eMMC, CM5 connectors, clocking, extensive decoupling/EMI filtering, and HDI DDR/ground escape routing.
- Version
- 0.0.7-engineering-draft-20261107-manual-ddr0
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone ShiboSoftwareDev/am69-cm5 # download the package files into ./am69-cm5
tsci add ShiboSoftwareDev/am69-cm5 # add it to your project as @tsci/ShiboSoftwareDev.am69-cm5In 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.
firmware/boot-controller/test_pd_contract.c
#include "pd_contract.h"
#include <assert.h>
#include <stdio.h>
static PdSnapshot valid(void) {
return (PdSnapshot){.transfer_ok=true,.sink_enabled=true,.port=0x41,.typec=2,.monitor=10,.pe_before=0x18,.pe_after=0x18,.pdo_count=1,.pdo1=(100u<<10)|500u,.rdo_before=(1u<<28)|(500u<<10)|500u,.rdo_after=(1u<<28)|(500u<<10)|500u};
}
int main(void) {
PdSnapshot s=valid();assert(pd_snapshot_5v_5a(&s));
for(unsigned ma=0;ma<500;ma++){s=valid();s.rdo_before=s.rdo_after=(1u<<28)|(ma<<10)|500u;assert(!pd_snapshot_5v_5a(&s));}
for(unsigned voltage=0;voltage<1024;voltage++){s=valid();s.pdo1=(voltage<<10)|500;assert(pd_snapshot_5v_5a(&s)==(voltage==100));}
s=valid();s.transfer_ok=false;assert(!pd_snapshot_5v_5a(&s));
s=valid();s.sink_enabled=false;assert(!pd_snapshot_5v_5a(&s));
s=valid();s.port=0x61;assert(!pd_snapshot_5v_5a(&s)); // Debug accessory.
s=valid();s.pdo_count=3;assert(!pd_snapshot_5v_5a(&s)); // Unprogrammed profile.
s=valid();s.rdo_before|=1u<<26;s.rdo_after=s.rdo_before;assert(!pd_snapshot_5v_5a(&s));
s=valid();s.rdo_before^=1;assert(!pd_snapshot_5v_5a(&s));
for(unsigned pe=0;pe<256;pe++){s=valid();s.pe_before=s.pe_after=pe;assert(pd_snapshot_5v_5a(&s)==(pe==24||pe==25));}
PdQualification q={0};s=valid();for(unsigned t=0;t<=90;t+=10)assert(!pd_qualify(&q,&s,t));assert(pd_qualify(&q,&s,100));
s.transfer_ok=false;assert(!pd_qualify(&q,&s,101));s=valid();assert(!pd_qualify(&q,&s,110));
for(unsigned t=120;t<=210;t+=10){pd_qualify(&q,&s,t);}
assert(q.allowed);assert(!pd_qualify(&q,&s,260)); // Stale sample.
q=(PdQualification){0};for(uint32_t t=0;t<=100;t+=10)pd_qualify(&q,&s,UINT32_MAX-50+t);assert(q.allowed);
puts("PASS: only coherent 5V/5A explicit contracts enable power; fallback, stale/error and reset states reject");
}