![]() |
libsigrok
0.3.0
sigrok hardware access and backend library
|
Header file containing API function prototypes. More...
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Typedefs | |
| typedef int(* | sr_log_callback )(void *cb_data, int loglevel, const char *format, va_list args) |
| typedef void(* | sr_datafeed_callback )(const struct sr_dev_inst *sdi, const struct sr_datafeed_packet *packet, void *cb_data) |
Functions | |
| int | sr_init (struct sr_context **ctx) |
| Initialize libsigrok. | |
| int | sr_exit (struct sr_context *ctx) |
| Shutdown libsigrok. | |
| int | sr_log_loglevel_set (int loglevel) |
| Set the libsigrok loglevel. | |
| int | sr_log_loglevel_get (void) |
| Get the libsigrok loglevel. | |
| int | sr_log_callback_set (sr_log_callback cb, void *cb_data) |
| Set the libsigrok log callback to the specified function. | |
| int | sr_log_callback_set_default (void) |
| Set the libsigrok log callback to the default built-in one. | |
| int | sr_log_logdomain_set (const char *logdomain) |
| Set the libsigrok logdomain string. | |
| char * | sr_log_logdomain_get (void) |
| Get the currently configured libsigrok logdomain. | |
| int | sr_dev_channel_name_set (const struct sr_dev_inst *sdi, int channelnum, const char *name) |
| Set the name of the specified channel in the specified device. | |
| int | sr_dev_channel_enable (const struct sr_dev_inst *sdi, int channelnum, gboolean state) |
| Enable or disable a channel on the specified device. | |
| int | sr_dev_trigger_set (const struct sr_dev_inst *sdi, int channelnum, const char *trigger) |
| Add a trigger to the specified device (and the specified channel). | |
| gboolean | sr_dev_has_option (const struct sr_dev_inst *sdi, int key) |
| Determine whether the specified device instance has the specified capability. | |
| GSList * | sr_dev_list (const struct sr_dev_driver *driver) |
| Get the list of devices/instances of the specified driver. | |
| int | sr_dev_clear (const struct sr_dev_driver *driver) |
| Clear the list of device instances a driver knows about. | |
| int | sr_dev_open (struct sr_dev_inst *sdi) |
| Open the specified device. | |
| int | sr_dev_close (struct sr_dev_inst *sdi) |
| Close the specified device. | |
| struct sr_dev_driver ** | sr_driver_list (void) |
| Return the list of supported hardware drivers. | |
| int | sr_driver_init (struct sr_context *ctx, struct sr_dev_driver *driver) |
| Initialize a hardware driver. | |
| GSList * | sr_driver_scan (struct sr_dev_driver *driver, GSList *options) |
| Tell a hardware driver to scan for devices. | |
| int | sr_config_get (const struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg, int key, GVariant **data) |
| Query value of a configuration key at the given driver or device instance. | |
| int | sr_config_set (const struct sr_dev_inst *sdi, const struct sr_channel_group *cg, int key, GVariant *data) |
| Set value of a configuration key in a device instance. | |
| int | sr_config_commit (const struct sr_dev_inst *sdi) |
| Apply configuration settings to the device hardware. | |
| int | sr_config_list (const struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg, int key, GVariant **data) |
| List all possible values for a configuration key. | |
| struct sr_config_info * | sr_config_info_get (int key) |
| Get information about a configuration key, by key. | |
| struct sr_config_info * | sr_config_info_name_get (const char *optname) |
| Get information about a configuration key, by name. | |
| int | sr_session_load (const char *filename) |
| Load the session from the specified filename. | |
| struct sr_session * | sr_session_new (void) |
| Create a new session. | |
| int | sr_session_destroy (void) |
| Destroy the current session. | |
| int | sr_session_dev_remove_all (void) |
| Remove all the devices from the current session. | |
| int | sr_session_dev_add (const struct sr_dev_inst *sdi) |
| Add a device instance to the current session. | |
| int | sr_session_dev_list (GSList **devlist) |
| List all device instances attached to the current session. | |
| int | sr_session_datafeed_callback_remove_all (void) |
| Remove all datafeed callbacks in the current session. | |
| int | sr_session_datafeed_callback_add (sr_datafeed_callback cb, void *cb_data) |
| Add a datafeed callback to the current session. | |
| int | sr_session_start (void) |
| Start a session. | |
| int | sr_session_run (void) |
| Run the session. | |
| int | sr_session_stop (void) |
| Stop the current session. | |
| int | sr_session_save (const char *filename, const struct sr_dev_inst *sdi, unsigned char *buf, int unitsize, int units) |
| Save the current session to the specified file. | |
| int | sr_session_save_init (const char *filename, uint64_t samplerate, char **channels) |
| Initialize a saved session file. | |
| int | sr_session_append (const char *filename, unsigned char *buf, int unitsize, int units) |
| Append data to an existing session file. | |
| int | sr_session_source_add (int fd, int events, int timeout, sr_receive_data_callback cb, void *cb_data) |
| Add an event source for a file descriptor. | |
| int | sr_session_source_add_pollfd (GPollFD *pollfd, int timeout, sr_receive_data_callback cb, void *cb_data) |
| Add an event source for a GPollFD. | |
| int | sr_session_source_add_channel (GIOChannel *channel, int events, int timeout, sr_receive_data_callback cb, void *cb_data) |
| Add an event source for a GIOChannel. | |
| int | sr_session_source_remove (int fd) |
| Remove the source belonging to the specified file descriptor. | |
| int | sr_session_source_remove_pollfd (GPollFD *pollfd) |
| Remove the source belonging to the specified poll descriptor. | |
| int | sr_session_source_remove_channel (GIOChannel *channel) |
| Remove the source belonging to the specified channel. | |
| struct sr_input_format ** | sr_input_list (void) |
| struct sr_output_format ** | sr_output_list (void) |
| struct sr_output * | sr_output_new (struct sr_output_format *of, GHashTable *params, const struct sr_dev_inst *sdi) |
| int | sr_output_send (struct sr_output *o, const struct sr_datafeed_packet *packet, GString **out) |
| int | sr_output_free (struct sr_output *o) |
| char * | sr_si_string_u64 (uint64_t x, const char *unit) |
| Convert a numeric value value to its "natural" string representation in SI units. | |
| char * | sr_samplerate_string (uint64_t samplerate) |
| Convert a numeric samplerate value to its "natural" string representation. | |
| char * | sr_period_string (uint64_t frequency) |
| Convert a numeric frequency value to the "natural" string representation of its period. | |
| char * | sr_voltage_string (uint64_t v_p, uint64_t v_q) |
| Convert a numeric voltage value to the "natural" string representation of its voltage value. | |
| char ** | sr_parse_triggerstring (const struct sr_dev_inst *sdi, const char *triggerstring) |
| Parse a trigger specification string. | |
| int | sr_parse_sizestring (const char *sizestring, uint64_t *size) |
| Convert a "natural" string representation of a size value to uint64_t. | |
| uint64_t | sr_parse_timestring (const char *timestring) |
| Convert a "natural" string representation of a time value to an uint64_t value in milliseconds. | |
| gboolean | sr_parse_boolstring (const char *boolstring) |
| int | sr_parse_period (const char *periodstr, uint64_t *p, uint64_t *q) |
| int | sr_parse_voltage (const char *voltstr, uint64_t *p, uint64_t *q) |
| int | sr_package_version_major_get (void) |
| Get the major libsigrok package version number. | |
| int | sr_package_version_minor_get (void) |
| Get the minor libsigrok package version number. | |
| int | sr_package_version_micro_get (void) |
| Get the micro libsigrok package version number. | |
| const char * | sr_package_version_string_get (void) |
| Get the libsigrok package version number as a string. | |
| int | sr_lib_version_current_get (void) |
| Get the "current" part of the libsigrok library version number. | |
| int | sr_lib_version_revision_get (void) |
| Get the "revision" part of the libsigrok library version number. | |
| int | sr_lib_version_age_get (void) |
| Get the "age" part of the libsigrok library version number. | |
| const char * | sr_lib_version_string_get (void) |
| Get the libsigrok library version number as a string. | |
| const char * | sr_strerror (int error_code) |
| Return a human-readable error string for the given libsigrok error code. | |
| const char * | sr_strerror_name (int error_code) |
| Return the "name" string of the given libsigrok error code. | |
Header file containing API function prototypes.
Definition in file proto.h.
| typedef void(* sr_datafeed_callback)(const struct sr_dev_inst *sdi, const struct sr_datafeed_packet *packet, void *cb_data) |
| typedef int(* sr_log_callback)(void *cb_data, int loglevel, const char *format, va_list args) |
1.7.6.1