ALL_ZERO
};
-SR_PRIV struct sr_dev_driver agdmm_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct sr_dev_inst *sdi;
"Memory",
};
-SR_PRIV struct sr_dev_driver appa_55ii_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct drv_context *drvc;
SR_CONF_UNDER_VOLTAGE_CONDITION_ACTIVE | SR_CONF_GET,
};
-SR_PRIV struct sr_dev_driver arachnid_labs_re_load_pro_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct sr_dev_inst *sdi;
sdi->vendor = g_strdup("Arachnid Labs");
sdi->model = g_strdup("Re:load Pro");
sdi->version = g_strdup(buf + 8);
- sdi->driver = &arachnid_labs_re_load_pro_driver_info;
+ sdi->driver = di;
sdi->inst_type = SR_INST_SERIAL;
sdi->conn = serial;
#include <config.h>
#include "protocol.h"
-SR_PRIV struct sr_dev_driver asix_sigma_driver_info;
-
/*
* Channel numbers seem to go from 1-16, according to this image:
* http://tools.asix.net/img/sigma_sigmacab_pins_720.jpg
},
};
-SR_PRIV struct sr_dev_driver atten_pps3203_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options, int modelid)
{
struct sr_dev_inst *sdi;
#include <time.h>
#include <sys/timerfd.h>
-SR_PRIV struct sr_dev_driver baylibre_acme_driver_info;
-
static const uint32_t devopts[] = {
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
#include "protocol.h"
#include "beaglelogic.h"
-SR_PRIV struct sr_dev_driver beaglelogic_driver_info;
-
/* Scan options */
static const uint32_t scanopts[] = {
SR_CONF_NUM_LOGIC_CHANNELS,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
-SR_PRIV struct sr_dev_driver brymen_bm86x_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
GSList *usb_devices, *devices, *l;
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
-SR_PRIV struct sr_dev_driver brymen_bm857_driver_info;
-static struct sr_dev_driver *di = &brymen_bm857_driver_info;
-
-static GSList *brymen_scan(const char *conn, const char *serialcomm)
+static GSList *brymen_scan(struct sr_dev_driver *di, const char *conn,
+ const char *serialcomm)
{
struct sr_dev_inst *sdi;
struct dev_context *devc;
if (serialcomm) {
/* Use the provided comm specs. */
- devices = brymen_scan(conn, serialcomm);
+ devices = brymen_scan(di, conn, serialcomm);
} else {
/* But 9600/8n1 should work all of the time. */
- devices = brymen_scan(conn, "9600/8n1/dtr=1/rts=1");
+ devices = brymen_scan(di, conn, "9600/8n1/dtr=1/rts=1");
}
return devices;
"Memory",
};
-SR_PRIV struct sr_dev_driver cem_dt_885x_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct drv_context *drvc;
#include <config.h>
#include "protocol.h"
-SR_PRIV struct sr_dev_driver chronovu_la_driver_info;
-static struct sr_dev_driver *di = &chronovu_la_driver_info;
-
static const uint32_t drvopts[] = {
SR_CONF_LOGIC_ANALYZER,
};
return std_dev_clear(di, clear_helper);
}
-static int add_device(int model, struct libusb_device_descriptor *des,
- const char *serial_num, const char *connection_id,
- libusb_device *usbdev, GSList **devices)
+static int add_device(struct sr_dev_driver *di, int model,
+ struct libusb_device_descriptor *des, const char *serial_num,
+ const char *connection_id, libusb_device *usbdev, GSList **devices)
{
int ret;
unsigned int i;
libusb_get_bus_number(devlist[i]),
libusb_get_device_address(devlist[i]), connection_id);
- if ((ret = add_device(model, &des, serial_num, connection_id,
+ if ((ret = add_device(di, model, &des, serial_num, connection_id,
devlist[i], &devices)) < 0) {
sr_dbg("Failed to add device: %d.", ret);
}
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
-SR_PRIV struct sr_dev_driver colead_slm_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct drv_context *drvc;
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_SET,
};
-SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct sr_dev_inst *sdi;
0xbe, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-SR_PRIV struct sr_dev_driver demo_driver_info;
-
static int dev_acquisition_stop(struct sr_dev_inst *sdi);
static void generate_analog_pattern(struct analog_gen *ag, uint64_t sample_rate)
#define LOG_PREFIX "deree-de5000"
-SR_PRIV struct sr_dev_driver deree_de5000_driver_info;
-
static int dev_clear(const struct sr_dev_driver *di)
{
return std_dev_clear(di, es51919_serial_clean);
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
-SR_PRIV struct sr_dev_driver flukedmm_driver_info;
-
static const char *scan_conn[] = {
/* 287/289 */
"115200/8n1",
#include "libsigrok-internal.h"
#include "protocol.h"
-SR_PRIV struct sr_dev_driver ftdi_la_driver_info;
-
static const uint32_t scanopts[] = {
SR_CONF_CONN,
};
SR_MHZ(400),
};
-SR_PRIV struct sr_dev_driver fx2lafw_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct drv_context *drvc;
#define SERIALCOMM_2X "9600/8n1/dtr=1/rts=1/flow=0"
#define VENDOR_GMC "Gossen Metrawatt"
-SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info;
-SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info;
-
static const uint32_t scanopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
VDIV_VALUES
};
-SR_PRIV struct sr_dev_driver hantek_6xxx_driver_info;
-
static int read_channel(const struct sr_dev_inst *sdi, uint32_t amount);
static int dev_acquisition_stop(struct sr_dev_inst *sdi);
-static struct sr_dev_inst *hantek_6xxx_dev_new(const struct hantek_6xxx_profile *prof)
+static struct sr_dev_inst *hantek_6xxx_dev_new(struct sr_dev_driver *di,
+ const struct hantek_6xxx_profile *prof)
{
struct sr_dev_inst *sdi;
struct sr_channel *ch;
sdi->status = SR_ST_INITIALIZING;
sdi->vendor = g_strdup(prof->vendor);
sdi->model = g_strdup(prof->model);
- sdi->driver = &hantek_6xxx_driver_info;
+ sdi->driver = di;
for (i = 0; i < ARRAY_SIZE(channel_names); i++) {
ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_names[i]);
/* Device matches the pre-firmware profile. */
prof = &dev_profiles[j];
sr_dbg("Found a %s %s.", prof->vendor, prof->model);
- sdi = hantek_6xxx_dev_new(prof);
+ sdi = hantek_6xxx_dev_new(di, prof);
sdi->connection_id = g_strdup(connection_id);
devices = g_slist_append(devices, sdi);
devc = sdi->priv;
/* Device matches the post-firmware profile. */
prof = &dev_profiles[j];
sr_dbg("Found a %s %s.", prof->vendor, prof->model);
- sdi = hantek_6xxx_dev_new(prof);
+ sdi = hantek_6xxx_dev_new(di, prof);
sdi->connection_id = g_strdup(connection_id);
sdi->status = SR_ST_INACTIVE;
devices = g_slist_append(devices, sdi);
"GND",
};
-SR_PRIV struct sr_dev_driver hantek_dso_driver_info;
-
static int dev_acquisition_stop(struct sr_dev_inst *sdi);
-static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof)
+static struct sr_dev_inst *dso_dev_new(struct sr_dev_driver *di,
+ const struct dso_profile *prof)
{
struct sr_dev_inst *sdi;
struct sr_channel *ch;
sdi->status = SR_ST_INITIALIZING;
sdi->vendor = g_strdup(prof->vendor);
sdi->model = g_strdup(prof->model);
- sdi->driver = &hantek_dso_driver_info;
+ sdi->driver = di;
/*
* Add only the real channels -- EXT isn't a source of data, only
devc->triggersource = g_strdup(DEFAULT_TRIGGER_SOURCE);
devc->triggerposition = DEFAULT_HORIZ_TRIGGERPOS;
sdi->priv = devc;
- drvc = hantek_dso_driver_info.context;
+ drvc = di->context;
drvc->instances = g_slist_append(drvc->instances, sdi);
return sdi;
/* Device matches the pre-firmware profile. */
prof = &dev_profiles[j];
sr_dbg("Found a %s %s.", prof->vendor, prof->model);
- sdi = dso_dev_new(prof);
+ sdi = dso_dev_new(di, prof);
sdi->connection_id = g_strdup(connection_id);
devices = g_slist_append(devices, sdi);
devc = sdi->priv;
/* Device matches the post-firmware profile. */
prof = &dev_profiles[j];
sr_dbg("Found a %s %s.", prof->vendor, prof->model);
- sdi = dso_dev_new(prof);
+ sdi = dso_dev_new(di, prof);
sdi->connection_id = g_strdup(connection_id);
sdi->status = SR_ST_INACTIVE;
devices = g_slist_append(devices, sdi);
#define NUM_CHANNELS 2
-extern struct sr_dev_driver hantek_dso_driver_info;
-
static int send_begin(const struct sr_dev_inst *sdi)
{
struct sr_usb_dev_inst *usb;
SR_PRIV int dso_open(struct sr_dev_inst *sdi)
{
struct dev_context *devc;
- struct drv_context *drvc = hantek_dso_driver_info.context;
+ struct drv_context *drvc = sdi->driver->context;
struct sr_usb_dev_inst *usb;
struct libusb_device_descriptor des;
libusb_device **devlist;
#include <string.h>
#include "protocol.h"
-SR_PRIV struct sr_dev_driver hung_chang_dso_2100_driver_info;
-
static const uint32_t scanopts[] = {
SR_CONF_CONN,
};
"0", "1", "2", "3",
};
-SR_PRIV struct sr_dev_driver ikalogic_scanalogic2_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
GSList *usb_devices, *devices, *l;
for (l = usb_devices; l; l = l->next) {
usb = l->data;
- if ((ret = sl2_get_device_info(*usb, &dev_info)) < 0) {
+ if ((ret = sl2_get_device_info(di, *usb, &dev_info)) < 0) {
sr_warn("Failed to get device information: %d.", ret);
sr_usb_dev_inst_free(usb);
continue;
#include <config.h>
#include "protocol.h"
-extern struct sr_dev_driver ikalogic_scanalogic2_driver_info;
-
extern uint64_t sl2_samplerates[NUM_SAMPLERATES];
static void stop_acquisition(struct sr_dev_inst *sdi)
devc->post_trigger_bytes = post_trigger_bytes;
}
-SR_PRIV int sl2_get_device_info(struct sr_usb_dev_inst usb,
- struct device_info *dev_info)
+SR_PRIV int sl2_get_device_info(struct sr_dev_driver *di,
+ struct sr_usb_dev_inst usb, struct device_info *dev_info)
{
struct drv_context *drvc;
uint8_t buffer[PACKET_LENGTH];
int ret;
- drvc = ikalogic_scanalogic2_driver_info.context;
+ drvc = di->context;
if (!dev_info)
return SR_ERR_ARG;
SR_PRIV int sl2_set_after_trigger_delay(const struct sr_dev_inst *sdi,
uint64_t after_trigger_delay);
SR_PRIV void sl2_calculate_trigger_samples(const struct sr_dev_inst *sdi);
-SR_PRIV int sl2_get_device_info(struct sr_usb_dev_inst usb,
- struct device_info *dev_info);
+SR_PRIV int sl2_get_device_info(struct sr_dev_driver *di,
+ struct sr_usb_dev_inst usb, struct device_info *dev_info);
SR_PRIV int sl2_transfer_in(libusb_device_handle *dev_handle, uint8_t *data);
SR_PRIV int sl2_transfer_out(libusb_device_handle *dev_handle, uint8_t *data);
/* Note: The IKALOGIC ScanaPLUS always samples at 100MHz. */
static const uint64_t samplerates[1] = { SR_MHZ(100) };
-SR_PRIV struct sr_dev_driver ikalogic_scanaplus_driver_info;
-
static int dev_acquisition_stop(struct sr_dev_inst *sdi);
static void clear_helper(void *priv)
"Memory",
};
-SR_PRIV struct sr_dev_driver kecheng_kc_330b_driver_info;
-
static int scan_kecheng(struct sr_dev_driver *di,
struct sr_usb_dev_inst *usb, char **model)
{
#include <config.h>
#include <string.h>
#include "protocol.h"
-
-extern struct sr_dev_driver kecheng_kc_330b_driver_info;
extern const uint64_t kecheng_kc_330b_sample_intervals[][2];
SR_PRIV int kecheng_kc_330b_handle_events(int fd, int revents, void *cb_data)
ALL_ZERO
};
-SR_PRIV struct sr_dev_driver korad_kaxxxxp_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct drv_context *drvc;
#include "libsigrok-internal.h"
#include "protocol.h"
-SR_PRIV struct sr_dev_driver lascar_el_usb_driver_info;
-
static const uint32_t scanopts[] = {
SR_CONF_CONN,
};
SR_MHZ(500),
};
-SR_PRIV struct sr_dev_driver lecroy_logicstudio_driver_info;
-
static struct sr_dev_inst *create_device(struct sr_dev_driver *di,
struct sr_usb_dev_inst *usb, enum sr_dev_inst_status status,
int64_t fw_updated)
SR_HZ(100),
};
-SR_PRIV struct sr_dev_driver link_mso19_driver_info;
-
/* TODO: Use sr_dev_inst to store connection handle & use std_dev_clear(). */
static int dev_clear(const struct sr_dev_driver *di)
{
static const char mso_head[] = { 0x40, 0x4c, 0x44, 0x53, 0x7e };
static const char mso_foot[] = { 0x7e };
-extern SR_PRIV struct sr_dev_driver link_mso19_driver_info;
-
SR_PRIV int mso_send_control_message(struct sr_serial_dev_inst *serial,
uint16_t payload[], int n)
{
ALL_ZERO
};
-SR_PRIV struct sr_dev_driver manson_hcs_3xxx_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
int i, model_id;
#include <math.h>
#include <string.h>
#include "protocol.h"
-
-/* Forward declarations */
-SR_PRIV struct sr_dev_driver motech_lps_301_driver_info;
SR_PRIV int lps_read_reply(struct sr_serial_dev_inst *serial, char **buf, int *buflen);
SR_PRIV int lps_send_va(struct sr_serial_dev_inst *serial, const char *fmt, va_list args);
SR_PRIV int lps_cmd_ok(struct sr_serial_dev_inst *serial, const char *fmt, ...);
#define RESPONSE_DELAY_US (10 * 1000)
-SR_PRIV struct sr_dev_driver ols_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct sr_config *src;
SR_HZ(1),
};
-SR_PRIV struct sr_dev_driver p_ols_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct sr_dev_inst *sdi;
#define MAX_RENUM_DELAY_MS 3000
#define NUM_SIMUL_TRANSFERS 32
-SR_PRIV struct sr_dev_driver saleae_logic16_driver_info;
-
static const uint32_t scanopts[] = {
SR_CONF_CONN,
};
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
-SR_PRIV struct sr_dev_driver teleinfo_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct drv_context *drvc;
#include "protocol.h"
#define SERIALCOMM "115200/8n1"
-
-SR_PRIV struct sr_dev_driver testo_driver_info;
static int dev_acquisition_stop(struct sr_dev_inst *sdi);
static const uint32_t scanopts[] = {
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
-SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct drv_context *drvc;
"Memory",
};
-SR_PRIV struct sr_dev_driver uni_t_ut32x_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct drv_context *drvc;
#include <math.h>
#include "protocol.h"
-extern struct sr_dev_driver uni_t_ut32x_driver_info;
-
static float parse_temperature(unsigned char *buf)
{
float temp;
#define VICTOR_VENDOR "Victor"
#define VICTOR_INTERFACE 0
#define VICTOR_ENDPOINT (LIBUSB_ENDPOINT_IN | 1)
-
-SR_PRIV struct sr_dev_driver victor_dmm_driver_info;
static int dev_acquisition_stop(struct sr_dev_inst *sdi);
static const uint32_t drvopts[] = {
"D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
};
-SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info;
-
/*
* The hardware supports more samplerates than these, but these are the
* options hardcoded into the vendor's Windows GUI.