X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Ffx2lafw%2Fprotocol.h;h=fef0dd76bb85f8ae730d4553fb9760b780ac625c;hb=d292f767bd031979edbcbf54b7daa39b0aad7812;hp=5ccf8c1c208c01bc7475113eac555c9a14741b53;hpb=2f9376117c804898eaf75c3efebdbd97b6d89695;p=libsigrok.git diff --git a/hardware/fx2lafw/protocol.h b/hardware/fx2lafw/protocol.h index 5ccf8c1c..fef0dd76 100644 --- a/hardware/fx2lafw/protocol.h +++ b/hardware/fx2lafw/protocol.h @@ -29,19 +29,11 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "fx2lafw: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "fx2lafw" #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 @@ -55,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) @@ -73,6 +62,9 @@ struct fx2lafw_profile { const char *firmware; uint32_t dev_caps; + + const char *usb_manufacturer; + const char *usb_product; }; struct dev_context { @@ -90,27 +82,24 @@ 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; void *cb_data; unsigned int num_transfers; struct libusb_transfer **transfers; - int *usbfd; + 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_probes(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);