#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 READ_CHUNK_LEN (28 * 8)
-/** Calculate the required buffer size in 16-bit units for reading a given
+/** Calculate the required buffer size in 32-bit units for reading a given
* number of device memory words. Rounded to a multiple of 8 device words.
*/
-#define LWLA1034_MEMBUF_LEN(count) (((count) + 7) / 8 * 18)
+#define LWLA1034_MEMBUF_LEN(count) (((count) + 7) / 8 * 9)
/** Maximum number of 16-bit words sent at a time during acquisition.
* Used for allocating the libusb transfer buffer.
*/
#define MAX_ACQ_SEND_WORDS 8 /* 5 for memory read request plus stuffing */
-/** Maximum number of 16-bit words received at a time during acquisition.
+/** Maximum number of 32-bit words received at a time during acquisition.
* Round to the next multiple of the endpoint buffer size to avoid nasty
* transfer overflow conditions on hiccups.
*/
-#define MAX_ACQ_RECV_WORDS ((READ_CHUNK_LEN / 4 * 9 + 255) / 256 * 256)
+#define MAX_ACQ_RECV_LEN ((READ_CHUNK_LEN / 8 * 9 + 127) / 128 * 128)
/** Maximum length of a register write sequence.
*/
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;
/** Whether to bypass the clock divider. */
gboolean bypass_clockdiv;
- /* Payload data buffers for outgoing and incoming transfers. */
+ /* Payload data buffers for incoming and outgoing transfers. */
+ uint32_t xfer_buf_in[MAX_ACQ_RECV_LEN];
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.