AnasSarkiz/usb-c-pd-brushed-motor

USB-C PD-powered motor controller with protected input, selectable 5/9/12 V buck supply, MCU qualification, PWM H-bridge drive, overvoltage sensing, regenerative energy-dump resistors, and safety interlocks.

Version
0.0.1-a48-cloud-pipeline9-unrouted-c41d79a-305b1e7a
License
unset
Stars
0

evidence/cloud-tests-A48.log

$ bun test ./tests
bun test v1.4.2 (744846f84)

tests/ground-copper-geometry.test.ts:
(pass) physical ground connectivity preserves islands, layers and pour cutouts [222.72ms]

tests/stusb4500-nvm.test.ts:
(pass) NVM readback requires every approved byte and never programs memory [906.55ms]

tests/stusb4500-request.test.ts:
(pass) PD profile transaction rejects partial writes and never repeats an uncertain command [354.36ms]

tests/motor-measurement.test.ts:
(pass) Measurement conversion encloses physical corners and never approves raw validity [357.52ms]

tests/stm32-gpio-outputs.test.ts:
(pass) actual sequencing outputs revoke before feedback changes and preserve charged rails [355.21ms]

tests/pd-sequence.test.ts:
(pass) compiled C power sequence inhibits stale contracts and unsafe voltage changes [363.94ms]

tests/fabrication-drill-geometry.test.ts:
(pass) manufacturing drill comparison preserves slots, rotations and physical units [105.57ms]

tests/power-prototype-envelope.test.ts:
(pass) every declared analog corner remains separated from the conservative buck FB window [11.32ms]
(pass) I2C timing accepts its declared envelope and rejects excessive rise time [0.47ms]

tests/pd-policy.test.ts:
(pass) compiled C PD policy rejects unsafe contracts and stale qualification [343.24ms]

tests/motor-owner.test.ts:
(pass) serialized owner applies only fresh qualified contracts and revokes on faults [504.75ms]

tests/power-copper-geometry.test.ts:
(pass) power copper metrics integrate tapers and reject unsupported geometry [24.82ms]

tests/electrical-calculations.test.ts:
(pass) PD power qualification > rejects insufficient chargers including native 12 V [0.35ms]
(pass) PD power qualification > requires 20 V for 9/12 V peaks with budgeting reserve [0.39ms]
(pass) PD power qualification > a 5 A source retains a 3 A operating request and malformed currents fail [0.04ms]
(pass) PD power qualification > worst assumed 12 V continuous input fits minimum eFuse limit [0.01ms]
(pass) 10 k potentiometer and selected motor rail > regulates all three modes within 0.1 percent nominal [0.03ms]
(pass) 10 k potentiometer and selected motor rail > PWM has useful monotonically increasing range with finite end times [0.07ms]
(pass) PD-enable default high survives transistor base loading

tests/stusb4500-startup.test.ts:
(pass) PD startup drains old events under inhibition and verifies standby acquisition [346.22ms]

tests/motor-validation-calculations.test.ts:
(pass) A7 voltage-aware PD policy engineering screen > 5 A advertisements remain separate from the 3 A operating request [0.35ms]
(pass) A7 voltage-aware PD policy engineering screen > 5 V uses 15 V; 9/12 V retain reserve with 20 V [1.58ms]
(pass) A7 voltage-aware PD policy engineering screen > a low-power 20 V source fails despite enough nominal output watts [0.03ms]
(pass) A7 voltage-aware PD policy engineering screen > 5 V-only, native 12 V-only and unplugged sources inhibit [0.03ms]
(pass) A7 voltage-aware PD policy engineering screen > 20 V fallback fits a 9 V motor when 15 V is unavailable [0.01ms]
(pass) Motor and converter stress screening > running reversal can double unrestricted startup current [0.46ms]
(pass) Motor and converter stress screening > output capacitance cannot absorb the example rotor energy [0.03ms]
(pass) Motor and converter stress screening > screened inductor peaks remain below the 4.5 A minimum buck limit [0.03ms]
(pass) A7 motor-rail-powered analog clamp > reference stays biased and clamp has hysteresis in all selected modes [0.05ms]
(pass) Four-branch regenerative resistor screen > current headroom is retained even at the lowest clamp release [0.10ms]
(pass) Four-branch regenerative resistor screen > a 15 V, 100 ms pulse fits the component overload screen [0.02ms]
(pass) Four-branch regenerative resistor screen > continuous braking and excessive pulse length are rejected [0.91ms]

tests/usb-c-replacement.test.ts:
(pass) 48 V USB-C replacement preserves manufacturer geometry and rejects original sub-rule gaps [141.13ms]

tests/stusb4500-rx.test.ts:
(pass) STUSB4500 capture rejects late, changed and malformed PD messages [391.65ms]

tests/copper-pulse-geometry.test.ts:
(pass) pulse copper screen preserves SI energy balance and rejects invalid manufacturing inputs [26.19ms]

tests/stm32-i2c.test.ts:
(pass) STM32 I2C bounded whole transfers, faults and rollover [486.59ms]

tests/usb-c-pad-translations.test.ts:
(pass) USB-C correction preserves the supplier geometry and clears every adjacent land [156.78ms]

tests/copper-clearance-geometry.test.ts:
(pass) physical copper spacing preserves layers, via boundaries and linear tapers [52.84ms]
(pass) static copper rejects sub-rule supplier lands without exempting pours [62.99ms]

tests/schema-diagnostic.test.ts:
(pass) nested union diagnostics retain the actual invalid board-label field [9.49ms]

tests/pd-interval.test.ts:
(pass) PD qualification contains whole voltage intervals and rejects back-drive [400.17ms]

tests/stm32-gpio.test.ts:
(pass) STM32 GPIO safety ordering and feedback preservation [412.60ms]
(pass) vendor MCU and CMSIS definitions remain byte-exact [9.15ms]

tests/stm32-adc.test.ts:
(pass) STM32 ADC fresh bounded conversions and failure inhibition [454.10ms]

 44 pass
 0 fail
 476 expect() calls
Ran 44 tests across 24 files. [6.59s]