]> sigrok.org Git - libsigrok.git/blobdiff - hardware/fx2lafw/protocol.h
build: Portability fixes.
[libsigrok.git] / hardware / fx2lafw / protocol.h
index 25a8c56a29e42e6d1e0dc5fd77de353a7752962e..fef0dd76bb85f8ae730d4553fb9760b780ac625c 100644 (file)
@@ -34,7 +34,6 @@
 #define USB_INTERFACE          0
 #define USB_CONFIGURATION      1
 #define NUM_TRIGGER_STAGES     4
-#define TRIGGER_TYPE           "01"
 
 #define MAX_RENUM_DELAY_MS     3000
 #define NUM_SIMUL_TRANSFERS    32
@@ -48,9 +47,6 @@
 /* 6 delay states of up to 256 clock ticks */
 #define MAX_SAMPLE_DELAY       (6 * 256)
 
-/* Software trigger implementation: positive values indicate trigger stage. */
-#define TRIGGER_FIRED          -1
-
 #define DEV_CAPS_16BIT_POS     0
 
 #define DEV_CAPS_16BIT         (1 << DEV_CAPS_16BIT_POS)
@@ -66,6 +62,9 @@ struct fx2lafw_profile {
        const char *firmware;
 
        uint32_t dev_caps;
+
+       const char *usb_manufacturer;
+       const char *usb_product;
 };
 
 struct dev_context {
@@ -83,13 +82,12 @@ struct dev_context {
        uint64_t limit_samples;
 
        /* Operational settings */
+       gboolean trigger_fired;
+       gboolean acq_aborted;
        gboolean sample_wide;
-       uint16_t trigger_mask[NUM_TRIGGER_STAGES];
-       uint16_t trigger_value[NUM_TRIGGER_STAGES];
-       int trigger_stage;
-       uint16_t trigger_buffer[NUM_TRIGGER_STAGES];
+       struct soft_trigger_logic *stl;
 
-       int num_samples;
+       unsigned int sent_samples;
        int submitted_transfers;
        int empty_transfer_count;
 
@@ -99,11 +97,9 @@ struct dev_context {
        struct sr_context *ctx;
 };
 
-SR_PRIV int fx2lafw_command_start_acquisition(libusb_device_handle *devhdl,
-               uint64_t samplerate, gboolean samplewide);
+SR_PRIV int fx2lafw_command_start_acquisition(const struct sr_dev_inst *sdi);
 SR_PRIV gboolean fx2lafw_check_conf_profile(libusb_device *dev);
 SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di);
-SR_PRIV int fx2lafw_configure_channels(const struct sr_dev_inst *sdi);
 SR_PRIV struct dev_context *fx2lafw_dev_new(void);
 SR_PRIV void fx2lafw_abort_acquisition(struct dev_context *devc);
 SR_PRIV void fx2lafw_receive_transfer(struct libusb_transfer *transfer);