seveibar/f1c1990s-dev-board
This code manages the entire PCB assembly process for a computer hardware module, including component placement, schematic integration, automated routing, copper pouring, and design rule checks, focused on a four-layer carrier board with integrated support components and connectors.
- Version
- 1.8.0
- License
- unset
- Stars
- 0
scripts/test-rgb-frame.py
import importlib.util
from pathlib import Path
s=importlib.util.spec_from_file_location('rgb',Path(__file__).resolve().parents[1]/'firmware/rgb-demo.py')
m=importlib.util.module_from_spec(s);s.loader.exec_module(m)
# Asymmetric channel values catch the SK9822-A-specific GRB byte order.
assert m.frame(0x12,0x34,0x56)==bytes.fromhex('00 00 00 00 e2 34 12 56 ff ff ff ff 00 00 00 00')
assert m.frame(0,0,0,0)==bytes.fromhex('00 00 00 00 e0 00 00 00 ff ff ff ff 00 00 00 00')
for args in [(0,0,0,3),(0,0,0,-1),(256,0,0,2),(-1,0,0,2)]:
try:m.frame(*args)
except ValueError:pass
else:raise AssertionError(f'accepted invalid or excessive brightness: {args}')
print('SK9822-A framing, GRB order, off frame and brightness limits passed')