SR_ prefix for all public enums.
This commit is contained in:
parent
6c29007211
commit
5a2326a71b
2
device.c
2
device.c
|
@ -51,7 +51,7 @@ int device_plugin_init(struct sr_device_plugin *plugin)
|
||||||
g_message("initializing %s plugin", plugin->name);
|
g_message("initializing %s plugin", plugin->name);
|
||||||
num_devices = plugin->init(NULL);
|
num_devices = plugin->init(NULL);
|
||||||
for (i = 0; i < num_devices; i++) {
|
for (i = 0; i < num_devices; i++) {
|
||||||
num_probes = (int)plugin->get_device_info(i, DI_NUM_PROBES);
|
num_probes = (int)plugin->get_device_info(i, SR_DI_NUM_PROBES);
|
||||||
device_new(plugin, i, num_probes);
|
device_new(plugin, i, num_probes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
#define AUDIO_DEV "plughw:0,0"
|
#define AUDIO_DEV "plughw:0,0"
|
||||||
|
|
||||||
static int capabilities[] = {
|
static int capabilities[] = {
|
||||||
HWCAP_SAMPLERATE,
|
SR_HWCAP_SAMPLERATE,
|
||||||
HWCAP_LIMIT_SAMPLES,
|
SR_HWCAP_LIMIT_SAMPLES,
|
||||||
HWCAP_CONTINUOUS,
|
SR_HWCAP_CONTINUOUS,
|
||||||
};
|
};
|
||||||
|
|
||||||
static GSList *device_instances = NULL;
|
static GSList *device_instances = NULL;
|
||||||
|
@ -58,7 +58,7 @@ static int hw_init(char *deviceinfo)
|
||||||
return 0;
|
return 0;
|
||||||
memset(alsa, 0, sizeof(struct alsa));
|
memset(alsa, 0, sizeof(struct alsa));
|
||||||
|
|
||||||
sdi = sr_device_instance_new(0, ST_ACTIVE, "alsa", NULL, NULL);
|
sdi = sr_device_instance_new(0, SR_ST_ACTIVE, "alsa", NULL, NULL);
|
||||||
if (!sdi)
|
if (!sdi)
|
||||||
goto free_alsa;
|
goto free_alsa;
|
||||||
|
|
||||||
|
@ -146,17 +146,17 @@ static void *hw_get_device_info(int device_index, int device_info_id)
|
||||||
alsa = sdi->priv;
|
alsa = sdi->priv;
|
||||||
|
|
||||||
switch (device_info_id) {
|
switch (device_info_id) {
|
||||||
case DI_INSTANCE:
|
case SR_DI_INSTANCE:
|
||||||
info = sdi;
|
info = sdi;
|
||||||
break;
|
break;
|
||||||
case DI_NUM_PROBES:
|
case SR_DI_NUM_PROBES:
|
||||||
info = GINT_TO_POINTER(NUM_PROBES);
|
info = GINT_TO_POINTER(NUM_PROBES);
|
||||||
break;
|
break;
|
||||||
case DI_CUR_SAMPLERATE:
|
case SR_DI_CUR_SAMPLERATE:
|
||||||
info = &alsa->cur_rate;
|
info = &alsa->cur_rate;
|
||||||
break;
|
break;
|
||||||
// case DI_PROBE_TYPE:
|
// case SR_DI_PROBE_TYPE:
|
||||||
// info = GINT_TO_POINTER(PROBE_TYPE_ANALOG);
|
// info = GINT_TO_POINTER(SR_PROBE_TYPE_ANALOG);
|
||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ static int hw_get_status(int device_index)
|
||||||
/* Avoid compiler warnings. */
|
/* Avoid compiler warnings. */
|
||||||
device_index = device_index;
|
device_index = device_index;
|
||||||
|
|
||||||
return ST_ACTIVE;
|
return SR_ST_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int *hw_get_capabilities(void)
|
static int *hw_get_capabilities(void)
|
||||||
|
@ -186,12 +186,12 @@ static int hw_set_configuration(int device_index, int capability, void *value)
|
||||||
alsa = sdi->priv;
|
alsa = sdi->priv;
|
||||||
|
|
||||||
switch (capability) {
|
switch (capability) {
|
||||||
case HWCAP_PROBECONFIG:
|
case SR_HWCAP_PROBECONFIG:
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
case HWCAP_SAMPLERATE:
|
case SR_HWCAP_SAMPLERATE:
|
||||||
alsa->cur_rate = *(uint64_t *) value;
|
alsa->cur_rate = *(uint64_t *) value;
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
case HWCAP_LIMIT_SAMPLES:
|
case SR_HWCAP_LIMIT_SAMPLES:
|
||||||
alsa->limit_samples = *(uint64_t *) value;
|
alsa->limit_samples = *(uint64_t *) value;
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
default:
|
default:
|
||||||
|
@ -240,7 +240,7 @@ static int receive_data(int fd, int revents, void *user_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
packet.type = DF_ANALOG;
|
packet.type = SR_DF_ANALOG;
|
||||||
packet.length = count * sample_size;
|
packet.length = count * sample_size;
|
||||||
packet.unitsize = sample_size;
|
packet.unitsize = sample_size;
|
||||||
packet.payload = outb;
|
packet.payload = outb;
|
||||||
|
@ -250,7 +250,7 @@ static int receive_data(int fd, int revents, void *user_data)
|
||||||
|
|
||||||
} while (alsa->limit_samples > 0);
|
} while (alsa->limit_samples > 0);
|
||||||
|
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
session_bus(user_data, &packet);
|
session_bus(user_data, &packet);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -333,7 +333,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
alsa->session_id = session_device_id;
|
alsa->session_id = session_device_id;
|
||||||
source_add(ufds[0].fd, ufds[0].events, 10, receive_data, sdi);
|
source_add(ufds[0].fd, ufds[0].events, 10, receive_data, sdi);
|
||||||
|
|
||||||
packet.type = DF_HEADER;
|
packet.type = SR_DF_HEADER;
|
||||||
packet.length = sizeof(struct sr_datafeed_header);
|
packet.length = sizeof(struct sr_datafeed_header);
|
||||||
packet.payload = (unsigned char *) &header;
|
packet.payload = (unsigned char *) &header;
|
||||||
header.feed_version = 1;
|
header.feed_version = 1;
|
||||||
|
@ -341,7 +341,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
header.samplerate = alsa->cur_rate;
|
header.samplerate = alsa->cur_rate;
|
||||||
header.num_analog_probes = NUM_PROBES;
|
header.num_analog_probes = NUM_PROBES;
|
||||||
header.num_logic_probes = 0;
|
header.num_logic_probes = 0;
|
||||||
header.protocol_id = PROTO_RAW;
|
header.protocol_id = SR_PROTO_RAW;
|
||||||
session_bus(session_device_id, &packet);
|
session_bus(session_device_id, &packet);
|
||||||
free(ufds);
|
free(ufds);
|
||||||
|
|
||||||
|
|
|
@ -62,12 +62,12 @@ static struct samplerates samplerates = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int capabilities[] = {
|
static int capabilities[] = {
|
||||||
HWCAP_LOGIC_ANALYZER,
|
SR_HWCAP_LOGIC_ANALYZER,
|
||||||
HWCAP_SAMPLERATE,
|
SR_HWCAP_SAMPLERATE,
|
||||||
HWCAP_CAPTURE_RATIO,
|
SR_HWCAP_CAPTURE_RATIO,
|
||||||
HWCAP_PROBECONFIG,
|
SR_HWCAP_PROBECONFIG,
|
||||||
|
|
||||||
HWCAP_LIMIT_MSEC,
|
SR_HWCAP_LIMIT_MSEC,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ static int hw_init(char *deviceinfo)
|
||||||
sigma->use_triggers = 0;
|
sigma->use_triggers = 0;
|
||||||
|
|
||||||
/* Register SIGMA device. */
|
/* Register SIGMA device. */
|
||||||
sdi = sr_device_instance_new(0, ST_INITIALIZING,
|
sdi = sr_device_instance_new(0, SR_ST_INITIALIZING,
|
||||||
USB_VENDOR_NAME, USB_MODEL_NAME, USB_MODEL_VERSION);
|
USB_VENDOR_NAME, USB_MODEL_NAME, USB_MODEL_VERSION);
|
||||||
if (!sdi)
|
if (!sdi)
|
||||||
goto free;
|
goto free;
|
||||||
|
@ -541,7 +541,7 @@ static int hw_opendev(int device_index)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sdi->status = ST_ACTIVE;
|
sdi->status = SR_ST_ACTIVE;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
}
|
}
|
||||||
|
@ -672,10 +672,10 @@ static void hw_closedev(int device_index)
|
||||||
if ((sdi = sr_get_device_instance(device_instances, device_index)))
|
if ((sdi = sr_get_device_instance(device_instances, device_index)))
|
||||||
{
|
{
|
||||||
sigma = sdi->priv;
|
sigma = sdi->priv;
|
||||||
if (sdi->status == ST_ACTIVE)
|
if (sdi->status == SR_ST_ACTIVE)
|
||||||
ftdi_usb_close(&sigma->ftdic);
|
ftdi_usb_close(&sigma->ftdic);
|
||||||
|
|
||||||
sdi->status = ST_INACTIVE;
|
sdi->status = SR_ST_INACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -709,19 +709,19 @@ static void *hw_get_device_info(int device_index, int device_info_id)
|
||||||
sigma = sdi->priv;
|
sigma = sdi->priv;
|
||||||
|
|
||||||
switch (device_info_id) {
|
switch (device_info_id) {
|
||||||
case DI_INSTANCE:
|
case SR_DI_INSTANCE:
|
||||||
info = sdi;
|
info = sdi;
|
||||||
break;
|
break;
|
||||||
case DI_NUM_PROBES:
|
case SR_DI_NUM_PROBES:
|
||||||
info = GINT_TO_POINTER(16);
|
info = GINT_TO_POINTER(16);
|
||||||
break;
|
break;
|
||||||
case DI_SAMPLERATES:
|
case SR_DI_SAMPLERATES:
|
||||||
info = &samplerates;
|
info = &samplerates;
|
||||||
break;
|
break;
|
||||||
case DI_TRIGGER_TYPES:
|
case SR_DI_TRIGGER_TYPES:
|
||||||
info = (char *)TRIGGER_TYPES;
|
info = (char *)TRIGGER_TYPES;
|
||||||
break;
|
break;
|
||||||
case DI_CUR_SAMPLERATE:
|
case SR_DI_CUR_SAMPLERATE:
|
||||||
info = &sigma->cur_samplerate;
|
info = &sigma->cur_samplerate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -737,7 +737,7 @@ static int hw_get_status(int device_index)
|
||||||
if (sdi)
|
if (sdi)
|
||||||
return sdi->status;
|
return sdi->status;
|
||||||
else
|
else
|
||||||
return ST_NOT_FOUND;
|
return SR_ST_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int *hw_get_capabilities(void)
|
static int *hw_get_capabilities(void)
|
||||||
|
@ -756,17 +756,17 @@ static int hw_set_configuration(int device_index, int capability, void *value)
|
||||||
|
|
||||||
sigma = sdi->priv;
|
sigma = sdi->priv;
|
||||||
|
|
||||||
if (capability == HWCAP_SAMPLERATE) {
|
if (capability == SR_HWCAP_SAMPLERATE) {
|
||||||
ret = set_samplerate(sdi, *(uint64_t*) value);
|
ret = set_samplerate(sdi, *(uint64_t*) value);
|
||||||
} else if (capability == HWCAP_PROBECONFIG) {
|
} else if (capability == SR_HWCAP_PROBECONFIG) {
|
||||||
ret = configure_probes(sdi, value);
|
ret = configure_probes(sdi, value);
|
||||||
} else if (capability == HWCAP_LIMIT_MSEC) {
|
} else if (capability == SR_HWCAP_LIMIT_MSEC) {
|
||||||
sigma->limit_msec = *(uint64_t*) value;
|
sigma->limit_msec = *(uint64_t*) value;
|
||||||
if (sigma->limit_msec > 0)
|
if (sigma->limit_msec > 0)
|
||||||
ret = SR_OK;
|
ret = SR_OK;
|
||||||
else
|
else
|
||||||
ret = SR_ERR;
|
ret = SR_ERR;
|
||||||
} else if (capability == HWCAP_CAPTURE_RATIO) {
|
} else if (capability == SR_HWCAP_CAPTURE_RATIO) {
|
||||||
sigma->capture_ratio = *(uint64_t*) value;
|
sigma->capture_ratio = *(uint64_t*) value;
|
||||||
if (sigma->capture_ratio < 0 || sigma->capture_ratio > 100)
|
if (sigma->capture_ratio < 0 || sigma->capture_ratio > 100)
|
||||||
ret = SR_ERR;
|
ret = SR_ERR;
|
||||||
|
@ -871,7 +871,7 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
|
||||||
while (sent < n) {
|
while (sent < n) {
|
||||||
tosend = MIN(2048, n - sent);
|
tosend = MIN(2048, n - sent);
|
||||||
|
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = tosend * sizeof(uint16_t);
|
packet.length = tosend * sizeof(uint16_t);
|
||||||
packet.unitsize = 2;
|
packet.unitsize = 2;
|
||||||
packet.payload = samples + sent;
|
packet.payload = samples + sent;
|
||||||
|
@ -915,7 +915,7 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
|
||||||
&sigma->trigger);
|
&sigma->trigger);
|
||||||
|
|
||||||
if (tosend > 0) {
|
if (tosend > 0) {
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = tosend * sizeof(uint16_t);
|
packet.length = tosend * sizeof(uint16_t);
|
||||||
packet.unitsize = 2;
|
packet.unitsize = 2;
|
||||||
packet.payload = samples;
|
packet.payload = samples;
|
||||||
|
@ -926,7 +926,7 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
|
||||||
|
|
||||||
/* Only send trigger if explicitly enabled. */
|
/* Only send trigger if explicitly enabled. */
|
||||||
if (sigma->use_triggers) {
|
if (sigma->use_triggers) {
|
||||||
packet.type = DF_TRIGGER;
|
packet.type = SR_DF_TRIGGER;
|
||||||
packet.length = 0;
|
packet.length = 0;
|
||||||
packet.payload = 0;
|
packet.payload = 0;
|
||||||
session_bus(sigma->session_id, &packet);
|
session_bus(sigma->session_id, &packet);
|
||||||
|
@ -937,7 +937,7 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
|
||||||
tosend = n - sent;
|
tosend = n - sent;
|
||||||
|
|
||||||
if (tosend > 0) {
|
if (tosend > 0) {
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = tosend * sizeof(uint16_t);
|
packet.length = tosend * sizeof(uint16_t);
|
||||||
packet.unitsize = 2;
|
packet.unitsize = 2;
|
||||||
packet.payload = samples + sent;
|
packet.payload = samples + sent;
|
||||||
|
@ -986,7 +986,7 @@ static int receive_data(int fd, int revents, void *user_data)
|
||||||
} else if (sigma->state.state == SIGMA_DOWNLOAD) {
|
} else if (sigma->state.state == SIGMA_DOWNLOAD) {
|
||||||
if (sigma->state.chunks_downloaded >= numchunks) {
|
if (sigma->state.chunks_downloaded >= numchunks) {
|
||||||
/* End of samples. */
|
/* End of samples. */
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
packet.length = 0;
|
packet.length = 0;
|
||||||
session_bus(sigma->session_id, &packet);
|
session_bus(sigma->session_id, &packet);
|
||||||
|
|
||||||
|
@ -1295,13 +1295,13 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
sigma->session_id = session_device_id;
|
sigma->session_id = session_device_id;
|
||||||
|
|
||||||
/* Send header packet to the session bus. */
|
/* Send header packet to the session bus. */
|
||||||
packet.type = DF_HEADER;
|
packet.type = SR_DF_HEADER;
|
||||||
packet.length = sizeof(struct sr_datafeed_header);
|
packet.length = sizeof(struct sr_datafeed_header);
|
||||||
packet.payload = &header;
|
packet.payload = &header;
|
||||||
header.feed_version = 1;
|
header.feed_version = 1;
|
||||||
gettimeofday(&header.starttime, NULL);
|
gettimeofday(&header.starttime, NULL);
|
||||||
header.samplerate = sigma->cur_samplerate;
|
header.samplerate = sigma->cur_samplerate;
|
||||||
header.protocol_id = PROTO_RAW;
|
header.protocol_id = SR_PROTO_RAW;
|
||||||
header.num_logic_probes = sigma->num_probes;
|
header.num_logic_probes = sigma->num_probes;
|
||||||
header.num_analog_probes = 0;
|
header.num_analog_probes = 0;
|
||||||
session_bus(session_device_id, &packet);
|
session_bus(session_device_id, &packet);
|
||||||
|
|
|
@ -48,7 +48,7 @@ int opendev2(int device_index, struct sr_device_instance **sdi,
|
||||||
*/
|
*/
|
||||||
if (!(err = libusb_open(dev, &((*sdi)->usb->devhdl)))) {
|
if (!(err = libusb_open(dev, &((*sdi)->usb->devhdl)))) {
|
||||||
(*sdi)->usb->address = libusb_get_device_address(dev);
|
(*sdi)->usb->address = libusb_get_device_address(dev);
|
||||||
(*sdi)->status = ST_ACTIVE;
|
(*sdi)->status = SR_ST_ACTIVE;
|
||||||
g_message("opened device %d on %d.%d interface %d",
|
g_message("opened device %d on %d.%d interface %d",
|
||||||
(*sdi)->index, (*sdi)->usb->bus,
|
(*sdi)->index, (*sdi)->usb->bus,
|
||||||
(*sdi)->usb->address, interface);
|
(*sdi)->usb->address, interface);
|
||||||
|
@ -78,7 +78,7 @@ int opendev3(struct sr_device_instance **sdi, libusb_device *dev,
|
||||||
&& libusb_get_device_address(dev) == (*sdi)->usb->address) {
|
&& libusb_get_device_address(dev) == (*sdi)->usb->address) {
|
||||||
/* Found it. */
|
/* Found it. */
|
||||||
if (!(err = libusb_open(dev, &((*sdi)->usb->devhdl)))) {
|
if (!(err = libusb_open(dev, &((*sdi)->usb->devhdl)))) {
|
||||||
(*sdi)->status = ST_ACTIVE;
|
(*sdi)->status = SR_ST_ACTIVE;
|
||||||
g_message("opened device %d on %d.%d interface %d",
|
g_message("opened device %d on %d.%d interface %d",
|
||||||
(*sdi)->index, (*sdi)->usb->bus,
|
(*sdi)->index, (*sdi)->usb->bus,
|
||||||
(*sdi)->usb->address, interface);
|
(*sdi)->usb->address, interface);
|
||||||
|
|
|
@ -54,11 +54,11 @@ struct databag {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int capabilities[] = {
|
static int capabilities[] = {
|
||||||
HWCAP_LOGIC_ANALYZER,
|
SR_HWCAP_LOGIC_ANALYZER,
|
||||||
HWCAP_PATTERN_MODE,
|
SR_HWCAP_PATTERN_MODE,
|
||||||
HWCAP_LIMIT_SAMPLES,
|
SR_HWCAP_LIMIT_SAMPLES,
|
||||||
HWCAP_LIMIT_MSEC,
|
SR_HWCAP_LIMIT_MSEC,
|
||||||
HWCAP_CONTINUOUS
|
SR_HWCAP_CONTINUOUS,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *patternmodes[] = {
|
static const char *patternmodes[] = {
|
||||||
|
@ -96,7 +96,7 @@ static int hw_init(char *deviceinfo)
|
||||||
/* Avoid compiler warnings. */
|
/* Avoid compiler warnings. */
|
||||||
deviceinfo = deviceinfo;
|
deviceinfo = deviceinfo;
|
||||||
|
|
||||||
sdi = sr_device_instance_new(0, ST_ACTIVE, DEMONAME, NULL, NULL);
|
sdi = sr_device_instance_new(0, SR_ST_ACTIVE, DEMONAME, NULL, NULL);
|
||||||
if (!sdi)
|
if (!sdi)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -136,16 +136,16 @@ static void *hw_get_device_info(int device_index, int device_info_id)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
switch (device_info_id) {
|
switch (device_info_id) {
|
||||||
case DI_INSTANCE:
|
case SR_DI_INSTANCE:
|
||||||
info = sdi;
|
info = sdi;
|
||||||
break;
|
break;
|
||||||
case DI_NUM_PROBES:
|
case SR_DI_NUM_PROBES:
|
||||||
info = GINT_TO_POINTER(NUM_PROBES);
|
info = GINT_TO_POINTER(NUM_PROBES);
|
||||||
break;
|
break;
|
||||||
case DI_CUR_SAMPLERATE:
|
case SR_DI_CUR_SAMPLERATE:
|
||||||
info = &cur_samplerate;
|
info = &cur_samplerate;
|
||||||
break;
|
break;
|
||||||
case DI_PATTERNMODES:
|
case SR_DI_PATTERNMODES:
|
||||||
info = &patternmodes;
|
info = &patternmodes;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ static int hw_get_status(int device_index)
|
||||||
/* Avoid compiler warnings. */
|
/* Avoid compiler warnings. */
|
||||||
device_index = device_index;
|
device_index = device_index;
|
||||||
|
|
||||||
return ST_ACTIVE;
|
return SR_ST_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int *hw_get_capabilities(void)
|
static int *hw_get_capabilities(void)
|
||||||
|
@ -175,18 +175,18 @@ static int hw_set_configuration(int device_index, int capability, void *value)
|
||||||
/* Avoid compiler warnings. */
|
/* Avoid compiler warnings. */
|
||||||
device_index = device_index;
|
device_index = device_index;
|
||||||
|
|
||||||
if (capability == HWCAP_PROBECONFIG) {
|
if (capability == SR_HWCAP_PROBECONFIG) {
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
ret = SR_OK;
|
ret = SR_OK;
|
||||||
} else if (capability == HWCAP_LIMIT_SAMPLES) {
|
} else if (capability == SR_HWCAP_LIMIT_SAMPLES) {
|
||||||
tmp_u64 = value;
|
tmp_u64 = value;
|
||||||
limit_samples = *tmp_u64;
|
limit_samples = *tmp_u64;
|
||||||
ret = SR_OK;
|
ret = SR_OK;
|
||||||
} else if (capability == HWCAP_LIMIT_MSEC) {
|
} else if (capability == SR_HWCAP_LIMIT_MSEC) {
|
||||||
tmp_u64 = value;
|
tmp_u64 = value;
|
||||||
limit_msec = *tmp_u64;
|
limit_msec = *tmp_u64;
|
||||||
ret = SR_OK;
|
ret = SR_OK;
|
||||||
} else if (capability == HWCAP_PATTERN_MODE) {
|
} else if (capability == SR_HWCAP_PATTERN_MODE) {
|
||||||
stropt = value;
|
stropt = value;
|
||||||
if (!strcmp(stropt, "random")) {
|
if (!strcmp(stropt, "random")) {
|
||||||
default_genmode = GENMODE_RANDOM;
|
default_genmode = GENMODE_RANDOM;
|
||||||
|
@ -295,7 +295,7 @@ static int receive_data(int fd, int revents, void *user_data)
|
||||||
(gchar *)&c, BUFSIZE, &z, NULL);
|
(gchar *)&c, BUFSIZE, &z, NULL);
|
||||||
|
|
||||||
if (z > 0) {
|
if (z > 0) {
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = z;
|
packet.length = z;
|
||||||
packet.unitsize = 1;
|
packet.unitsize = 1;
|
||||||
packet.payload = c;
|
packet.payload = c;
|
||||||
|
@ -309,7 +309,7 @@ static int receive_data(int fd, int revents, void *user_data)
|
||||||
g_io_channel_close(channels[0]);
|
g_io_channel_close(channels[0]);
|
||||||
|
|
||||||
/* Send last packet. */
|
/* Send last packet. */
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
session_bus(user_data, &packet);
|
session_bus(user_data, &packet);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -364,13 +364,13 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
if (!packet || !header)
|
if (!packet || !header)
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
|
|
||||||
packet->type = DF_HEADER;
|
packet->type = SR_DF_HEADER;
|
||||||
packet->length = sizeof(struct sr_datafeed_header);
|
packet->length = sizeof(struct sr_datafeed_header);
|
||||||
packet->payload = (unsigned char *)header;
|
packet->payload = (unsigned char *)header;
|
||||||
header->feed_version = 1;
|
header->feed_version = 1;
|
||||||
gettimeofday(&header->starttime, NULL);
|
gettimeofday(&header->starttime, NULL);
|
||||||
header->samplerate = cur_samplerate;
|
header->samplerate = cur_samplerate;
|
||||||
header->protocol_id = PROTO_RAW;
|
header->protocol_id = SR_PROTO_RAW;
|
||||||
header->num_logic_probes = NUM_PROBES;
|
header->num_logic_probes = NUM_PROBES;
|
||||||
header->num_analog_probes = 0;
|
header->num_analog_probes = 0;
|
||||||
session_bus(session_device_id, packet);
|
session_bus(session_device_id, packet);
|
||||||
|
|
|
@ -36,13 +36,13 @@
|
||||||
#define USB_PRODUCT "f190"
|
#define USB_PRODUCT "f190"
|
||||||
|
|
||||||
static int capabilities[] = {
|
static int capabilities[] = {
|
||||||
HWCAP_LOGIC_ANALYZER,
|
SR_HWCAP_LOGIC_ANALYZER,
|
||||||
// HWCAP_OSCILLOSCOPE,
|
// SR_HWCAP_OSCILLOSCOPE,
|
||||||
// HWCAP_PAT_GENERATOR,
|
// SR_HWCAP_PAT_GENERATOR,
|
||||||
|
|
||||||
HWCAP_SAMPLERATE,
|
SR_HWCAP_SAMPLERATE,
|
||||||
// HWCAP_CAPTURE_RATIO,
|
// SR_HWCAP_CAPTURE_RATIO,
|
||||||
HWCAP_LIMIT_SAMPLES,
|
SR_HWCAP_LIMIT_SAMPLES,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ static int hw_init(char *deviceinfo)
|
||||||
/* hardware initial state */
|
/* hardware initial state */
|
||||||
mso->ctlbase = 0;
|
mso->ctlbase = 0;
|
||||||
|
|
||||||
sdi = sr_device_instance_new(devcnt, ST_INITIALIZING,
|
sdi = sr_device_instance_new(devcnt, SR_ST_INITIALIZING,
|
||||||
manufacturer, product, hwrev);
|
manufacturer, product, hwrev);
|
||||||
if (!sdi) {
|
if (!sdi) {
|
||||||
g_warning("Unable to create device instance for %s",
|
g_warning("Unable to create device instance for %s",
|
||||||
|
@ -493,7 +493,7 @@ static int hw_opendev(int device_index)
|
||||||
if (ret != SR_OK)
|
if (ret != SR_OK)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
sdi->status = ST_ACTIVE;
|
sdi->status = SR_ST_ACTIVE;
|
||||||
|
|
||||||
/* FIXME: discard serial buffer */
|
/* FIXME: discard serial buffer */
|
||||||
|
|
||||||
|
@ -525,7 +525,7 @@ static void hw_closedev(int device_index)
|
||||||
if (sdi->serial->fd != -1) {
|
if (sdi->serial->fd != -1) {
|
||||||
serial_close(sdi->serial->fd);
|
serial_close(sdi->serial->fd);
|
||||||
sdi->serial->fd = -1;
|
sdi->serial->fd = -1;
|
||||||
sdi->status = ST_INACTIVE;
|
sdi->status = SR_ST_INACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -540,19 +540,19 @@ static void *hw_get_device_info(int device_index, int device_info_id)
|
||||||
mso = sdi->priv;
|
mso = sdi->priv;
|
||||||
|
|
||||||
switch (device_info_id) {
|
switch (device_info_id) {
|
||||||
case DI_INSTANCE:
|
case SR_DI_INSTANCE:
|
||||||
info = sdi;
|
info = sdi;
|
||||||
break;
|
break;
|
||||||
case DI_NUM_PROBES: /* FIXME: How to report analog probe? */
|
case SR_DI_NUM_PROBES: /* FIXME: How to report analog probe? */
|
||||||
info = GINT_TO_POINTER(8);
|
info = GINT_TO_POINTER(8);
|
||||||
break;
|
break;
|
||||||
case DI_SAMPLERATES:
|
case SR_DI_SAMPLERATES:
|
||||||
info = &samplerates;
|
info = &samplerates;
|
||||||
break;
|
break;
|
||||||
case DI_TRIGGER_TYPES:
|
case SR_DI_TRIGGER_TYPES:
|
||||||
info = "01"; /* FIXME */
|
info = "01"; /* FIXME */
|
||||||
break;
|
break;
|
||||||
case DI_CUR_SAMPLERATE:
|
case SR_DI_CUR_SAMPLERATE:
|
||||||
info = &mso->cur_rate;
|
info = &mso->cur_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -564,7 +564,7 @@ static int hw_get_status(int device_index)
|
||||||
struct sr_device_instance *sdi;
|
struct sr_device_instance *sdi;
|
||||||
|
|
||||||
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
||||||
return ST_NOT_FOUND;
|
return SR_ST_NOT_FOUND;
|
||||||
|
|
||||||
return sdi->status;
|
return sdi->status;
|
||||||
}
|
}
|
||||||
|
@ -582,10 +582,10 @@ static int hw_set_configuration(int device_index, int capability, void *value)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
switch (capability) {
|
switch (capability) {
|
||||||
case HWCAP_SAMPLERATE:
|
case SR_HWCAP_SAMPLERATE:
|
||||||
return mso_configure_rate(sdi, *(uint64_t *) value);
|
return mso_configure_rate(sdi, *(uint64_t *) value);
|
||||||
case HWCAP_PROBECONFIG:
|
case SR_HWCAP_PROBECONFIG:
|
||||||
case HWCAP_LIMIT_SAMPLES:
|
case SR_HWCAP_LIMIT_SAMPLES:
|
||||||
default:
|
default:
|
||||||
return SR_OK; /* FIXME */
|
return SR_OK; /* FIXME */
|
||||||
}
|
}
|
||||||
|
@ -645,20 +645,20 @@ static int receive_data(int fd, int revents, void *user_data)
|
||||||
((mso->buffer[i * 3 + 2] & 0x3f) << 2);
|
((mso->buffer[i * 3 + 2] & 0x3f) << 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = 1024;
|
packet.length = 1024;
|
||||||
packet.unitsize = 1;
|
packet.unitsize = 1;
|
||||||
packet.payload = logic_out;
|
packet.payload = logic_out;
|
||||||
session_bus(mso->session_id, &packet);
|
session_bus(mso->session_id, &packet);
|
||||||
|
|
||||||
|
|
||||||
packet.type = DF_ANALOG;
|
packet.type = SR_DF_ANALOG;
|
||||||
packet.length = 1024;
|
packet.length = 1024;
|
||||||
packet.unitsize = sizeof(double);
|
packet.unitsize = sizeof(double);
|
||||||
packet.payload = analog_out;
|
packet.payload = analog_out;
|
||||||
session_bus(mso->session_id, &packet);
|
session_bus(mso->session_id, &packet);
|
||||||
|
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
session_bus(mso->session_id, &packet);
|
session_bus(mso->session_id, &packet);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -725,7 +725,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
mso->session_id = session_device_id;
|
mso->session_id = session_device_id;
|
||||||
source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, sdi);
|
source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, sdi);
|
||||||
|
|
||||||
packet.type = DF_HEADER;
|
packet.type = SR_DF_HEADER;
|
||||||
packet.length = sizeof(struct sr_datafeed_header);
|
packet.length = sizeof(struct sr_datafeed_header);
|
||||||
packet.payload = (unsigned char *) &header;
|
packet.payload = (unsigned char *) &header;
|
||||||
header.feed_version = 1;
|
header.feed_version = 1;
|
||||||
|
@ -733,7 +733,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
header.samplerate = mso->cur_rate;
|
header.samplerate = mso->cur_rate;
|
||||||
header.num_analog_probes = 1;
|
header.num_analog_probes = 1;
|
||||||
header.num_logic_probes = 8;
|
header.num_logic_probes = 8;
|
||||||
header.protocol_id = PROTO_RAW;
|
header.protocol_id = SR_PROTO_RAW;
|
||||||
session_bus(session_device_id, &packet);
|
session_bus(session_device_id, &packet);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -746,7 +746,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
|
||||||
|
|
||||||
device_index = device_index;
|
device_index = device_index;
|
||||||
|
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
session_bus(session_device_id, &packet);
|
session_bus(session_device_id, &packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,10 +82,10 @@
|
||||||
#define FLAG_RLE 0x0100
|
#define FLAG_RLE 0x0100
|
||||||
|
|
||||||
static int capabilities[] = {
|
static int capabilities[] = {
|
||||||
HWCAP_LOGIC_ANALYZER,
|
SR_HWCAP_LOGIC_ANALYZER,
|
||||||
HWCAP_SAMPLERATE,
|
SR_HWCAP_SAMPLERATE,
|
||||||
HWCAP_CAPTURE_RATIO,
|
SR_HWCAP_CAPTURE_RATIO,
|
||||||
HWCAP_LIMIT_SAMPLES,
|
SR_HWCAP_LIMIT_SAMPLES,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -287,12 +287,12 @@ static int hw_init(char *deviceinfo)
|
||||||
|| !strncmp(buf, "1ALS", 4)) {
|
|| !strncmp(buf, "1ALS", 4)) {
|
||||||
if (!strncmp(buf, "1SLO", 4))
|
if (!strncmp(buf, "1SLO", 4))
|
||||||
sdi = sr_device_instance_new
|
sdi = sr_device_instance_new
|
||||||
(final_devcnt, ST_INACTIVE,
|
(final_devcnt, SR_ST_INACTIVE,
|
||||||
"Openbench",
|
"Openbench",
|
||||||
"Logic Sniffer", "v1.0");
|
"Logic Sniffer", "v1.0");
|
||||||
else
|
else
|
||||||
sdi = sr_device_instance_new
|
sdi = sr_device_instance_new
|
||||||
(final_devcnt, ST_INACTIVE,
|
(final_devcnt, SR_ST_INACTIVE,
|
||||||
"Openbench", "Logic Sniffer",
|
"Openbench", "Logic Sniffer",
|
||||||
"v1.0");
|
"v1.0");
|
||||||
sdi->serial = sr_serial_device_instance_new
|
sdi->serial = sr_serial_device_instance_new
|
||||||
|
@ -335,7 +335,7 @@ static int hw_opendev(int device_index)
|
||||||
if (sdi->serial->fd == -1)
|
if (sdi->serial->fd == -1)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
sdi->status = ST_ACTIVE;
|
sdi->status = SR_ST_ACTIVE;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
}
|
}
|
||||||
|
@ -350,7 +350,7 @@ static void hw_closedev(int device_index)
|
||||||
if (sdi->serial->fd != -1) {
|
if (sdi->serial->fd != -1) {
|
||||||
serial_close(sdi->serial->fd);
|
serial_close(sdi->serial->fd);
|
||||||
sdi->serial->fd = -1;
|
sdi->serial->fd = -1;
|
||||||
sdi->status = ST_INACTIVE;
|
sdi->status = SR_ST_INACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,19 +380,19 @@ static void *hw_get_device_info(int device_index, int device_info_id)
|
||||||
|
|
||||||
info = NULL;
|
info = NULL;
|
||||||
switch (device_info_id) {
|
switch (device_info_id) {
|
||||||
case DI_INSTANCE:
|
case SR_DI_INSTANCE:
|
||||||
info = sdi;
|
info = sdi;
|
||||||
break;
|
break;
|
||||||
case DI_NUM_PROBES:
|
case SR_DI_NUM_PROBES:
|
||||||
info = GINT_TO_POINTER(NUM_PROBES);
|
info = GINT_TO_POINTER(NUM_PROBES);
|
||||||
break;
|
break;
|
||||||
case DI_SAMPLERATES:
|
case SR_DI_SAMPLERATES:
|
||||||
info = &samplerates;
|
info = &samplerates;
|
||||||
break;
|
break;
|
||||||
case DI_TRIGGER_TYPES:
|
case SR_DI_TRIGGER_TYPES:
|
||||||
info = (char *)TRIGGER_TYPES;
|
info = (char *)TRIGGER_TYPES;
|
||||||
break;
|
break;
|
||||||
case DI_CUR_SAMPLERATE:
|
case SR_DI_CUR_SAMPLERATE:
|
||||||
info = &cur_samplerate;
|
info = &cur_samplerate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -405,7 +405,7 @@ static int hw_get_status(int device_index)
|
||||||
struct sr_device_instance *sdi;
|
struct sr_device_instance *sdi;
|
||||||
|
|
||||||
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
||||||
return ST_NOT_FOUND;
|
return SR_ST_NOT_FOUND;
|
||||||
|
|
||||||
return sdi->status;
|
return sdi->status;
|
||||||
}
|
}
|
||||||
|
@ -450,18 +450,18 @@ static int hw_set_configuration(int device_index, int capability, void *value)
|
||||||
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
if (sdi->status != ST_ACTIVE)
|
if (sdi->status != SR_ST_ACTIVE)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
switch (capability) {
|
switch (capability) {
|
||||||
case HWCAP_SAMPLERATE:
|
case SR_HWCAP_SAMPLERATE:
|
||||||
tmp_u64 = value;
|
tmp_u64 = value;
|
||||||
ret = set_configuration_samplerate(sdi, *tmp_u64);
|
ret = set_configuration_samplerate(sdi, *tmp_u64);
|
||||||
break;
|
break;
|
||||||
case HWCAP_PROBECONFIG:
|
case SR_HWCAP_PROBECONFIG:
|
||||||
ret = configure_probes((GSList *) value);
|
ret = configure_probes((GSList *) value);
|
||||||
break;
|
break;
|
||||||
case HWCAP_LIMIT_SAMPLES:
|
case SR_HWCAP_LIMIT_SAMPLES:
|
||||||
tmp_u64 = value;
|
tmp_u64 = value;
|
||||||
if (*tmp_u64 < MIN_NUM_SAMPLES)
|
if (*tmp_u64 < MIN_NUM_SAMPLES)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
@ -469,7 +469,7 @@ static int hw_set_configuration(int device_index, int capability, void *value)
|
||||||
g_message("ols: sample limit %" PRIu64, limit_samples);
|
g_message("ols: sample limit %" PRIu64, limit_samples);
|
||||||
ret = SR_OK;
|
ret = SR_OK;
|
||||||
break;
|
break;
|
||||||
case HWCAP_CAPTURE_RATIO:
|
case SR_HWCAP_CAPTURE_RATIO:
|
||||||
tmp_u64 = value;
|
tmp_u64 = value;
|
||||||
capture_ratio = *tmp_u64;
|
capture_ratio = *tmp_u64;
|
||||||
if (capture_ratio < 0 || capture_ratio > 100) {
|
if (capture_ratio < 0 || capture_ratio > 100) {
|
||||||
|
@ -612,24 +612,24 @@ static int receive_data(int fd, int revents, void *user_data)
|
||||||
*/
|
*/
|
||||||
if (trigger_at > 0) {
|
if (trigger_at > 0) {
|
||||||
/* there are pre-trigger samples, send those first */
|
/* there are pre-trigger samples, send those first */
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = trigger_at * 4;
|
packet.length = trigger_at * 4;
|
||||||
packet.unitsize = 4;
|
packet.unitsize = 4;
|
||||||
packet.payload = raw_sample_buf;
|
packet.payload = raw_sample_buf;
|
||||||
session_bus(user_data, &packet);
|
session_bus(user_data, &packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
packet.type = DF_TRIGGER;
|
packet.type = SR_DF_TRIGGER;
|
||||||
packet.length = 0;
|
packet.length = 0;
|
||||||
session_bus(user_data, &packet);
|
session_bus(user_data, &packet);
|
||||||
|
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = (limit_samples * 4) - (trigger_at * 4);
|
packet.length = (limit_samples * 4) - (trigger_at * 4);
|
||||||
packet.unitsize = 4;
|
packet.unitsize = 4;
|
||||||
packet.payload = raw_sample_buf + trigger_at * 4;
|
packet.payload = raw_sample_buf + trigger_at * 4;
|
||||||
session_bus(user_data, &packet);
|
session_bus(user_data, &packet);
|
||||||
} else {
|
} else {
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = limit_samples * 4;
|
packet.length = limit_samples * 4;
|
||||||
packet.unitsize = 4;
|
packet.unitsize = 4;
|
||||||
packet.payload = raw_sample_buf;
|
packet.payload = raw_sample_buf;
|
||||||
|
@ -639,7 +639,7 @@ static int receive_data(int fd, int revents, void *user_data)
|
||||||
|
|
||||||
serial_flush(fd);
|
serial_flush(fd);
|
||||||
serial_close(fd);
|
serial_close(fd);
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
packet.length = 0;
|
packet.length = 0;
|
||||||
session_bus(user_data, &packet);
|
session_bus(user_data, &packet);
|
||||||
}
|
}
|
||||||
|
@ -661,7 +661,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
if (sdi->status != ST_ACTIVE)
|
if (sdi->status != SR_ST_ACTIVE)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
readcount = limit_samples / 4;
|
readcount = limit_samples / 4;
|
||||||
|
@ -761,13 +761,13 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
header = g_malloc(sizeof(struct sr_datafeed_header));
|
header = g_malloc(sizeof(struct sr_datafeed_header));
|
||||||
if (!packet || !header)
|
if (!packet || !header)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
packet->type = DF_HEADER;
|
packet->type = SR_DF_HEADER;
|
||||||
packet->length = sizeof(struct sr_datafeed_header);
|
packet->length = sizeof(struct sr_datafeed_header);
|
||||||
packet->payload = (unsigned char *)header;
|
packet->payload = (unsigned char *)header;
|
||||||
header->feed_version = 1;
|
header->feed_version = 1;
|
||||||
gettimeofday(&header->starttime, NULL);
|
gettimeofday(&header->starttime, NULL);
|
||||||
header->samplerate = cur_samplerate;
|
header->samplerate = cur_samplerate;
|
||||||
header->protocol_id = PROTO_RAW;
|
header->protocol_id = SR_PROTO_RAW;
|
||||||
header->num_logic_probes = NUM_PROBES;
|
header->num_logic_probes = NUM_PROBES;
|
||||||
header->num_analog_probes = 0;
|
header->num_analog_probes = 0;
|
||||||
session_bus(session_device_id, packet);
|
session_bus(session_device_id, packet);
|
||||||
|
@ -784,7 +784,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
|
||||||
/* Avoid compiler warnings. */
|
/* Avoid compiler warnings. */
|
||||||
device_index = device_index;
|
device_index = device_index;
|
||||||
|
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
packet.length = 0;
|
packet.length = 0;
|
||||||
session_bus(session_device_id, &packet);
|
session_bus(session_device_id, &packet);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,12 +50,12 @@
|
||||||
|
|
||||||
/* There is only one model Saleae Logic, and this is what it supports: */
|
/* There is only one model Saleae Logic, and this is what it supports: */
|
||||||
static int capabilities[] = {
|
static int capabilities[] = {
|
||||||
HWCAP_LOGIC_ANALYZER,
|
SR_HWCAP_LOGIC_ANALYZER,
|
||||||
HWCAP_SAMPLERATE,
|
SR_HWCAP_SAMPLERATE,
|
||||||
|
|
||||||
/* These are really implemented in the driver, not the hardware. */
|
/* These are really implemented in the driver, not the hardware. */
|
||||||
HWCAP_LIMIT_SAMPLES,
|
SR_HWCAP_LIMIT_SAMPLES,
|
||||||
HWCAP_CONTINUOUS,
|
SR_HWCAP_CONTINUOUS,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ struct sr_device_instance *sl_open_device(int device_index)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
libusb_get_device_list(usb_context, &devlist);
|
libusb_get_device_list(usb_context, &devlist);
|
||||||
if (sdi->status == ST_INITIALIZING) {
|
if (sdi->status == SR_ST_INITIALIZING) {
|
||||||
/*
|
/*
|
||||||
* This device was renumerating last time we touched it.
|
* This device was renumerating last time we touched it.
|
||||||
* opendev() guarantees we've waited long enough for it to
|
* opendev() guarantees we've waited long enough for it to
|
||||||
|
@ -191,7 +191,7 @@ struct sr_device_instance *sl_open_device(int device_index)
|
||||||
&skip, USB_VENDOR, USB_PRODUCT,
|
&skip, USB_VENDOR, USB_PRODUCT,
|
||||||
USB_INTERFACE);
|
USB_INTERFACE);
|
||||||
}
|
}
|
||||||
} else if (sdi->status == ST_INACTIVE) {
|
} else if (sdi->status == SR_ST_INACTIVE) {
|
||||||
/*
|
/*
|
||||||
* This device is fully enumerated, so we need to find this
|
* This device is fully enumerated, so we need to find this
|
||||||
* device by vendor, product, bus and address.
|
* device by vendor, product, bus and address.
|
||||||
|
@ -203,12 +203,12 @@ struct sr_device_instance *sl_open_device(int device_index)
|
||||||
USB_PRODUCT, USB_INTERFACE);
|
USB_PRODUCT, USB_INTERFACE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Status must be ST_ACTIVE, i.e. already in use... */
|
/* Status must be SR_ST_ACTIVE, i.e. already in use... */
|
||||||
sdi = NULL;
|
sdi = NULL;
|
||||||
}
|
}
|
||||||
libusb_free_device_list(devlist, 1);
|
libusb_free_device_list(devlist, 1);
|
||||||
|
|
||||||
if (sdi && sdi->status != ST_ACTIVE)
|
if (sdi && sdi->status != SR_ST_ACTIVE)
|
||||||
sdi = NULL;
|
sdi = NULL;
|
||||||
|
|
||||||
return sdi;
|
return sdi;
|
||||||
|
@ -238,7 +238,7 @@ static void close_device(struct sr_device_instance *sdi)
|
||||||
libusb_release_interface(sdi->usb->devhdl, USB_INTERFACE);
|
libusb_release_interface(sdi->usb->devhdl, USB_INTERFACE);
|
||||||
libusb_close(sdi->usb->devhdl);
|
libusb_close(sdi->usb->devhdl);
|
||||||
sdi->usb->devhdl = NULL;
|
sdi->usb->devhdl = NULL;
|
||||||
sdi->status = ST_INACTIVE;
|
sdi->status = SR_ST_INACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int configure_probes(GSList *probes)
|
static int configure_probes(GSList *probes)
|
||||||
|
@ -319,7 +319,7 @@ static int hw_init(char *deviceinfo)
|
||||||
if (des.idVendor != USB_VENDOR || des.idProduct != USB_PRODUCT)
|
if (des.idVendor != USB_VENDOR || des.idProduct != USB_PRODUCT)
|
||||||
continue; /* Not a Saleae Logic... */
|
continue; /* Not a Saleae Logic... */
|
||||||
|
|
||||||
sdi = sr_device_instance_new(devcnt, ST_INITIALIZING,
|
sdi = sr_device_instance_new(devcnt, SR_ST_INITIALIZING,
|
||||||
USB_VENDOR_NAME, USB_MODEL_NAME, USB_MODEL_VERSION);
|
USB_VENDOR_NAME, USB_MODEL_NAME, USB_MODEL_VERSION);
|
||||||
if (!sdi)
|
if (!sdi)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -386,7 +386,7 @@ static int hw_opendev(int device_index)
|
||||||
|
|
||||||
if (cur_samplerate == 0) {
|
if (cur_samplerate == 0) {
|
||||||
/* Samplerate hasn't been set; default to the slowest one. */
|
/* Samplerate hasn't been set; default to the slowest one. */
|
||||||
if (hw_set_configuration(device_index, HWCAP_SAMPLERATE,
|
if (hw_set_configuration(device_index, SR_HWCAP_SAMPLERATE,
|
||||||
&supported_samplerates[0]) == SR_ERR)
|
&supported_samplerates[0]) == SR_ERR)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
}
|
}
|
||||||
|
@ -430,19 +430,19 @@ static void *hw_get_device_info(int device_index, int device_info_id)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
switch (device_info_id) {
|
switch (device_info_id) {
|
||||||
case DI_INSTANCE:
|
case SR_DI_INSTANCE:
|
||||||
info = sdi;
|
info = sdi;
|
||||||
break;
|
break;
|
||||||
case DI_NUM_PROBES:
|
case SR_DI_NUM_PROBES:
|
||||||
info = GINT_TO_POINTER(NUM_PROBES);
|
info = GINT_TO_POINTER(NUM_PROBES);
|
||||||
break;
|
break;
|
||||||
case DI_SAMPLERATES:
|
case SR_DI_SAMPLERATES:
|
||||||
info = &samplerates;
|
info = &samplerates;
|
||||||
break;
|
break;
|
||||||
case DI_TRIGGER_TYPES:
|
case SR_DI_TRIGGER_TYPES:
|
||||||
info = TRIGGER_TYPES;
|
info = TRIGGER_TYPES;
|
||||||
break;
|
break;
|
||||||
case DI_CUR_SAMPLERATE:
|
case SR_DI_CUR_SAMPLERATE:
|
||||||
info = &cur_samplerate;
|
info = &cur_samplerate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -458,7 +458,7 @@ static int hw_get_status(int device_index)
|
||||||
if (sdi)
|
if (sdi)
|
||||||
return sdi->status;
|
return sdi->status;
|
||||||
else
|
else
|
||||||
return ST_NOT_FOUND;
|
return SR_ST_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int *hw_get_capabilities(void)
|
static int *hw_get_capabilities(void)
|
||||||
|
@ -506,12 +506,12 @@ static int hw_set_configuration(int device_index, int capability, void *value)
|
||||||
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
if (capability == HWCAP_SAMPLERATE) {
|
if (capability == SR_HWCAP_SAMPLERATE) {
|
||||||
tmp_u64 = value;
|
tmp_u64 = value;
|
||||||
ret = set_configuration_samplerate(sdi, *tmp_u64);
|
ret = set_configuration_samplerate(sdi, *tmp_u64);
|
||||||
} else if (capability == HWCAP_PROBECONFIG) {
|
} else if (capability == SR_HWCAP_PROBECONFIG) {
|
||||||
ret = configure_probes((GSList *) value);
|
ret = configure_probes((GSList *) value);
|
||||||
} else if (capability == HWCAP_LIMIT_SAMPLES) {
|
} else if (capability == SR_HWCAP_LIMIT_SAMPLES) {
|
||||||
tmp_u64 = value;
|
tmp_u64 = value;
|
||||||
limit_samples = *tmp_u64;
|
limit_samples = *tmp_u64;
|
||||||
ret = SR_OK;
|
ret = SR_OK;
|
||||||
|
@ -607,7 +607,7 @@ void receive_transfer(struct libusb_transfer *transfer)
|
||||||
* TODO: Send pre-trigger buffer to session bus.
|
* TODO: Send pre-trigger buffer to session bus.
|
||||||
* Tell the frontend we hit the trigger here.
|
* Tell the frontend we hit the trigger here.
|
||||||
*/
|
*/
|
||||||
packet.type = DF_TRIGGER;
|
packet.type = SR_DF_TRIGGER;
|
||||||
packet.length = 0;
|
packet.length = 0;
|
||||||
session_bus(user_data, &packet);
|
session_bus(user_data, &packet);
|
||||||
|
|
||||||
|
@ -615,7 +615,7 @@ void receive_transfer(struct libusb_transfer *transfer)
|
||||||
* Send the samples that triggered it, since we're
|
* Send the samples that triggered it, since we're
|
||||||
* skipping past them.
|
* skipping past them.
|
||||||
*/
|
*/
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = trigger_stage;
|
packet.length = trigger_stage;
|
||||||
packet.unitsize = 1;
|
packet.unitsize = 1;
|
||||||
packet.payload = trigger_buffer;
|
packet.payload = trigger_buffer;
|
||||||
|
@ -648,7 +648,7 @@ void receive_transfer(struct libusb_transfer *transfer)
|
||||||
|
|
||||||
if (trigger_stage == TRIGGER_FIRED) {
|
if (trigger_stage == TRIGGER_FIRED) {
|
||||||
/* Send the incoming transfer to the session bus. */
|
/* Send the incoming transfer to the session bus. */
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = cur_buflen - trigger_offset;
|
packet.length = cur_buflen - trigger_offset;
|
||||||
packet.unitsize = 1;
|
packet.unitsize = 1;
|
||||||
packet.payload = cur_buf + trigger_offset;
|
packet.payload = cur_buf + trigger_offset;
|
||||||
|
@ -708,13 +708,13 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
NULL);
|
NULL);
|
||||||
free(lupfd);
|
free(lupfd);
|
||||||
|
|
||||||
packet->type = DF_HEADER;
|
packet->type = SR_DF_HEADER;
|
||||||
packet->length = sizeof(struct sr_datafeed_header);
|
packet->length = sizeof(struct sr_datafeed_header);
|
||||||
packet->payload = (unsigned char *)header;
|
packet->payload = (unsigned char *)header;
|
||||||
header->feed_version = 1;
|
header->feed_version = 1;
|
||||||
gettimeofday(&header->starttime, NULL);
|
gettimeofday(&header->starttime, NULL);
|
||||||
header->samplerate = cur_samplerate;
|
header->samplerate = cur_samplerate;
|
||||||
header->protocol_id = PROTO_RAW;
|
header->protocol_id = SR_PROTO_RAW;
|
||||||
header->num_logic_probes = NUM_PROBES;
|
header->num_logic_probes = NUM_PROBES;
|
||||||
header->num_analog_probes = 0;
|
header->num_analog_probes = 0;
|
||||||
session_bus(session_device_id, packet);
|
session_bus(session_device_id, packet);
|
||||||
|
@ -732,7 +732,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
|
||||||
/* Avoid compiler warnings. */
|
/* Avoid compiler warnings. */
|
||||||
device_index = device_index;
|
device_index = device_index;
|
||||||
|
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
session_bus(session_device_id, &packet);
|
session_bus(session_device_id, &packet);
|
||||||
|
|
||||||
receive_transfer(NULL);
|
receive_transfer(NULL);
|
||||||
|
|
|
@ -62,13 +62,13 @@ model_t zeroplus_models[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int capabilities[] = {
|
static int capabilities[] = {
|
||||||
HWCAP_LOGIC_ANALYZER,
|
SR_HWCAP_LOGIC_ANALYZER,
|
||||||
HWCAP_SAMPLERATE,
|
SR_HWCAP_SAMPLERATE,
|
||||||
HWCAP_PROBECONFIG,
|
SR_HWCAP_PROBECONFIG,
|
||||||
HWCAP_CAPTURE_RATIO,
|
SR_HWCAP_CAPTURE_RATIO,
|
||||||
|
|
||||||
/* These are really implemented in the driver, not the hardware. */
|
/* These are really implemented in the driver, not the hardware. */
|
||||||
HWCAP_LIMIT_SAMPLES,
|
SR_HWCAP_LIMIT_SAMPLES,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ static int opendev4(struct sr_device_instance **sdi, libusb_device *dev,
|
||||||
|
|
||||||
/* Found it. */
|
/* Found it. */
|
||||||
if (!(err = libusb_open(dev, &((*sdi)->usb->devhdl)))) {
|
if (!(err = libusb_open(dev, &((*sdi)->usb->devhdl)))) {
|
||||||
(*sdi)->status = ST_ACTIVE;
|
(*sdi)->status = SR_ST_ACTIVE;
|
||||||
g_message("opened device %d on %d.%d interface %d",
|
g_message("opened device %d on %d.%d interface %d",
|
||||||
(*sdi)->index, (*sdi)->usb->bus,
|
(*sdi)->index, (*sdi)->usb->bus,
|
||||||
(*sdi)->usb->address, USB_INTERFACE);
|
(*sdi)->usb->address, USB_INTERFACE);
|
||||||
|
@ -200,7 +200,7 @@ struct sr_device_instance *zp_open_device(int device_index)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
libusb_get_device_list(usb_context, &devlist);
|
libusb_get_device_list(usb_context, &devlist);
|
||||||
if (sdi->status == ST_INACTIVE) {
|
if (sdi->status == SR_ST_INACTIVE) {
|
||||||
/* Find the device by vendor, product, bus and address. */
|
/* Find the device by vendor, product, bus and address. */
|
||||||
libusb_get_device_list(usb_context, &devlist);
|
libusb_get_device_list(usb_context, &devlist);
|
||||||
for (i = 0; devlist[i]; i++) {
|
for (i = 0; devlist[i]; i++) {
|
||||||
|
@ -208,12 +208,12 @@ struct sr_device_instance *zp_open_device(int device_index)
|
||||||
err = opendev4(&sdi, devlist[i], &des);
|
err = opendev4(&sdi, devlist[i], &des);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Status must be ST_ACTIVE, i.e. already in use... */
|
/* Status must be SR_ST_ACTIVE, i.e. already in use... */
|
||||||
sdi = NULL;
|
sdi = NULL;
|
||||||
}
|
}
|
||||||
libusb_free_device_list(devlist, 1);
|
libusb_free_device_list(devlist, 1);
|
||||||
|
|
||||||
if (sdi && sdi->status != ST_ACTIVE)
|
if (sdi && sdi->status != SR_ST_ACTIVE)
|
||||||
sdi = NULL;
|
sdi = NULL;
|
||||||
|
|
||||||
return sdi;
|
return sdi;
|
||||||
|
@ -229,7 +229,7 @@ static void close_device(struct sr_device_instance *sdi)
|
||||||
libusb_release_interface(sdi->usb->devhdl, USB_INTERFACE);
|
libusb_release_interface(sdi->usb->devhdl, USB_INTERFACE);
|
||||||
libusb_close(sdi->usb->devhdl);
|
libusb_close(sdi->usb->devhdl);
|
||||||
sdi->usb->devhdl = NULL;
|
sdi->usb->devhdl = NULL;
|
||||||
sdi->status = ST_INACTIVE;
|
sdi->status = SR_ST_INACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int configure_probes(GSList *probes)
|
static int configure_probes(GSList *probes)
|
||||||
|
@ -306,7 +306,7 @@ static int hw_init(char *deviceinfo)
|
||||||
* the zeroplus range?
|
* the zeroplus range?
|
||||||
*/
|
*/
|
||||||
sdi = sr_device_instance_new(devcnt,
|
sdi = sr_device_instance_new(devcnt,
|
||||||
ST_INACTIVE, USB_VENDOR_NAME,
|
SR_ST_INACTIVE, USB_VENDOR_NAME,
|
||||||
USB_MODEL_NAME, USB_MODEL_VERSION);
|
USB_MODEL_NAME, USB_MODEL_VERSION);
|
||||||
if (!sdi)
|
if (!sdi)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -360,7 +360,7 @@ static int hw_opendev(int device_index)
|
||||||
|
|
||||||
if (cur_samplerate == 0) {
|
if (cur_samplerate == 0) {
|
||||||
/* Samplerate hasn't been set. Default to the slowest one. */
|
/* Samplerate hasn't been set. Default to the slowest one. */
|
||||||
if (hw_set_configuration(device_index, HWCAP_SAMPLERATE,
|
if (hw_set_configuration(device_index, SR_HWCAP_SAMPLERATE,
|
||||||
&samplerates.low) == SR_ERR)
|
&samplerates.low) == SR_ERR)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
}
|
}
|
||||||
|
@ -404,19 +404,19 @@ static void *hw_get_device_info(int device_index, int device_info_id)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
switch (device_info_id) {
|
switch (device_info_id) {
|
||||||
case DI_INSTANCE:
|
case SR_DI_INSTANCE:
|
||||||
info = sdi;
|
info = sdi;
|
||||||
break;
|
break;
|
||||||
case DI_NUM_PROBES:
|
case SR_DI_NUM_PROBES:
|
||||||
info = GINT_TO_POINTER(num_channels);
|
info = GINT_TO_POINTER(num_channels);
|
||||||
break;
|
break;
|
||||||
case DI_SAMPLERATES:
|
case SR_DI_SAMPLERATES:
|
||||||
info = &samplerates;
|
info = &samplerates;
|
||||||
break;
|
break;
|
||||||
case DI_TRIGGER_TYPES:
|
case SR_DI_TRIGGER_TYPES:
|
||||||
info = TRIGGER_TYPES;
|
info = TRIGGER_TYPES;
|
||||||
break;
|
break;
|
||||||
case DI_CUR_SAMPLERATE:
|
case SR_DI_CUR_SAMPLERATE:
|
||||||
info = &cur_samplerate;
|
info = &cur_samplerate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,7 @@ static int hw_get_status(int device_index)
|
||||||
if (sdi)
|
if (sdi)
|
||||||
return sdi->status;
|
return sdi->status;
|
||||||
else
|
else
|
||||||
return ST_NOT_FOUND;
|
return SR_ST_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int *hw_get_capabilities(void)
|
static int *hw_get_capabilities(void)
|
||||||
|
@ -465,12 +465,12 @@ static int hw_set_configuration(int device_index, int capability, void *value)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
switch (capability) {
|
switch (capability) {
|
||||||
case HWCAP_SAMPLERATE:
|
case SR_HWCAP_SAMPLERATE:
|
||||||
tmp_u64 = value;
|
tmp_u64 = value;
|
||||||
return set_configuration_samplerate(*tmp_u64);
|
return set_configuration_samplerate(*tmp_u64);
|
||||||
case HWCAP_PROBECONFIG:
|
case SR_HWCAP_PROBECONFIG:
|
||||||
return configure_probes((GSList *) value);
|
return configure_probes((GSList *) value);
|
||||||
case HWCAP_LIMIT_SAMPLES:
|
case SR_HWCAP_LIMIT_SAMPLES:
|
||||||
tmp_u64 = value;
|
tmp_u64 = value;
|
||||||
limit_samples = *tmp_u64;
|
limit_samples = *tmp_u64;
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
@ -505,13 +505,13 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
g_message("Trigger address = 0x%x",
|
g_message("Trigger address = 0x%x",
|
||||||
analyzer_get_trigger_address(sdi->usb->devhdl));
|
analyzer_get_trigger_address(sdi->usb->devhdl));
|
||||||
|
|
||||||
packet.type = DF_HEADER;
|
packet.type = SR_DF_HEADER;
|
||||||
packet.length = sizeof(struct sr_datafeed_header);
|
packet.length = sizeof(struct sr_datafeed_header);
|
||||||
packet.payload = (unsigned char *)&header;
|
packet.payload = (unsigned char *)&header;
|
||||||
header.feed_version = 1;
|
header.feed_version = 1;
|
||||||
gettimeofday(&header.starttime, NULL);
|
gettimeofday(&header.starttime, NULL);
|
||||||
header.samplerate = cur_samplerate;
|
header.samplerate = cur_samplerate;
|
||||||
header.protocol_id = PROTO_RAW;
|
header.protocol_id = SR_PROTO_RAW;
|
||||||
header.num_logic_probes = num_channels;
|
header.num_logic_probes = num_channels;
|
||||||
header.num_analog_probes = 0;
|
header.num_analog_probes = 0;
|
||||||
session_bus(session_device_id, &packet);
|
session_bus(session_device_id, &packet);
|
||||||
|
@ -529,7 +529,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
PACKET_SIZE, res);
|
PACKET_SIZE, res);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.length = PACKET_SIZE;
|
packet.length = PACKET_SIZE;
|
||||||
packet.unitsize = 4;
|
packet.unitsize = 4;
|
||||||
packet.payload = buf;
|
packet.payload = buf;
|
||||||
|
@ -538,7 +538,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
||||||
analyzer_read_stop(sdi->usb->devhdl);
|
analyzer_read_stop(sdi->usb->devhdl);
|
||||||
g_free(buf);
|
g_free(buf);
|
||||||
|
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
session_bus(session_device_id, &packet);
|
session_bus(session_device_id, &packet);
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
@ -550,7 +550,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
|
||||||
struct sr_datafeed_packet packet;
|
struct sr_datafeed_packet packet;
|
||||||
struct sr_device_instance *sdi;
|
struct sr_device_instance *sdi;
|
||||||
|
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
session_bus(session_device_id, &packet);
|
session_bus(session_device_id, &packet);
|
||||||
|
|
||||||
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
if (!(sdi = sr_get_device_instance(device_instances, device_index)))
|
||||||
|
|
10
hwplugin.c
10
hwplugin.c
|
@ -34,9 +34,9 @@ GSList *plugins;
|
||||||
* options.
|
* options.
|
||||||
*/
|
*/
|
||||||
struct hwcap_option hwcap_options[] = {
|
struct hwcap_option hwcap_options[] = {
|
||||||
{HWCAP_SAMPLERATE, T_UINT64, "Sample rate", "samplerate"},
|
{SR_HWCAP_SAMPLERATE, SR_T_UINT64, "Sample rate", "samplerate"},
|
||||||
{HWCAP_CAPTURE_RATIO, T_UINT64, "Pre-trigger capture ratio", "captureratio"},
|
{SR_HWCAP_CAPTURE_RATIO, SR_T_UINT64, "Pre-trigger capture ratio", "captureratio"},
|
||||||
{HWCAP_PATTERN_MODE, T_CHAR, "Pattern generator mode", "patternmode"},
|
{SR_HWCAP_PATTERN_MODE, SR_T_CHAR, "Pattern generator mode", "patternmode"},
|
||||||
{0, 0, NULL, NULL},
|
{0, 0, NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -138,10 +138,10 @@ struct sr_device_instance *sr_get_device_instance(GSList *device_instances,
|
||||||
void sr_device_instance_free(struct sr_device_instance *sdi)
|
void sr_device_instance_free(struct sr_device_instance *sdi)
|
||||||
{
|
{
|
||||||
switch (sdi->instance_type) {
|
switch (sdi->instance_type) {
|
||||||
case USB_INSTANCE:
|
case SR_USB_INSTANCE:
|
||||||
sr_usb_device_instance_free(sdi->usb);
|
sr_usb_device_instance_free(sdi->usb);
|
||||||
break;
|
break;
|
||||||
case SERIAL_INSTANCE:
|
case SR_SERIAL_INSTANCE:
|
||||||
sr_serial_device_instance_free(sdi->serial);
|
sr_serial_device_instance_free(sdi->serial);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -72,16 +72,16 @@ static int loadfile(struct sr_input *in, const char *filename)
|
||||||
header.feed_version = 1;
|
header.feed_version = 1;
|
||||||
header.num_logic_probes = num_probes;
|
header.num_logic_probes = num_probes;
|
||||||
header.num_analog_probes = 0;
|
header.num_analog_probes = 0;
|
||||||
header.protocol_id = PROTO_RAW;
|
header.protocol_id = SR_PROTO_RAW;
|
||||||
header.samplerate = 0;
|
header.samplerate = 0;
|
||||||
gettimeofday(&header.starttime, NULL);
|
gettimeofday(&header.starttime, NULL);
|
||||||
packet.type = DF_HEADER;
|
packet.type = SR_DF_HEADER;
|
||||||
packet.length = sizeof(struct sr_datafeed_header);
|
packet.length = sizeof(struct sr_datafeed_header);
|
||||||
packet.payload = &header;
|
packet.payload = &header;
|
||||||
session_bus(in->vdevice, &packet);
|
session_bus(in->vdevice, &packet);
|
||||||
|
|
||||||
/* chop up the input file into chunks and feed it into the session bus */
|
/* chop up the input file into chunks and feed it into the session bus */
|
||||||
packet.type = DF_LOGIC;
|
packet.type = SR_DF_LOGIC;
|
||||||
packet.unitsize = (num_probes + 7) / 8;
|
packet.unitsize = (num_probes + 7) / 8;
|
||||||
packet.payload = buffer;
|
packet.payload = buffer;
|
||||||
while ((size = read(fd, buffer, CHUNKSIZE)) > 0) {
|
while ((size = read(fd, buffer, CHUNKSIZE)) > 0) {
|
||||||
|
@ -91,7 +91,7 @@ static int loadfile(struct sr_input *in, const char *filename)
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
/* end of stream */
|
/* end of stream */
|
||||||
packet.type = DF_END;
|
packet.type = SR_DF_END;
|
||||||
packet.length = 0;
|
packet.length = 0;
|
||||||
session_bus(in->vdevice, &packet);
|
session_bus(in->vdevice, &packet);
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,7 @@ static int init(struct sr_output *o, int default_spl, enum outputmode mode)
|
||||||
num_probes = g_slist_length(o->device->probes);
|
num_probes = g_slist_length(o->device->probes);
|
||||||
if (o->device->plugin) {
|
if (o->device->plugin) {
|
||||||
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
||||||
o->device->plugin_index, DI_CUR_SAMPLERATE));
|
o->device->plugin_index, SR_DI_CUR_SAMPLERATE));
|
||||||
if (!(samplerate_s = sr_samplerate_string(samplerate))) {
|
if (!(samplerate_s = sr_samplerate_string(samplerate))) {
|
||||||
free(ctx->header);
|
free(ctx->header);
|
||||||
free(ctx);
|
free(ctx);
|
||||||
|
@ -172,12 +172,12 @@ static int event(struct sr_output *o, int event_type, char **data_out,
|
||||||
|
|
||||||
ctx = o->internal;
|
ctx = o->internal;
|
||||||
switch (event_type) {
|
switch (event_type) {
|
||||||
case DF_TRIGGER:
|
case SR_DF_TRIGGER:
|
||||||
ctx->mark_trigger = ctx->spl_cnt;
|
ctx->mark_trigger = ctx->spl_cnt;
|
||||||
*data_out = NULL;
|
*data_out = NULL;
|
||||||
*length_out = 0;
|
*length_out = 0;
|
||||||
break;
|
break;
|
||||||
case DF_END:
|
case SR_DF_END:
|
||||||
outsize = ctx->num_enabled_probes
|
outsize = ctx->num_enabled_probes
|
||||||
* (ctx->samples_per_line + 20) + 512;
|
* (ctx->samples_per_line + 20) + 512;
|
||||||
if (!(outbuf = calloc(1, outsize)))
|
if (!(outbuf = calloc(1, outsize)))
|
||||||
|
@ -441,7 +441,7 @@ static int data_ascii(struct sr_output *o, char *data_in, uint64_t length_in,
|
||||||
struct sr_output_format output_analog_bits = {
|
struct sr_output_format output_analog_bits = {
|
||||||
"analog_bits",
|
"analog_bits",
|
||||||
"Bits (takes argument, default 64)",
|
"Bits (takes argument, default 64)",
|
||||||
DF_ANALOG,
|
SR_DF_ANALOG,
|
||||||
init_bits,
|
init_bits,
|
||||||
data_bits,
|
data_bits,
|
||||||
event,
|
event,
|
||||||
|
@ -450,7 +450,7 @@ struct sr_output_format output_analog_bits = {
|
||||||
struct sr_output_format output_analog_hex = {
|
struct sr_output_format output_analog_hex = {
|
||||||
"analog_hex",
|
"analog_hex",
|
||||||
"Hexadecimal (takes argument, default 192)",
|
"Hexadecimal (takes argument, default 192)",
|
||||||
DF_ANALOG,
|
SR_DF_ANALOG,
|
||||||
init_hex,
|
init_hex,
|
||||||
data_hex,
|
data_hex,
|
||||||
event,
|
event,
|
||||||
|
@ -459,7 +459,7 @@ struct sr_output_format output_analog_hex = {
|
||||||
struct sr_output_format output_analog_ascii = {
|
struct sr_output_format output_analog_ascii = {
|
||||||
"analog_ascii",
|
"analog_ascii",
|
||||||
"ASCII (takes argument, default 74)",
|
"ASCII (takes argument, default 74)",
|
||||||
DF_ANALOG,
|
SR_DF_ANALOG,
|
||||||
init_ascii,
|
init_ascii,
|
||||||
data_ascii,
|
data_ascii,
|
||||||
event,
|
event,
|
||||||
|
|
|
@ -46,7 +46,7 @@ static int data(struct sr_output *o, char *data_in, uint64_t length_in,
|
||||||
struct sr_output_format output_binary = {
|
struct sr_output_format output_binary = {
|
||||||
"binary",
|
"binary",
|
||||||
"Raw binary",
|
"Raw binary",
|
||||||
DF_LOGIC,
|
SR_DF_LOGIC,
|
||||||
NULL,
|
NULL,
|
||||||
data,
|
data,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
|
@ -81,7 +81,7 @@ static int init(struct sr_output *o)
|
||||||
comment[0] = '\0';
|
comment[0] = '\0';
|
||||||
if (o->device->plugin) {
|
if (o->device->plugin) {
|
||||||
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
||||||
o->device->plugin_index, DI_CUR_SAMPLERATE));
|
o->device->plugin_index, SR_DI_CUR_SAMPLERATE));
|
||||||
if (!(frequency_s = sr_samplerate_string(samplerate))) {
|
if (!(frequency_s = sr_samplerate_string(samplerate))) {
|
||||||
free(ctx->header);
|
free(ctx->header);
|
||||||
free(ctx);
|
free(ctx);
|
||||||
|
@ -126,10 +126,10 @@ static int event(struct sr_output *o, int event_type, char **data_out,
|
||||||
|
|
||||||
ctx = o->internal;
|
ctx = o->internal;
|
||||||
switch (event_type) {
|
switch (event_type) {
|
||||||
case DF_TRIGGER:
|
case SR_DF_TRIGGER:
|
||||||
/* TODO: can a trigger mark be in a gnuplot data file? */
|
/* TODO: can a trigger mark be in a gnuplot data file? */
|
||||||
break;
|
break;
|
||||||
case DF_END:
|
case SR_DF_END:
|
||||||
free(o->internal);
|
free(o->internal);
|
||||||
o->internal = NULL;
|
o->internal = NULL;
|
||||||
break;
|
break;
|
||||||
|
@ -228,7 +228,7 @@ static int analog_init(struct sr_output *o)
|
||||||
comment[0] = '\0';
|
comment[0] = '\0';
|
||||||
if (o->device->plugin) {
|
if (o->device->plugin) {
|
||||||
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
||||||
o->device->plugin_index, DI_CUR_SAMPLERATE));
|
o->device->plugin_index, SR_DI_CUR_SAMPLERATE));
|
||||||
if (!(frequency_s = sr_samplerate_string(samplerate))) {
|
if (!(frequency_s = sr_samplerate_string(samplerate))) {
|
||||||
free(ctx->header);
|
free(ctx->header);
|
||||||
free(ctx);
|
free(ctx);
|
||||||
|
@ -329,7 +329,7 @@ static int analog_data(struct sr_output *o, char *data_in, uint64_t length_in,
|
||||||
struct sr_output_format output_gnuplot = {
|
struct sr_output_format output_gnuplot = {
|
||||||
"gnuplot",
|
"gnuplot",
|
||||||
"Gnuplot",
|
"Gnuplot",
|
||||||
DF_LOGIC,
|
SR_DF_LOGIC,
|
||||||
init,
|
init,
|
||||||
data,
|
data,
|
||||||
event,
|
event,
|
||||||
|
@ -338,7 +338,7 @@ struct sr_output_format output_gnuplot = {
|
||||||
struct sr_output_format output_analog_gnuplot = {
|
struct sr_output_format output_analog_gnuplot = {
|
||||||
"analog_gnuplot",
|
"analog_gnuplot",
|
||||||
"Gnuplot analog",
|
"Gnuplot analog",
|
||||||
DF_ANALOG,
|
SR_DF_ANALOG,
|
||||||
analog_init,
|
analog_init,
|
||||||
analog_data,
|
analog_data,
|
||||||
event,
|
event,
|
||||||
|
|
|
@ -104,7 +104,7 @@ static int init(struct sr_output *o)
|
||||||
|
|
||||||
if (o->device->plugin) {
|
if (o->device->plugin) {
|
||||||
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
||||||
o->device->plugin_index, DI_CUR_SAMPLERATE));
|
o->device->plugin_index, SR_DI_CUR_SAMPLERATE));
|
||||||
if (!(frequency_s = sr_samplerate_string(samplerate))) {
|
if (!(frequency_s = sr_samplerate_string(samplerate))) {
|
||||||
free(ctx->header);
|
free(ctx->header);
|
||||||
free(ctx);
|
free(ctx);
|
||||||
|
@ -162,10 +162,10 @@ static int event(struct sr_output *o, int event_type, char **data_out,
|
||||||
|
|
||||||
ctx = o->internal;
|
ctx = o->internal;
|
||||||
switch (event_type) {
|
switch (event_type) {
|
||||||
case DF_TRIGGER:
|
case SR_DF_TRIGGER:
|
||||||
/* TODO */
|
/* TODO */
|
||||||
break;
|
break;
|
||||||
case DF_END:
|
case SR_DF_END:
|
||||||
free(o->internal);
|
free(o->internal);
|
||||||
o->internal = NULL;
|
o->internal = NULL;
|
||||||
break;
|
break;
|
||||||
|
@ -221,7 +221,7 @@ static int data(struct sr_output *o, char *data_in, uint64_t length_in,
|
||||||
struct sr_output_format output_ols = {
|
struct sr_output_format output_ols = {
|
||||||
"ols",
|
"ols",
|
||||||
"OpenBench Logic Sniffer",
|
"OpenBench Logic Sniffer",
|
||||||
DF_LOGIC,
|
SR_DF_LOGIC,
|
||||||
init,
|
init,
|
||||||
data,
|
data,
|
||||||
event,
|
event,
|
||||||
|
|
|
@ -40,7 +40,7 @@ static int event(struct sr_output *o, int event_type, char **data_out,
|
||||||
struct sr_output_format output_foo = {
|
struct sr_output_format output_foo = {
|
||||||
"foo",
|
"foo",
|
||||||
"The foo format",
|
"The foo format",
|
||||||
DF_LOGIC,
|
SR_DF_LOGIC,
|
||||||
init,
|
init,
|
||||||
data,
|
data,
|
||||||
event,
|
event,
|
||||||
|
|
|
@ -93,7 +93,7 @@ static int init(struct sr_output *o)
|
||||||
|
|
||||||
if (o->device->plugin) {
|
if (o->device->plugin) {
|
||||||
ctx->samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
ctx->samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
||||||
o->device->plugin_index, DI_CUR_SAMPLERATE));
|
o->device->plugin_index, SR_DI_CUR_SAMPLERATE));
|
||||||
if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) {
|
if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) {
|
||||||
g_string_free(ctx->header, TRUE);
|
g_string_free(ctx->header, TRUE);
|
||||||
free(ctx);
|
free(ctx);
|
||||||
|
@ -149,7 +149,7 @@ static int event(struct sr_output *o, int event_type, char **data_out,
|
||||||
|
|
||||||
ctx = o->internal;
|
ctx = o->internal;
|
||||||
switch (event_type) {
|
switch (event_type) {
|
||||||
case DF_END:
|
case SR_DF_END:
|
||||||
outbuf = strdup("$dumpoff\n$end\n");
|
outbuf = strdup("$dumpoff\n$end\n");
|
||||||
*data_out = outbuf;
|
*data_out = outbuf;
|
||||||
*length_out = strlen(outbuf);
|
*length_out = strlen(outbuf);
|
||||||
|
@ -225,7 +225,7 @@ static int data(struct sr_output *o, char *data_in, uint64_t length_in,
|
||||||
struct sr_output_format output_vcd = {
|
struct sr_output_format output_vcd = {
|
||||||
"vcd",
|
"vcd",
|
||||||
"Value Change Dump (VCD)",
|
"Value Change Dump (VCD)",
|
||||||
DF_LOGIC,
|
SR_DF_LOGIC,
|
||||||
init,
|
init,
|
||||||
data,
|
data,
|
||||||
event,
|
event,
|
||||||
|
|
|
@ -118,7 +118,7 @@ int data_ascii(struct sr_output *o, char *data_in, uint64_t length_in,
|
||||||
struct sr_output_format output_text_ascii = {
|
struct sr_output_format output_text_ascii = {
|
||||||
"ascii",
|
"ascii",
|
||||||
"ASCII (takes argument, default 74)",
|
"ASCII (takes argument, default 74)",
|
||||||
DF_LOGIC,
|
SR_DF_LOGIC,
|
||||||
init_ascii,
|
init_ascii,
|
||||||
data_ascii,
|
data_ascii,
|
||||||
event,
|
event,
|
||||||
|
|
|
@ -105,7 +105,7 @@ int data_bits(struct sr_output *o, char *data_in, uint64_t length_in,
|
||||||
struct sr_output_format output_text_bits = {
|
struct sr_output_format output_text_bits = {
|
||||||
"bits",
|
"bits",
|
||||||
"Bits (takes argument, default 64)",
|
"Bits (takes argument, default 64)",
|
||||||
DF_LOGIC,
|
SR_DF_LOGIC,
|
||||||
init_bits,
|
init_bits,
|
||||||
data_bits,
|
data_bits,
|
||||||
event,
|
event,
|
||||||
|
|
|
@ -94,7 +94,7 @@ int data_hex(struct sr_output *o, char *data_in, uint64_t length_in,
|
||||||
struct sr_output_format output_text_hex = {
|
struct sr_output_format output_text_hex = {
|
||||||
"hex",
|
"hex",
|
||||||
"Hexadecimal (takes argument, default 192)",
|
"Hexadecimal (takes argument, default 192)",
|
||||||
DF_LOGIC,
|
SR_DF_LOGIC,
|
||||||
init_hex,
|
init_hex,
|
||||||
data_hex,
|
data_hex,
|
||||||
event,
|
event,
|
||||||
|
|
|
@ -109,7 +109,7 @@ int init(struct sr_output *o, int default_spl, enum outputmode mode)
|
||||||
num_probes = g_slist_length(o->device->probes);
|
num_probes = g_slist_length(o->device->probes);
|
||||||
if (o->device->plugin) {
|
if (o->device->plugin) {
|
||||||
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
||||||
o->device->plugin_index, DI_CUR_SAMPLERATE));
|
o->device->plugin_index, SR_DI_CUR_SAMPLERATE));
|
||||||
if (!(samplerate_s = sr_samplerate_string(samplerate))) {
|
if (!(samplerate_s = sr_samplerate_string(samplerate))) {
|
||||||
free(ctx->header);
|
free(ctx->header);
|
||||||
free(ctx);
|
free(ctx);
|
||||||
|
@ -146,12 +146,12 @@ int event(struct sr_output *o, int event_type, char **data_out,
|
||||||
|
|
||||||
ctx = o->internal;
|
ctx = o->internal;
|
||||||
switch (event_type) {
|
switch (event_type) {
|
||||||
case DF_TRIGGER:
|
case SR_DF_TRIGGER:
|
||||||
ctx->mark_trigger = ctx->spl_cnt;
|
ctx->mark_trigger = ctx->spl_cnt;
|
||||||
*data_out = NULL;
|
*data_out = NULL;
|
||||||
*length_out = 0;
|
*length_out = 0;
|
||||||
break;
|
break;
|
||||||
case DF_END:
|
case SR_DF_END:
|
||||||
outsize = ctx->num_enabled_probes
|
outsize = ctx->num_enabled_probes
|
||||||
* (ctx->samples_per_line + 20) + 512;
|
* (ctx->samples_per_line + 20) + 512;
|
||||||
if (!(outbuf = calloc(1, outsize)))
|
if (!(outbuf = calloc(1, outsize)))
|
||||||
|
|
66
sigrok.h
66
sigrok.h
|
@ -76,13 +76,13 @@ typedef int (*receive_data_callback) (int fd, int revents, void *user_data);
|
||||||
|
|
||||||
/* Data types used by hardware plugins for set_configuration() */
|
/* Data types used by hardware plugins for set_configuration() */
|
||||||
enum {
|
enum {
|
||||||
T_UINT64,
|
SR_T_UINT64,
|
||||||
T_CHAR,
|
SR_T_CHAR,
|
||||||
T_NULL,
|
SR_T_NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROTO_RAW,
|
SR_PROTO_RAW,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* (Unused) protocol decoder stack entry */
|
/* (Unused) protocol decoder stack entry */
|
||||||
|
@ -94,12 +94,12 @@ struct protocol {
|
||||||
|
|
||||||
/* sr_datafeed_packet.type values */
|
/* sr_datafeed_packet.type values */
|
||||||
enum {
|
enum {
|
||||||
DF_HEADER,
|
SR_DF_HEADER,
|
||||||
DF_END,
|
SR_DF_END,
|
||||||
DF_TRIGGER,
|
SR_DF_TRIGGER,
|
||||||
DF_LOGIC,
|
SR_DF_LOGIC,
|
||||||
DF_ANALOG,
|
SR_DF_ANALOG,
|
||||||
DF_PD,
|
SR_DF_PD,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sr_datafeed_packet {
|
struct sr_datafeed_packet {
|
||||||
|
@ -198,8 +198,8 @@ struct sr_device {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROBE_TYPE_LOGIC,
|
SR_PROBE_TYPE_LOGIC,
|
||||||
PROBE_TYPE_ANALOG,
|
SR_PROBE_TYPE_ANALOG,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct probe {
|
struct probe {
|
||||||
|
@ -214,20 +214,20 @@ extern GSList *devices;
|
||||||
|
|
||||||
/* Hardware plugin capabilities */
|
/* Hardware plugin capabilities */
|
||||||
enum {
|
enum {
|
||||||
HWCAP_DUMMY, /* Used to terminate lists */
|
SR_HWCAP_DUMMY, /* Used to terminate lists */
|
||||||
/* device classes */
|
/* device classes */
|
||||||
HWCAP_LOGIC_ANALYZER,
|
SR_HWCAP_LOGIC_ANALYZER,
|
||||||
|
|
||||||
/* device options */
|
/* device options */
|
||||||
HWCAP_SAMPLERATE, /* Change samplerate */
|
SR_HWCAP_SAMPLERATE, /* Change samplerate */
|
||||||
HWCAP_PROBECONFIG, /* Configure probe mask */
|
SR_HWCAP_PROBECONFIG, /* Configure probe mask */
|
||||||
HWCAP_CAPTURE_RATIO, /* Set pre/post-trigger capture ratio */
|
SR_HWCAP_CAPTURE_RATIO, /* Set pre/post-trigger capture ratio */
|
||||||
HWCAP_PATTERN_MODE, /* Pattern generator mode */
|
SR_HWCAP_PATTERN_MODE, /* Pattern generator mode */
|
||||||
|
|
||||||
/* acquisition modes */
|
/* acquisition modes */
|
||||||
HWCAP_LIMIT_MSEC, /* Set a time limit for sample acquisition */
|
SR_HWCAP_LIMIT_MSEC, /* Set a time limit for sample acquisition */
|
||||||
HWCAP_LIMIT_SAMPLES, /* Set a limit on number of samples */
|
SR_HWCAP_LIMIT_SAMPLES, /* Set a limit on number of samples */
|
||||||
HWCAP_CONTINUOUS,
|
SR_HWCAP_CONTINUOUS,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hwcap_option {
|
struct hwcap_option {
|
||||||
|
@ -253,8 +253,8 @@ struct sr_device_instance {
|
||||||
|
|
||||||
/* sr_device_instance types */
|
/* sr_device_instance types */
|
||||||
enum {
|
enum {
|
||||||
USB_INSTANCE,
|
SR_USB_INSTANCE,
|
||||||
SERIAL_INSTANCE,
|
SR_SERIAL_INSTANCE,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sr_usb_device_instance {
|
struct sr_usb_device_instance {
|
||||||
|
@ -270,13 +270,13 @@ struct sr_serial_device_instance {
|
||||||
|
|
||||||
/* Device instance status */
|
/* Device instance status */
|
||||||
enum {
|
enum {
|
||||||
ST_NOT_FOUND,
|
SR_ST_NOT_FOUND,
|
||||||
/* Found, but still booting */
|
/* Found, but still booting */
|
||||||
ST_INITIALIZING,
|
SR_ST_INITIALIZING,
|
||||||
/* Live, but not in use */
|
/* Live, but not in use */
|
||||||
ST_INACTIVE,
|
SR_ST_INACTIVE,
|
||||||
/* Actively in use in a session */
|
/* Actively in use in a session */
|
||||||
ST_ACTIVE,
|
SR_ST_ACTIVE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -287,17 +287,17 @@ enum {
|
||||||
/* Device info IDs */
|
/* Device info IDs */
|
||||||
enum {
|
enum {
|
||||||
/* struct sr_device_instance for this specific device */
|
/* struct sr_device_instance for this specific device */
|
||||||
DI_INSTANCE,
|
SR_DI_INSTANCE,
|
||||||
/* The number of probes connected to this device */
|
/* The number of probes connected to this device */
|
||||||
DI_NUM_PROBES,
|
SR_DI_NUM_PROBES,
|
||||||
/* Samplerates supported by this device, (struct samplerates) */
|
/* Samplerates supported by this device, (struct samplerates) */
|
||||||
DI_SAMPLERATES,
|
SR_DI_SAMPLERATES,
|
||||||
/* Types of trigger supported, out of "01crf" (char *) */
|
/* Types of trigger supported, out of "01crf" (char *) */
|
||||||
DI_TRIGGER_TYPES,
|
SR_DI_TRIGGER_TYPES,
|
||||||
/* The currently set samplerate in Hz (uint64_t) */
|
/* The currently set samplerate in Hz (uint64_t) */
|
||||||
DI_CUR_SAMPLERATE,
|
SR_DI_CUR_SAMPLERATE,
|
||||||
/* Supported pattern generator modes */
|
/* Supported pattern generator modes */
|
||||||
DI_PATTERNMODES,
|
SR_DI_PATTERNMODES,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue