]> sigrok.org Git - libsigrok.git/blobdiff - sigrok.h
sr/srd: Small fixes, constifications, doc updates.
[libsigrok.git] / sigrok.h
index 300e8a0b09e8cfc3653ce7cf4007007b8497cd7e..358743851e2ac57125f03684d662368b6307ea23 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -92,9 +92,9 @@ extern "C" {
 /* Marks private, non-public libsigrok symbols (not part of the API). */
 #define SR_PRIV __attribute__((visibility("hidden")))
 
-typedef int (*sr_receive_data_callback) (int fd, int revents, void *user_data);
+typedef int (*sr_receive_data_callback_t)(int fd, int revents, void *cb_data);
 
-/* Data types used by hardware plugins for config_set() */
+/* 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! */
 
@@ -288,8 +288,10 @@ struct sr_dev_inst {
 
 /* sr_dev_inst types */
 enum {
-       SR_USB_INST,
-       SR_SERIAL_INST,
+       /** Device instance type for USB devices. */
+       SR_INST_USB,
+       /** Device instance type for serial port devices. */
+       SR_INST_SERIAL,
 };
 
 /* Device instance status */
@@ -322,8 +324,8 @@ enum {
        SR_DI_TRIGGER_TYPES,
        /* The currently set samplerate in Hz (uint64_t) */
        SR_DI_CUR_SAMPLERATE,
-       /* Supported pattern generator modes */
-       SR_DI_PATTERNMODES,
+       /* Supported patterns (in pattern generator mode) */
+       SR_DI_PATTERNS,
 };
 
 /*
@@ -338,8 +340,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;
@@ -352,15 +354,15 @@ struct sr_dev_plugin {
        void *(*dev_info_get) (int dev_index, int dev_info_id);
        int (*dev_status_get) (int dev_index);
        int *(*hwcap_get_all) (void);
-       int (*config_set) (int dev_index, int hwcap, void *value);
-       int (*acquisition_start) (int dev_index, gpointer session_dev_id);
-       int (*acquisition_stop) (int dev_index, gpointer session_dev_id);
+       int (*dev_config_set) (int dev_index, int hwcap, void *value);
+       int (*dev_acquisition_start) (int dev_index, void *session_dev_id);
+       int (*dev_acquisition_stop) (int dev_index, void *session_dev_id);
 };
 
 struct sr_session {
        /* List of struct sr_dev* */
        GSList *devs;
-       /* list of sr_receive_data_callback */
+       /* list of sr_receive_data_callback_t */
        GSList *datafeed_callbacks;
        GTimeVal starttime;
        gboolean running;