libsigrok
0.4.0
sigrok hardware access and backend library
|
Device driver data. More...
#include <libsigrok.h>
Data Fields | |
const char * | name |
Driver name. More... | |
const char * | longname |
Long name. More... | |
int | api_version |
API version (currently 1). More... | |
int(* | init )(struct sr_dev_driver *driver, struct sr_context *sr_ctx) |
Called when driver is loaded, e.g. More... | |
int(* | cleanup )(const struct sr_dev_driver *driver) |
Called before driver is unloaded. More... | |
GSList *(* | scan )(struct sr_dev_driver *driver, GSList *options) |
Scan for devices. More... | |
GSList *(* | dev_list )(const struct sr_dev_driver *driver) |
Get list of device instances the driver knows about. More... | |
int(* | dev_clear )(const struct sr_dev_driver *driver) |
Clear list of devices the driver knows about. More... | |
int(* | config_get )(uint32_t key, 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. More... | |
int(* | config_set )(uint32_t key, 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. More... | |
int(* | config_channel_set )(const struct sr_dev_inst *sdi, struct sr_channel *ch, unsigned int changes) |
Channel status change. More... | |
int(* | config_commit )(const struct sr_dev_inst *sdi) |
Apply configuration settings to the device hardware. More... | |
int(* | config_list )(uint32_t key, 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. More... | |
int(* | dev_open )(struct sr_dev_inst *sdi) |
Open device. More... | |
int(* | dev_close )(struct sr_dev_inst *sdi) |
Close device. More... | |
int(* | dev_acquisition_start )(const struct sr_dev_inst *sdi, void *cb_data) |
Begin data acquisition on the specified device. More... | |
int(* | dev_acquisition_stop )(struct sr_dev_inst *sdi, void *cb_data) |
End data acquisition on the specified device. More... | |
void * | context |
Device driver context, considered private. More... | |
Device driver data.
See also http://sigrok.org/wiki/Hardware_driver_API .
Definition at line 1090 of file libsigrok.h.
int sr_dev_driver::api_version |
API version (currently 1).
Definition at line 1097 of file libsigrok.h.
int(* sr_dev_driver::cleanup) (const struct sr_dev_driver *driver) |
Called before driver is unloaded.
Driver must free all resources held by it.
Definition at line 1102 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.
Definition at line 1130 of file libsigrok.h.
int(* sr_dev_driver::config_commit) (const struct sr_dev_inst *sdi) |
Apply configuration settings to the device hardware.
Definition at line 1134 of file libsigrok.h.
int(* sr_dev_driver::config_get) (uint32_t key, 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.
Definition at line 1120 of file libsigrok.h.
Referenced by sr_config_get().
int(* sr_dev_driver::config_list) (uint32_t key, 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.
Definition at line 1138 of file libsigrok.h.
Referenced by sr_config_list(), and sr_dev_options().
int(* sr_dev_driver::config_set) (uint32_t key, 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.
Definition at line 1125 of file libsigrok.h.
void* sr_dev_driver::context |
Device driver context, considered private.
Initialized by init().
Definition at line 1156 of file libsigrok.h.
Referenced by sr_driver_scan(), and sr_init().
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 1148 of file libsigrok.h.
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 1151 of file libsigrok.h.
int(* sr_dev_driver::dev_clear) (const struct sr_dev_driver *driver) |
Clear list of devices the driver knows about.
Definition at line 1116 of file libsigrok.h.
Referenced by sr_dev_clear().
int(* sr_dev_driver::dev_close) (struct sr_dev_inst *sdi) |
Close device.
Definition at line 1146 of file libsigrok.h.
GSList*(* sr_dev_driver::dev_list) (const struct sr_dev_driver *driver) |
Get list of device instances the driver knows about.
Definition at line 1114 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 1144 of file libsigrok.h.
int(* sr_dev_driver::init) (struct sr_dev_driver *driver, struct sr_context *sr_ctx) |
Called when driver is loaded, e.g.
program startup.
Definition at line 1099 of file libsigrok.h.
Referenced by sr_driver_init().
const char* sr_dev_driver::longname |
const char* sr_dev_driver::name |
Driver name.
Lowercase a-z, 0-9 and dashes (-) only.
Definition at line 1093 of file libsigrok.h.
Referenced by sr_driver_init(), and sr_driver_scan().
GSList*(* sr_dev_driver::scan) (struct sr_dev_driver *driver, GSList *options) |
Scan for devices.
Driver should do all initialisation required. Can be called several times, e.g. with different port options.
NULL | Error or no devices found. |
other | GSList of a struct sr_dev_inst for each device. Must be freed by caller! |
Definition at line 1109 of file libsigrok.h.
Referenced by sr_driver_scan().