]> sigrok.org Git - libsigrok.git/commit
kingst-la2016: identify device type in scan() already
authorGerhard Sittig <redacted>
Sun, 30 Jan 2022 07:06:28 +0000 (08:06 +0100)
committerGerhard Sittig <redacted>
Sun, 6 Feb 2022 17:53:53 +0000 (18:53 +0100)
commitd466f61cdcf2eb49dad3849a416e141da1435755
tree385dc9363b5e8009e2b1f1cb12b678e81c2b26c7
parent330853bad7fba3da237243fd5f6149b9ad392859
kingst-la2016: identify device type in scan() already

The vendor's design choice won't let us detect the device type from USB
enumeration data alone. EEPROM content must be read, which involves MCU
firmware communication, which only becomes available after the recently
uploaded firmware image becomes available. This extends the execution
time of the Kingst LA driver's scan() routine, but only if devices are
connected, and only for their first occurance after plugin. Subsequent
scans are quick.

Knowing the device type in the scan routine simplifies the open routine,
and allows model specific default parameters. The vendor's design choice
again won't let us read back previously configured values, each program
startup must assume a default configuration.

This implementation uses lots of small helpers to avoid open coding USB
communication details in several places. In theory up to 32 channels are
prepared, but all currently supported models have 16 channels. Different
memory sizes and channel counts are not yet effective in the acquisition
setup or session feed. The previous implementation of device open still
did too many things (configure PWM before user specs were received). A
future implementation needs to better pick which activities to run at
which points in time.
src/hardware/kingst-la2016/api.c
src/hardware/kingst-la2016/protocol.c
src/hardware/kingst-la2016/protocol.h