libsigrok  0.3.0
sigrok hardware access and backend library
Data Fields
sr_dev_driver Struct Reference

Device driver data. More...

#include <libsigrok.h>

+ Collaboration diagram for sr_dev_driver:

Data Fields

char * name
 Driver name.
char * longname
 Long name.
int api_version
 API version (currently 1).
int(* init )(struct sr_context *sr_ctx)
 Called when driver is loaded, e.g.
int(* cleanup )(void)
 Called before driver is unloaded.
GSList *(* scan )(GSList *options)
 Scan for devices.
GSList *(* dev_list )(void)
 Get list of device instances the driver knows about.
int(* dev_clear )(void)
 Clear list of devices the driver knows about.
int(* config_get )(int id, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 Query value of a configuration key in driver or given device instance.
int(* config_set )(int id, GVariant *data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 Set value of a configuration key in driver or a given device instance.
int(* config_channel_set )(const struct sr_dev_inst *sdi, struct sr_channel *ch, unsigned int changes)
 Channel status change.
int(* config_commit )(const struct sr_dev_inst *sdi)
 Apply configuration settings to the device hardware.
int(* config_list )(int info_id, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 List all possible values for a configuration key in a device instance.
int(* dev_open )(struct sr_dev_inst *sdi)
 Open device.
int(* dev_close )(struct sr_dev_inst *sdi)
 Close device.
int(* dev_acquisition_start )(const struct sr_dev_inst *sdi, void *cb_data)
 Begin data acquisition on the specified device.
int(* dev_acquisition_stop )(struct sr_dev_inst *sdi, void *cb_data)
 End data acquisition on the specified device.
void * priv
 Device driver private data.

Detailed Description

Device driver data.

See also http://sigrok.org/wiki/Hardware_driver_API .

Definition at line 891 of file libsigrok.h.


Field Documentation

API version (currently 1).

Definition at line 898 of file libsigrok.h.

int(* sr_dev_driver::cleanup)(void)

Called before driver is unloaded.

Driver must free all resouces held by it.

Definition at line 903 of file libsigrok.h.

int(* sr_dev_driver::config_channel_set)(const struct sr_dev_inst *sdi, struct sr_channel *ch, unsigned int changes)

Channel status change.

See also:
sr_dev_channel_enable(), sr_dev_trigger_set().

Definition at line 931 of file libsigrok.h.

Referenced by sr_dev_channel_enable(), and sr_dev_trigger_set().

int(* sr_dev_driver::config_commit)(const struct sr_dev_inst *sdi)

Apply configuration settings to the device hardware.

See also:
sr_config_commit().

Definition at line 935 of file libsigrok.h.

Referenced by sr_config_commit().

int(* sr_dev_driver::config_get)(int id, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)

Query value of a configuration key in driver or given device instance.

See also:
sr_config_get().

Definition at line 921 of file libsigrok.h.

Referenced by sr_config_get().

int(* sr_dev_driver::config_list)(int info_id, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)

List all possible values for a configuration key in a device instance.

See also:
sr_config_list().

Definition at line 939 of file libsigrok.h.

Referenced by sr_config_list(), sr_dev_has_option(), and sr_parse_triggerstring().

int(* sr_dev_driver::config_set)(int id, GVariant *data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)

Set value of a configuration key in driver or a given device instance.

See also:
sr_config_set().

Definition at line 926 of file libsigrok.h.

Referenced by sr_config_set(), and sr_session_load().

int(* sr_dev_driver::dev_acquisition_start)(const struct sr_dev_inst *sdi, void *cb_data)

Begin data acquisition on the specified device.

Definition at line 949 of file libsigrok.h.

Referenced by sr_session_start().

int(* sr_dev_driver::dev_acquisition_stop)(struct sr_dev_inst *sdi, void *cb_data)

End data acquisition on the specified device.

Definition at line 952 of file libsigrok.h.

Clear list of devices the driver knows about.

Definition at line 917 of file libsigrok.h.

Referenced by sr_dev_clear().

Close device.

Definition at line 947 of file libsigrok.h.

Referenced by sr_dev_close().

GSList*(* sr_dev_driver::dev_list)(void)

Get list of device instances the driver knows about.

Returns:
NULL or GSList of a struct sr_dev_inst for each device. Must not be freed by caller!

Definition at line 915 of file libsigrok.h.

Referenced by sr_dev_list().

int(* sr_dev_driver::dev_open)(struct sr_dev_inst *sdi)

Open device.

Definition at line 945 of file libsigrok.h.

Referenced by sr_dev_open(), and sr_session_dev_add().

int(* sr_dev_driver::init)(struct sr_context *sr_ctx)

Called when driver is loaded, e.g.

program startup.

Definition at line 900 of file libsigrok.h.

Referenced by sr_driver_init(), and sr_session_load().

Long name.

Verbose driver name shown to user.

Definition at line 896 of file libsigrok.h.

Driver name.

Lowercase a-z, 0-9 and dashes (-) only.

Definition at line 894 of file libsigrok.h.

Referenced by sr_driver_init(), and sr_driver_scan().

Device driver private data.

Initialized by init().

Definition at line 957 of file libsigrok.h.

Referenced by sr_driver_scan().

GSList*(* sr_dev_driver::scan)(GSList *options)

Scan for devices.

Driver should do all initialisation required. Can be called several times, e.g. with different port options.

Return values:
NULLError or no devices found.
otherGSList of a struct sr_dev_inst for each device. Must be freed by caller!

Definition at line 910 of file libsigrok.h.

Referenced by sr_driver_scan().


The documentation for this struct was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines