libsigrok  0.3.0
sigrok hardware access and backend library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Typedefs | Functions
proto.h File Reference

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. More...
 
int sr_exit (struct sr_context *ctx)
 Shutdown libsigrok. More...
 
int sr_log_loglevel_set (int loglevel)
 Set the libsigrok loglevel. More...
 
int sr_log_loglevel_get (void)
 Get the libsigrok loglevel. More...
 
int sr_log_callback_set (sr_log_callback cb, void *cb_data)
 Set the libsigrok log callback to the specified function. More...
 
int sr_log_callback_set_default (void)
 Set the libsigrok log callback to the default built-in one. More...
 
int sr_log_logdomain_set (const char *logdomain)
 Set the libsigrok logdomain string. More...
 
char * sr_log_logdomain_get (void)
 Get the currently configured libsigrok logdomain. More...
 
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. More...
 
int sr_dev_channel_enable (const struct sr_dev_inst *sdi, int channelnum, gboolean state)
 Enable or disable a channel on the specified device. More...
 
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). More...
 
gboolean sr_dev_has_option (const struct sr_dev_inst *sdi, int key)
 Determine whether the specified device instance has the specified capability. More...
 
GSList * sr_dev_list (const struct sr_dev_driver *driver)
 Get the list of devices/instances of the specified driver. More...
 
int sr_dev_clear (const struct sr_dev_driver *driver)
 Clear the list of device instances a driver knows about. More...
 
int sr_dev_open (struct sr_dev_inst *sdi)
 Open the specified device. More...
 
int sr_dev_close (struct sr_dev_inst *sdi)
 Close the specified device. More...
 
struct sr_dev_driver ** sr_driver_list (void)
 Return the list of supported hardware drivers. More...
 
int sr_driver_init (struct sr_context *ctx, struct sr_dev_driver *driver)
 Initialize a hardware driver. More...
 
GSList * sr_driver_scan (struct sr_dev_driver *driver, GSList *options)
 Tell a hardware driver to scan for devices. More...
 
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. More...
 
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. More...
 
int sr_config_commit (const struct sr_dev_inst *sdi)
 Apply configuration settings to the device hardware. More...
 
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. More...
 
const struct sr_config_infosr_config_info_get (int key)
 Get information about a configuration key, by key. More...
 
const struct sr_config_infosr_config_info_name_get (const char *optname)
 Get information about a configuration key, by name. More...
 
int sr_session_load (const char *filename)
 Load the session from the specified filename. More...
 
struct sr_sessionsr_session_new (void)
 Create a new session. More...
 
int sr_session_destroy (void)
 Destroy the current session. More...
 
int sr_session_dev_remove_all (void)
 Remove all the devices from the current session. More...
 
int sr_session_dev_add (const struct sr_dev_inst *sdi)
 Add a device instance to the current session. More...
 
int sr_session_dev_list (GSList **devlist)
 List all device instances attached to the current session. More...
 
int sr_session_datafeed_callback_remove_all (void)
 Remove all datafeed callbacks in the current session. More...
 
int sr_session_datafeed_callback_add (sr_datafeed_callback cb, void *cb_data)
 Add a datafeed callback to the current session. More...
 
int sr_session_start (void)
 Start a session. More...
 
int sr_session_run (void)
 Run the session. More...
 
int sr_session_stop (void)
 Stop the current session. More...
 
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. More...
 
int sr_session_save_init (const char *filename, uint64_t samplerate, char **channels)
 Initialize a saved session file. More...
 
int sr_session_append (const char *filename, unsigned char *buf, int unitsize, int units)
 Append data to an existing session file. More...
 
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. More...
 
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. More...
 
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. More...
 
int sr_session_source_remove (int fd)
 Remove the source belonging to the specified file descriptor. More...
 
int sr_session_source_remove_pollfd (GPollFD *pollfd)
 Remove the source belonging to the specified poll descriptor. More...
 
int sr_session_source_remove_channel (GIOChannel *channel)
 Remove the source belonging to the specified channel. More...
 
struct sr_input_format ** sr_input_list (void)
 
struct sr_output_format ** sr_output_list (void)
 
struct sr_outputsr_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. More...
 
char * sr_samplerate_string (uint64_t samplerate)
 Convert a numeric samplerate value to its "natural" string representation. More...
 
char * sr_period_string (uint64_t frequency)
 Convert a numeric frequency value to the "natural" string representation of its period. More...
 
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. More...
 
char ** sr_parse_triggerstring (const struct sr_dev_inst *sdi, const char *triggerstring)
 Parse a trigger specification string. More...
 
int sr_parse_sizestring (const char *sizestring, uint64_t *size)
 Convert a "natural" string representation of a size value to uint64_t. More...
 
uint64_t sr_parse_timestring (const char *timestring)
 Convert a "natural" string representation of a time value to an uint64_t value in milliseconds. More...
 
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. More...
 
int sr_package_version_minor_get (void)
 Get the minor libsigrok package version number. More...
 
int sr_package_version_micro_get (void)
 Get the micro libsigrok package version number. More...
 
const char * sr_package_version_string_get (void)
 Get the libsigrok package version number as a string. More...
 
int sr_lib_version_current_get (void)
 Get the "current" part of the libsigrok library version number. More...
 
int sr_lib_version_revision_get (void)
 Get the "revision" part of the libsigrok library version number. More...
 
int sr_lib_version_age_get (void)
 Get the "age" part of the libsigrok library version number. More...
 
const char * sr_lib_version_string_get (void)
 Get the libsigrok library version number as a string. More...
 
const char * sr_strerror (int error_code)
 Return a human-readable error string for the given libsigrok error code. More...
 
const char * sr_strerror_name (int error_code)
 Return the "name" string of the given libsigrok error code. More...
 

Detailed Description

Header file containing API function prototypes.

Definition in file proto.h.

Typedef Documentation

typedef void(* sr_datafeed_callback)(const struct sr_dev_inst *sdi, const struct sr_datafeed_packet *packet, void *cb_data)

Definition at line 83 of file proto.h.

typedef int(* sr_log_callback)(void *cb_data, int loglevel, const char *format, va_list args)

Definition at line 36 of file proto.h.