X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=sigrok.h;h=5bab6adf467924495ab1f2982c334e6e731c2522;hb=c09f0b578c0e9c03590cb814f66004bb3f6815ff;hp=a7a92bf212e42fc52c500a5cde30a1558630df75;hpb=bb7ef79377ae617e1275373e0b631beb7f909d73;p=libsigrok.git diff --git a/sigrok.h b/sigrok.h index a7a92bf2..5bab6adf 100644 --- a/sigrok.h +++ b/sigrok.h @@ -94,7 +94,7 @@ extern "C" { typedef int (*sr_receive_data_callback) (int fd, int revents, void *user_data); -/* Data types used by hardware plugins for set_configuration() */ +/* Data types used by hardware drivers for dev_config_set() */ enum { SR_T_UINT64, SR_T_CHAR, @@ -169,15 +169,15 @@ struct sr_datastore { /* * This represents a generic device connected to the system. - * For device-specific information, ask the plugin. The plugin_index refers - * to the device index within that plugin; it may be handling more than one - * device. All relevant plugin calls take a dev_index parameter for this. + * For device-specific information, ask the driver. The driver_index refers + * to the device index within that driver; it may be handling more than one + * device. All relevant driver calls take a dev_index parameter for this. */ struct sr_dev { - /* Which plugin handles this device */ - struct sr_dev_plugin *plugin; - /* A plugin may handle multiple devices of the same type */ - int plugin_index; + /* Which driver handles this device */ + struct sr_dev_driver *driver; + /* A driver may handle multiple devices of the same type */ + int driver_index; /* List of struct sr_probe* */ GSList *probes; /* Data acquired by this device, if any */ @@ -196,7 +196,7 @@ struct sr_probe { char *trigger; }; -/* Hardware plugin capabilities */ +/* Hardware driver capabilities */ enum { SR_HWCAP_DUMMY = 0, /* Used to terminate lists. Must be 0! */ @@ -270,7 +270,7 @@ enum { }; struct sr_hwcap_option { - int capability; + int hwcap; int type; char *description; char *shortname; @@ -279,7 +279,7 @@ struct sr_hwcap_option { struct sr_dev_inst { int index; int status; - int instance_type; + int inst_type; char *vendor; char *model; char *version; @@ -288,8 +288,8 @@ struct sr_dev_inst { /* sr_dev_inst types */ enum { - SR_USB_INSTANCE, - SR_SERIAL_INSTANCE, + SR_USB_INST, + SR_SERIAL_INST, }; /* Device instance status */ @@ -311,7 +311,7 @@ enum { /* Device info IDs */ enum { /* struct sr_dev_inst for this specific device */ - SR_DI_INSTANCE, + SR_DI_INST, /* The number of probes connected to this device */ SR_DI_NUM_PROBES, /* The probe names on this device */ @@ -338,8 +338,8 @@ struct sr_samplerates { uint64_t *list; }; -struct sr_dev_plugin { - /* Plugin-specific */ +struct sr_dev_driver { + /* Driver-specific */ char *name; char *longname; int api_version; @@ -347,14 +347,14 @@ struct sr_dev_plugin { int (*cleanup) (void); /* Device-specific */ - int (*opendev) (int dev_index); - int (*closedev) (int dev_index); - void *(*get_dev_info) (int dev_index, int dev_info_id); - int (*get_status) (int dev_index); - int *(*get_capabilities) (void); - int (*set_configuration) (int dev_index, int capability, void *value); - int (*start_acquisition) (int dev_index, gpointer session_dev_id); - int (*stop_acquisition) (int dev_index, gpointer session_dev_id); + int (*dev_open) (int dev_index); + int (*dev_close) (int dev_index); + void *(*dev_info_get) (int dev_index, int dev_info_id); + int (*dev_status_get) (int dev_index); + int *(*hwcap_get_all) (void); + int (*dev_config_set) (int dev_index, int hwcap, void *value); + int (*dev_acquisition_start) (int dev_index, gpointer session_dev_id); + int (*dev_acquisition_stop) (int dev_index, gpointer session_dev_id); }; struct sr_session {