* ASIX SIGMA Logic Analyzer Driver
*/
-#include "config.h"
#include <glib.h>
#include <glib/gstdio.h>
#include <ftdi.h>
#include <string.h>
#include <zlib.h>
-#include <sigrok.h>
-#include <sigrok-internal.h>
+#include "sigrok.h"
+#include "sigrok-internal.h"
#include "asix-sigma.h"
#define USB_VENDOR 0xa600
#define USB_MODEL_NAME "SIGMA"
#define USB_MODEL_VERSION ""
#define TRIGGER_TYPES "rf10"
+#define NUM_PROBES 16
static GSList *device_instances = NULL;
0,
};
+static const char *probe_names[NUM_PROBES + 1] = {
+ "0",
+ "1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ "10",
+ "11",
+ "12",
+ "13",
+ "14",
+ "15",
+ NULL,
+};
+
static struct sr_samplerates samplerates = {
SR_KHZ(200),
SR_MHZ(200),
struct sigma *sigma;
/* Avoid compiler warnings. */
- deviceinfo = deviceinfo;
+ (void)deviceinfo;
if (!(sigma = g_try_malloc(sizeof(struct sigma)))) {
sr_err("sigma: %s: sigma malloc failed", __func__);
void *info = NULL;
if (!(sdi = sr_get_device_instance(device_instances, device_index))) {
- fprintf(stderr, "It's NULL.\n");
+ sr_err("It's NULL.\n");
return NULL;
}
info = sdi;
break;
case SR_DI_NUM_PROBES:
- info = GINT_TO_POINTER(16);
+ info = GINT_TO_POINTER(NUM_PROBES);
+ break;
+ case SR_DI_PROBE_NAMES:
+ info = probe_names;
break;
case SR_DI_SAMPLERATES:
info = &samplerates;
tosend = MIN(2048, n - sent);
packet.type = SR_DF_LOGIC;
- /* TODO: fill in timeoffset and duration */
- packet.timeoffset = 0;
- packet.duration = 0;
packet.payload = &logic;
logic.length = tosend * sizeof(uint16_t);
logic.unitsize = 2;
if (tosend > 0) {
packet.type = SR_DF_LOGIC;
- /* TODO: fill in timeoffset and duration */
- packet.timeoffset = 0;
- packet.duration = 0;
packet.payload = &logic;
logic.length = tosend * sizeof(uint16_t);
logic.unitsize = 2;
/* Only send trigger if explicitly enabled. */
if (sigma->use_triggers) {
packet.type = SR_DF_TRIGGER;
- /* TODO: fill in timeoffset only */
- packet.timeoffset = 0;
- packet.duration = 0;
sr_session_bus(sigma->session_id, &packet);
}
}
if (tosend > 0) {
packet.type = SR_DF_LOGIC;
- /* TODO: fill in timeoffset and duration */
- packet.timeoffset = 0;
- packet.duration = 0;
packet.payload = &logic;
logic.length = tosend * sizeof(uint16_t);
logic.unitsize = 2;
uint64_t running_msec;
struct timeval tv;
- fd = fd;
- revents = revents;
+ /* Avoid compiler warnings. */
+ (void)fd;
+ (void)revents;
numchunks = (sigma->state.stoppos + 511) / 512;
struct triggerinout triggerinout_conf;
struct triggerlut lut;
- session_data = session_data;
+ /* Avoid compiler warnings. */
+ (void)session_data;
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
sigma = sdi->priv;
- session_data = session_data;
+ /* Avoid compiler warnings. */
+ (void)session_data;
/* Stop acquisition. */
sigma_set_register(WRITE_MODE, 0x11, sigma);
sigma->state.state = SIGMA_DOWNLOAD;
}
-struct sr_device_plugin asix_sigma_plugin_info = {
+SR_PRIV struct sr_device_plugin asix_sigma_plugin_info = {
.name = "asix-sigma",
.longname = "ASIX SIGMA",
.api_version = 1,