]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/saleae-logic16/protocol.h
rigol-ds: free memory that was allocated by SCPI get routines
[libsigrok.git] / src / hardware / saleae-logic16 / protocol.h
index 8a1ded823900e7ae41c194f355d1a73b5f07fb15..003358169871a1f144833f5c4641966413cfc3e3 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <stdint.h>
 #include <glib.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
 
 #define LOG_PREFIX "saleae-logic16"
@@ -35,8 +35,16 @@ enum voltage_range {
        VOLTAGE_RANGE_5_V,      /* 5V logic */
 };
 
-/** Private, per-device-instance driver context. */
+enum fpga_variant {
+       FPGA_VARIANT_ORIGINAL,
+       FPGA_VARIANT_ORIGINAL_NEW_BITSTREAM,
+       FPGA_VARIANT_MCUPRO    /* mcupro clone v4.6 with Actel FPGA */
+};
+
 struct dev_context {
+       /** Distinguishing between original Logic16 and clones */
+       enum fpga_variant fpga_variant;
+
        /*
         * Since we can't keep track of a Logic16 device after upgrading
         * the firmware (it renumerates into a different device address
@@ -51,6 +59,9 @@ struct dev_context {
        /** Maximum number of samples to capture, if nonzero. */
        uint64_t limit_samples;
 
+       /** Percent of the samples that should be captured before the trigger. */
+       uint64_t capture_ratio;
+
        /** The currently configured input voltage of the device. */
        enum voltage_range cur_voltage_range;
 
@@ -75,10 +86,13 @@ struct dev_context {
        struct soft_trigger_logic *stl;
        gboolean trigger_fired;
 
-       void *cb_data;
        unsigned int num_transfers;
        struct libusb_transfer **transfers;
        struct sr_context *ctx;
+
+       const uint8_t *fpga_register_map;
+       const uint8_t *fpga_status_control_bit_map;
+       const uint8_t *fpga_mode_bit_map;
 };
 
 SR_PRIV int logic16_setup_acquisition(const struct sr_dev_inst *sdi,
@@ -86,6 +100,6 @@ SR_PRIV int logic16_setup_acquisition(const struct sr_dev_inst *sdi,
 SR_PRIV int logic16_start_acquisition(const struct sr_dev_inst *sdi);
 SR_PRIV int logic16_abort_acquisition(const struct sr_dev_inst *sdi);
 SR_PRIV int logic16_init_device(const struct sr_dev_inst *sdi);
-SR_PRIV void logic16_receive_transfer(struct libusb_transfer *transfer);
+SR_PRIV void LIBUSB_CALL logic16_receive_transfer(struct libusb_transfer *transfer);
 
 #endif