#define NUM_PROBES 34
#define TRIGGER_TYPES "01fr"
+/* Bit mask covering all 34 channels.
+ */
+#define ALL_CHANNELS_MASK (((uint64_t)1 << NUM_PROBES) - 1)
+
/** Unit and packet size for the sigrok logic datafeed.
*/
#define UNIT_SIZE ((NUM_PROBES + 7) / 8)
-#define PACKET_SIZE (10000 * UNIT_SIZE) /* bytes */
+#define PACKET_LENGTH 10000 /* units */
/** Size of the acquisition buffer in device memory units.
*/
*/
#define DEFAULT_SAMPLERATE SR_MHZ(125)
+/** Maximum configurable sample count limit.
+ */
+#define MAX_LIMIT_SAMPLES (UINT64_C(1) << 48)
+
+/** Maximum configurable capture duration in milliseconds.
+ */
+#define MAX_LIMIT_MSEC (UINT64_C(1) << 32)
+
/** LWLA clock sources.
*/
enum clock_source {
uint64_t sample;
uint64_t run_len;
- /** Number of samples acquired so far. */
- uint64_t captured_samples;
+ /** Maximum number of samples to process. */
+ uint64_t samples_max;
/** Number of samples sent to the session bus. */
- uint64_t transferred_samples;
+ uint64_t samples_done;
+
+ /** Maximum duration of capture, in milliseconds. */
+ uint64_t duration_max;
+ /** Running capture duration since trigger event. */
+ uint64_t duration_now;
/** Capture memory fill level. */
size_t mem_addr_fill;
size_t mem_addr_next;
size_t mem_addr_stop;
- size_t out_offset;
+ size_t out_index;
struct libusb_transfer *xfer_in;
struct libusb_transfer *xfer_out;
enum rle_state rle;
+ /** Whether to bypass the clock divider. */
+ gboolean bypass_clockdiv;
+
/* Payload data buffers for outgoing and incoming transfers. */
uint16_t xfer_buf_out[MAX_ACQ_SEND_WORDS];
uint16_t xfer_buf_in[MAX_ACQ_RECV_WORDS];
/* Payload buffer for sigrok logic packets. */
- uint8_t out_packet[PACKET_SIZE];
+ uint8_t out_packet[PACKET_LENGTH * UNIT_SIZE];
};
/** Private, per-device-instance driver context.
/** The samplerate selected by the user. */
uint64_t samplerate;
+ /** The maximimum sampling duration, in milliseconds. */
+ uint64_t limit_msec;
+
/** The maximimum number of samples to acquire. */
uint64_t limit_samples;
int reg_write_len;
enum device_state state;
- enum device_state next_state;
/** The currently configured clock source of the device. */
enum clock_source cur_clock_source;