case DI_TRIGGER_TYPES:
info = (char *) TRIGGER_TYPES;
break;
- case DI_CUR_SAMPLE_RATE:
+ case DI_CUR_SAMPLERATE:
info = &cur_samplerate;
break;
}
packet->payload = (unsigned char *) header;
header->feed_version = 1;
gettimeofday(&header->starttime, NULL);
- header->rate = cur_samplerate;
+ header->samplerate = cur_samplerate;
header->protocol_id = PROTO_RAW;
header->num_probes = NUM_PROBES;
session_bus(session_device_id, packet);
};
/* TODO: all of these should go in a device-specific struct */
-static uint64_t cur_sample_rate = 0;
+static uint64_t cur_samplerate = 0;
static uint64_t limit_samples = 0;
static uint8_t probe_mask = 0, \
trigger_mask[NUM_TRIGGER_STAGES] = {0}, \
return SIGROK_NOK;
}
- if(cur_sample_rate == 0) {
+ if(cur_samplerate == 0) {
/* sample rate hasn't been set; default to the slowest it has */
if(hw_set_configuration(device_index, HWCAP_SAMPLERATE, &supported_samplerates[0]) == SIGROK_NOK)
return SIGROK_NOK;
case DI_TRIGGER_TYPES:
info = TRIGGER_TYPES;
break;
- case DI_CUR_SAMPLE_RATE:
- info = &cur_sample_rate;
+ case DI_CUR_SAMPLERATE:
+ info = &cur_samplerate;
break;
}
divider = (uint8_t) (48 / (float) (samplerate/1000000)) - 1;
- g_message("setting sample rate to %"PRIu64" Hz (divider %d)", samplerate, divider);
+ g_message("setting samplerate to %"PRIu64" Hz (divider %d)", samplerate, divider);
buf[0] = 0x01;
buf[1] = divider;
ret = libusb_bulk_transfer(sdi->usb->devhdl, 1 | LIBUSB_ENDPOINT_OUT, buf, 2, &result, 500);
g_warning("failed to set samplerate: %d", ret);
return SIGROK_NOK;
}
- cur_sample_rate = samplerate;
+ cur_samplerate = samplerate;
return SIGROK_OK;
}
packet->payload = (unsigned char *) header;
header->feed_version = 1;
gettimeofday(&header->starttime, NULL);
- header->rate = cur_sample_rate;
+ header->samplerate = cur_samplerate;
header->protocol_id = PROTO_RAW;
header->num_probes = NUM_PROBES;
session_bus(session_device_id, packet);
static libusb_context *usb_context = NULL;
-/* The hardware supports more sample rates than these, but these are the options
+/* The hardware supports more samplerates than these, but these are the options
hardcoded into the vendor's Windows GUI */
// XXX we shouldn't support 150MHz and 200MHz on devices that don't go up that high
case DI_TRIGGER_TYPES:
info = TRIGGER_TYPES;
break;
- case DI_CUR_SAMPLE_RATE:
+ case DI_CUR_SAMPLERATE:
info = &cur_samplerate;
break;
}
packet.payload = (unsigned char *) &header;
header.feed_version = 1;
gettimeofday(&header.starttime, NULL);
- header.rate = cur_samplerate;
+ header.samplerate = cur_samplerate;
header.protocol_id = PROTO_RAW;
header.num_probes = num_channels;
session_bus(session_device_id, &packet);
ctx->header = malloc(512);
num_probes = g_slist_length(o->device->probes);
- samplerate = *((uint64_t *) o->device->plugin->get_device_info(o->device->plugin_index, DI_CUR_SAMPLE_RATE));
+ samplerate = *((uint64_t *) o->device->plugin->get_device_info(o->device->plugin_index, DI_CUR_SAMPLERATE));
snprintf(ctx->header, 512, "Acquisition with %d/%d probes at ", ctx->num_enabled_probes, num_probes);
if(samplerate >= GHZ(1))
snprintf(ctx->header + strlen(ctx->header), 512, "%"PRIu64" GHz", samplerate / 1000000000);
ctx->header = calloc(1, MAX_HEADER_LEN + 1);
num_probes = g_slist_length(o->device->probes);
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
- o->device->plugin_index, DI_CUR_SAMPLE_RATE));
+ o->device->plugin_index, DI_CUR_SAMPLERATE));
/* Samplerate string */
if (samplerate >= GHZ(1))
struct datafeed_header {
int feed_version;
struct timeval starttime;
- uint64_t rate;
+ uint64_t samplerate;
int protocol_id;
int num_probes;
};
enum {
HWCAP_DUMMY, // used to terminate lists
HWCAP_LOGIC_ANALYZER,
- HWCAP_SAMPLERATE, // change sample rate
+ HWCAP_SAMPLERATE, // change samplerate
HWCAP_PROBECONFIG, // configure probe mask
HWCAP_CAPTURE_RATIO, // set pre-trigger / post-trigger ratio
HWCAP_LIMIT_MSEC, // set a time limit for sample acquisition
DI_INSTANCE,
/* The number of probes connected to this device */
DI_NUM_PROBES,
- /* Sample rates supported by this device, (struct samplerates) */
+ /* Samplerates supported by this device, (struct samplerates) */
DI_SAMPLERATES,
/* Types of trigger supported, out of "01crf" (char *) */
DI_TRIGGER_TYPES,
- /* The currently set sample rate in Hz (uint64_t) */
- DI_CUR_SAMPLE_RATE,
+ /* The currently set samplerate in Hz (uint64_t) */
+ DI_CUR_SAMPLERATE,
};
/* a device supports either a range of samplerates with steps of a given