pub struct ChipLibrary {Show 15 fields
pub name: String,
pub vendor: Option<String>,
pub datasheet: Option<String>,
pub family_id: u16,
pub sub_id: Option<u16>,
pub serial_clock: u16,
pub chip_control: [u8; 20],
pub order: Vec<u8>,
pub registers: BTreeMap<u8, [u8; 3]>,
pub chip_custom: Option<[u8; 16]>,
pub chip_custom_scan_patch: Option<ScanPatch>,
pub chip_custom_ex: Option<[u8; 4]>,
pub emit_record_84: bool,
pub gray_bits: Option<u8>,
pub record01_overrides: BTreeMap<usize, u8>,
}Fields§
§name: String§vendor: Option<String>Who makes the chip.
datasheet: Option<String>Datasheet.
family_id: u16§sub_id: Option<u16>§serial_clock: u16Vendor default serial clock for the chip (record +0x021).
chip_control: [u8; 20]The 20-byte SChipControl block the vendor’s ResetChipControl
emits for this chip (record 0x01 +0x0C4).
order: Vec<u8>Register ids in record order. Absent for chips without an addressed register table (the non-SH S-PWM parts, e.g. SM16169S).
registers: BTreeMap<u8, [u8; 3]>Register id (spelled 0x.. in the file) → R, G, B values.
chip_custom: Option<[u8; 16]>The 16-byte SChipCustom block (record 0x01 +0x06A) when the chip’s
configuration lives there instead of in record 0x84. When absent the
generator writes only the PWM-flag/serial-clock pair the SH chips use.
chip_custom_scan_patch: Option<ScanPatch>The scan patch the vendor applies to chip_custom on load:
byte = base | ((scan - 1) & mask) for each listed byte.
chip_custom_ex: Option<[u8; 4]>SChipCustomEX (record 0x01 +0x0E0..+0x0E3).
emit_record_84: boolThe vendor omits record 0x84 for non-addressed chips; a zeroed record is not the same file.
gray_bits: Option<u8>Grey depth as a literal, for chips whose depth is not derived from registers 0x07/0x03.
record01_overrides: BTreeMap<usize, u8>Record 0x01 bytes this chip id sets differently from the 0x14C baseline; applied before the spec’s own overrides.
Implementations§
Source§impl ChipLibrary
impl ChipLibrary
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self>
pub fn load(path: impl AsRef<Path>) -> Result<Self>
§Errors
Fails on a missing or malformed file.
Sourcepub fn record_84(&self, scan: u8) -> Result<Option<[u8; 256]>>
pub fn record_84(&self, scan: u8) -> Result<Option<[u8; 256]>>
Record 0x84: (register, R, G, B) quads in library order, zero-filled
to 256 bytes, with the vendor’s post-load patch of register 0x02 to
scan - 1 (ResetChipCustom, chip 0x14C case).
§Errors
Fails if the order names a register the table lacks, or overflows.
Trait Implementations§
Source§impl Clone for ChipLibrary
impl Clone for ChipLibrary
Source§fn clone(&self) -> ChipLibrary
fn clone(&self) -> ChipLibrary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more