seveibar/f1c100s-linux-dev-board
A 4-layer F1C100S Linux development carrier board with USB‑C power/data, multi-rail LDOs, SPI NOR flash, reset/boot interfaces, I²C/SPI/UART headers, ESD protection, and a buffered 5‑V clocked RGB LED.
- Version
- 1.9.2
- License
- unset
- Stars
- 1
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')