]> sigrok.org Git - libsigrok.git/commit - src/hardware/asix-sigma/api.c
asix-sigma: improve robustness of parameter upload to hardware
authorGerhard Sittig <redacted>
Tue, 12 May 2020 19:51:10 +0000 (21:51 +0200)
committerGerhard Sittig <redacted>
Fri, 29 May 2020 05:50:33 +0000 (07:50 +0200)
commita53b8e4d74ae83bb2490569e371a3667855b5c52
tree427bcc623b6cc5001225e2f50d28d96c8349b111
parent9b4d261fabf7f9fd70ccd7514ecdadb8e87a7490
asix-sigma: improve robustness of parameter upload to hardware

Keep application data in its logical presentation in C language struct
fields. Explicitly convert to raw byte streams by means of endianess
aware conversion helpers. Don't assume a specific memory layout for
C language variables any longer. This improves portability, and
reliability of hardware access across compiler versions and build
configurations.

This change also unobfuscates the "disabled channels" arithmetics in
the sample rate dependent logic. Passes read-only pointers to write
routines. Improves buffer size checks. Reduces local buffer size for
DRAM reads. Rewords comments on "decrement then subtract 64" during
trigger/stop position gathering. Unobfuscates access to sample data
after download (timestamps, and values). Covers a few more occurances
of magic numbers for memory organization.

Prefer masks over shift counts for hardware register bit fields, to
improve consistency of the declaration block and code instructions.
Improve maintenability of the LA mode initiation after FPGA netlist
configuration (better match written data and read-back expectation,
eliminate magic literals that are hidden in nibbles).
src/hardware/asix-sigma/api.c
src/hardware/asix-sigma/protocol.c
src/hardware/asix-sigma/protocol.h