X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fasix-sigma%2Fprotocol.h;h=26370170481e008e97954ca2826ab5b4a0dd5869;hb=8cbe5339b1514d600e11f727fa44edd9b0744887;hp=60798c5a6dad551b9a3b93e2535571f86d6cc5f4;hpb=3f5f5484100ba39dafa4d90b84d25cd3d871d2f2;p=libsigrok.git diff --git a/src/hardware/asix-sigma/protocol.h b/src/hardware/asix-sigma/protocol.h index 60798c5a..26370170 100644 --- a/src/hardware/asix-sigma/protocol.h +++ b/src/hardware/asix-sigma/protocol.h @@ -33,14 +33,6 @@ #define LOG_PREFIX "asix-sigma" -/* - * Triggers are not working in this implementation. Stop claiming - * support for the feature which effectively is not available, until - * the implementation got fixed. Yet keep the code in place and allow - * developers to turn on this switch during development. - */ -#define ASIX_SIGMA_WITH_TRIGGER 1 - /* Experimental support for OMEGA (scan only, operation is ENOIMPL). */ #define ASIX_WITH_OMEGA 0 @@ -314,19 +306,6 @@ enum triggerfunc { FUNC_NXOR, }; -struct sigma_state { - enum { - SIGMA_UNINITIALIZED = 0, - SIGMA_CONFIG, - SIGMA_IDLE, - SIGMA_CAPTURE, - SIGMA_STOPPING, - SIGMA_DOWNLOAD, - } state; - uint16_t lastts; - uint16_t lastsample; -}; - enum sigma_firmware_idx { SIGMA_FW_NONE, SIGMA_FW_50MHZ, @@ -372,12 +351,42 @@ struct dev_context { struct sr_sw_limits submit; } limit; enum sigma_firmware_idx firmware_idx; - size_t num_channels; - size_t samples_per_event; + struct sigma_sample_interp { + /* Interpretation of sample memory. */ + size_t num_channels; + size_t samples_per_event; + struct { + uint16_t ts; + uint16_t sample; + } last; + struct sigma_location { + size_t raw, line, cluster, event; + } start, stop, trig, iter, trig_arm; + struct { + size_t lines_total, lines_done; + size_t lines_per_read; /* USB transfer limit */ + size_t lines_rcvd; + struct sigma_dram_line *rcvd_lines; + struct sigma_dram_line *curr_line; + } fetch; + struct { + gboolean armed; + gboolean matched; + size_t evt_remain; + } trig_chk; + } interp; uint64_t capture_ratio; struct sigma_trigger trigger; gboolean use_triggers; - struct sigma_state state; + gboolean late_trigger_timeout; + enum { + SIGMA_UNINITIALIZED = 0, + SIGMA_CONFIG, + SIGMA_IDLE, + SIGMA_CAPTURE, + SIGMA_STOPPING, + SIGMA_DOWNLOAD, + } state; struct submit_buffer *buffer; };