ShiboSoftwareDev/am69-pi5
A 85×56 mm 10-layer AM69A single-board computer carrier integrates 8 GiB LPDDR4, 32 GB eMMC, Pi-style expansion and multimedia/USB/Ethernet connectors, multi-rail PMIC power, STM32 boot/power control, USB-C PD, SD/fan protection, and HDI-controlled high-speed routing.
- Version
- 0.0.8-engineering-draft-20261107-dqs19
- 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-pi5 # download the package files into ./am69-pi5
tsci add ShiboSoftwareDev/am69-pi5 # add it to your project as @tsci/ShiboSoftwareDev.am69-pi5In 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/pd_contract.c
#include "pd_contract.h"
bool pd_snapshot_5v_5a(const PdSnapshot *s) {
if(!s->transfer_ok||!s->sink_enabled)return false;
if((s->port&0xe9u)!=0x41u||(s->typec&31u)!=2u||(s->monitor&14u)!=10u)return false;
if((s->pe_before!=0x18u&&s->pe_before!=0x19u)||(s->pe_after!=0x18u&&s->pe_after!=0x19u))return false;
if((s->pdo_count&7u)!=1u||(s->pdo1>>30)!=0u)return false;
if(((s->pdo1>>10)&1023u)!=100u||(s->pdo1&1023u)!=500u)return false;
uint32_t r=s->rdo_before;
if(r!=s->rdo_after||((r>>28)&15u)!=1u||(r&((1u<<27)|(1u<<26))))return false;
return ((r>>10)&1023u)==500u&&(r&1023u)==500u;
}
bool pd_qualify(PdQualification *q,const PdSnapshot *s,uint32_t now) {
bool valid=pd_snapshot_5v_5a(s);
if(!valid||(q->candidate&&(uint32_t)(now-q->last_sample)>40u)) {
q->candidate=false;q->allowed=false;
}
q->last_sample=now;
if(valid) {
if(!q->candidate){q->candidate=true;q->since=now;}
q->allowed=(uint32_t)(now-q->since)>=100u;
}
return q->allowed;
}