X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fikalogic-scanalogic2%2Fprotocol.h;h=5e7c7b3b40686e9a149681dbf747709f2c1566ed;hb=102f12396660e0784134bccce5cc0679db325751;hp=adc3859237ae5283a55c07a7fa8b53131c8e8fc9;hpb=fb8d593cfea094dd50d74873c8c00445eb0a040f;p=libsigrok.git diff --git a/hardware/ikalogic-scanalogic2/protocol.h b/hardware/ikalogic-scanalogic2/protocol.h index adc38592..5e7c7b3b 100644 --- a/hardware/ikalogic-scanalogic2/protocol.h +++ b/hardware/ikalogic-scanalogic2/protocol.h @@ -27,14 +27,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "ikalogic-scanalogic2: " -#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 "ikalogic-scanalogic2" #define VENDOR_NAME "IKALOGIC" #define MODEL_NAME "Scanalogic-2" @@ -54,9 +47,7 @@ #define USB_HID_REPORT_TYPE_FEATURE 0x300 #define NUM_SAMPLERATES 11 -#define NUM_PROBES 4 - -#define TRIGGER_TYPES "rfc" +#define NUM_CHANNELS 4 /* * Number of sample bytes and samples the device can acquire. Note that the @@ -158,11 +149,8 @@ struct dev_context { void *cb_data; - /* Array to provide an index based access to all probes. */ - const struct sr_probe *probes[NUM_PROBES]; - - unsigned int num_usbfd; - int *usbfd; + /* Array to provide an index based access to all channels. */ + const struct sr_channel *channels[NUM_CHANNELS]; struct libusb_transfer *xfer_in, *xfer_out; @@ -204,7 +192,7 @@ struct dev_context { * channel except the last one. The samples of the last channel will be * processed directly after they will be received. */ - uint8_t sample_buffer[NUM_PROBES - 1][MAX_DEV_SAMPLE_BYTES]; + uint8_t sample_buffer[NUM_CHANNELS - 1][MAX_DEV_SAMPLE_BYTES]; /* Expected number of sample packets for each channel. */ uint16_t num_sample_packets; @@ -218,11 +206,11 @@ struct dev_context { /* Channel number that is currently processed. */ uint8_t channel; - /* Number of enabled probes. */ - unsigned int num_enabled_probes; + /* Number of enabled channels. */ + unsigned int num_enabled_channels; - /* Array to provide a sequential access to all enabled probe indices. */ - uint8_t probe_map[NUM_PROBES]; + /* Array to provide a sequential access to all enabled channel indices. */ + uint8_t channel_map[NUM_CHANNELS]; /* Indicates whether a transfer failed. */ gboolean transfer_error; @@ -235,7 +223,7 @@ SR_PRIV int sl2_set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate); SR_PRIV int sl2_set_limit_samples(const struct sr_dev_inst *sdi, uint64_t limit_samples); -SR_PRIV void sl2_configure_trigger(const struct sr_dev_inst *sdi); +SR_PRIV int sl2_convert_trigger(const struct sr_dev_inst *sdi); SR_PRIV int sl2_set_capture_ratio(const struct sr_dev_inst *sdi, uint64_t capture_ratio); SR_PRIV int sl2_set_after_trigger_delay(const struct sr_dev_inst *sdi,