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-clang-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 [233.51ms]

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

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

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

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

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

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

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

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

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

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

tests/electrical-calculations.test.ts:
(pass) PD power qualification > rejects insufficient chargers including native 12 V [0.11ms]
(pass) PD power qualification > requires 20 V for 9/12 V peaks with budgeting reserve [0.27ms]
(pass) PD power qualification > a 5 A source retains a 3 A operating request and malformed currents fail [0.05ms]
(pass) PD power qualification > worst assumed 12 V continuous input fits minimum eFuse limit [0.02ms]
(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.09ms]
(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 [357.84ms]

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.45ms]
(pass) A7 voltage-aware PD policy engineering screen > 5 V uses 15 V; 9/12 V retain reserve with 20 V [0.08ms]
(pass) A7 voltage-aware PD policy engineering screen > a low-power 20 V source fails despite enough nominal output watts [0.02ms]
(pass) A7 voltage-aware PD policy engineering screen > 5 V-only, native 12 V-only and unplugged sources inhibit [0.04ms]
(pass) A7 voltage-aware PD policy engineering screen > 20 V fallback fits a 9 V motor when 15 V is unavailable [0.02ms]
(pass) Motor and converter stress screening > running reversal can double unrestricted startup current [0.71ms]
(pass) Motor and converter stress screening > output capacitance cannot absorb the example rotor energy [0.05ms]
(pass) Motor and converter stress screening > screened inductor peaks remain below the 4.5 A minimum buck limit [0.05ms]
(pass) A7 motor-rail-powered analog clamp > reference stays biased and clamp has hysteresis in all selected modes [0.07ms]
(pass) Four-branch regenerative resistor screen > current headroom is retained even at the lowest clamp release [0.11ms]
(pass) Four-branch regenerative resistor screen > a 15 V, 100 ms pulse fits the component overload screen [0.03ms]
(pass) Four-branch regenerative resistor screen > continuous braking and excessive pulse length are rejected [0.68ms]

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

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

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

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

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

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

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

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

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

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

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