libsigrok
Data Structures | Defines | Typedefs | Enumerations
sigrok.h File Reference
#include <stdio.h>
#include <sys/time.h>
#include <stdint.h>
#include <inttypes.h>
#include <glib.h>
#include "sigrok-proto.h"
Include dependency graph for sigrok.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sr_datafeed_packet
struct  sr_datafeed_header
struct  sr_datafeed_logic
struct  sr_input
struct  sr_input_format
struct  sr_output
struct  sr_output_format
struct  sr_datastore
struct  sr_dev
struct  sr_probe
struct  sr_hwcap_option
struct  sr_dev_inst
struct  sr_samplerates
struct  sr_dev_driver
struct  sr_session

Defines

#define SR_PACKAGE_VERSION_MAJOR   0
 The libsigrok package 'major' version number.
#define SR_PACKAGE_VERSION_MINOR   1
 The libsigrok package 'minor' version number.
#define SR_PACKAGE_VERSION_MICRO   1
 The libsigrok package 'micro' version number.
#define SR_PACKAGE_VERSION_STRING   "0.1.1"
 The libsigrok package version ("major.minor.micro") as string.
#define SR_LIB_VERSION_CURRENT   0
 The libsigrok libtool 'current' version number.
#define SR_LIB_VERSION_REVISION   0
 The libsigrok libtool 'revision' version number.
#define SR_LIB_VERSION_AGE   0
 The libsigrok libtool 'age' version number.
#define SR_LIB_VERSION_STRING   "0:0:0"
 The libsigrok libtool version ("current:revision:age") as string.
#define SR_OK   0 /* No error */
#define SR_ERR   -1 /* Generic/unspecified error */
#define SR_ERR_MALLOC   -2 /* Malloc/calloc/realloc error */
#define SR_ERR_ARG   -3 /* Function argument error */
#define SR_ERR_BUG   -4 /* Errors hinting at internal bugs */
#define SR_ERR_SAMPLERATE   -5 /* Incorrect samplerate */
#define SR_MAX_NUM_PROBES   64 /* Limited by uint64_t. */
#define SR_MAX_PROBENAME_LEN   32
#define SR_HZ(n)   (n)
#define SR_KHZ(n)   ((n) * 1000)
#define SR_MHZ(n)   ((n) * 1000000)
#define SR_GHZ(n)   ((n) * 1000000000)
#define SR_HZ_TO_NS(n)   (1000000000 / (n))
#define SR_LOG_NONE   0
 Output no messages at all.
#define SR_LOG_ERR   1
 Output error messages.
#define SR_LOG_WARN   2
 Output warnings.
#define SR_LOG_INFO   3
 Output informational messages.
#define SR_LOG_DBG   4
 Output debug messages.
#define SR_LOG_SPEW   5
 Output very noisy debug messages.
#define SR_API   __attribute__((visibility("default")))
#define SR_PRIV   __attribute__((visibility("hidden")))

Typedefs

typedef int(* sr_receive_data_callback_t )(int fd, int revents, void *cb_data)

Enumerations

enum  { SR_T_UINT64, SR_T_CHAR, SR_T_BOOL }
enum  {
  SR_DF_HEADER, SR_DF_END, SR_DF_TRIGGER, SR_DF_LOGIC,
  SR_DF_PD
}
enum  { SR_PROBE_TYPE_LOGIC }
enum  {
  SR_HWCAP_DUMMY = 0, SR_HWCAP_LOGIC_ANALYZER, SR_HWCAP_DEMO_DEV, SR_HWCAP_SAMPLERATE,
  SR_HWCAP_PROBECONFIG, SR_HWCAP_CAPTURE_RATIO, SR_HWCAP_PATTERN_MODE, SR_HWCAP_RLE,
  SR_HWCAP_CAPTUREFILE, SR_HWCAP_CAPTURE_UNITSIZE, SR_HWCAP_CAPTURE_NUM_PROBES, SR_HWCAP_LIMIT_MSEC,
  SR_HWCAP_LIMIT_SAMPLES, SR_HWCAP_CONTINUOUS
}
enum  { SR_INST_USB, SR_INST_SERIAL }
enum  { SR_ST_NOT_FOUND, SR_ST_INITIALIZING, SR_ST_INACTIVE, SR_ST_ACTIVE }
enum  {
  SR_DI_INST, SR_DI_NUM_PROBES, SR_DI_PROBE_NAMES, SR_DI_SAMPLERATES,
  SR_DI_TRIGGER_TYPES, SR_DI_CUR_SAMPLERATE, SR_DI_PATTERNS
}

Define Documentation

#define SR_API   __attribute__((visibility("default")))

Definition at line 126 of file sigrok.h.

#define SR_ERR   -1 /* Generic/unspecified error */
#define SR_ERR_ARG   -3 /* Function argument error */
#define SR_ERR_BUG   -4 /* Errors hinting at internal bugs */
#define SR_ERR_MALLOC   -2 /* Malloc/calloc/realloc error */
#define SR_ERR_SAMPLERATE   -5 /* Incorrect samplerate */

Definition at line 87 of file sigrok.h.

#define SR_GHZ (   n)    ((n) * 1000000000)

Definition at line 96 of file sigrok.h.

Referenced by sr_parse_sizestring(), sr_period_string(), and sr_samplerate_string().

#define SR_HZ (   n)    (n)

Definition at line 93 of file sigrok.h.

#define SR_HZ_TO_NS (   n)    (1000000000 / (n))

Definition at line 98 of file sigrok.h.

#define SR_KHZ (   n)    ((n) * 1000)

Definition at line 94 of file sigrok.h.

Referenced by sr_parse_sizestring(), sr_period_string(), and sr_samplerate_string().

#define SR_LIB_VERSION_AGE   0

The libsigrok libtool 'age' version number.

Definition at line 60 of file sigrok.h.

Referenced by sr_lib_version_age_get().

#define SR_LIB_VERSION_CURRENT   0

The libsigrok libtool 'current' version number.

Definition at line 54 of file sigrok.h.

Referenced by sr_lib_version_current_get().

#define SR_LIB_VERSION_REVISION   0

The libsigrok libtool 'revision' version number.

Definition at line 57 of file sigrok.h.

Referenced by sr_lib_version_revision_get().

#define SR_LIB_VERSION_STRING   "0:0:0"

The libsigrok libtool version ("current:revision:age") as string.

Definition at line 63 of file sigrok.h.

Referenced by sr_lib_version_string_get().

#define SR_LOG_DBG   4

Output debug messages.

Definition at line 105 of file sigrok.h.

Referenced by sr_dbg(), and sr_session_send().

#define SR_LOG_ERR   1

Output error messages.

Definition at line 102 of file sigrok.h.

Referenced by sr_err().

#define SR_LOG_INFO   3

Output informational messages.

Definition at line 104 of file sigrok.h.

Referenced by sr_info().

#define SR_LOG_NONE   0

Output no messages at all.

Definition at line 101 of file sigrok.h.

#define SR_LOG_SPEW   5

Output very noisy debug messages.

Definition at line 106 of file sigrok.h.

Referenced by sr_log_loglevel_set(), and sr_spew().

#define SR_LOG_WARN   2

Output warnings.

Definition at line 103 of file sigrok.h.

Referenced by sr_warn().

#define SR_MAX_NUM_PROBES   64 /* Limited by uint64_t. */

Definition at line 89 of file sigrok.h.

#define SR_MAX_PROBENAME_LEN   32

Definition at line 90 of file sigrok.h.

Referenced by data_ascii(), data_bits(), data_hex(), and sr_session_load().

#define SR_MHZ (   n)    ((n) * 1000000)
#define SR_OK   0 /* No error */
#define SR_PACKAGE_VERSION_MAJOR   0

The libsigrok package 'major' version number.

Definition at line 38 of file sigrok.h.

Referenced by sr_package_version_major_get().

#define SR_PACKAGE_VERSION_MICRO   1

The libsigrok package 'micro' version number.

Definition at line 44 of file sigrok.h.

Referenced by sr_package_version_micro_get().

#define SR_PACKAGE_VERSION_MINOR   1

The libsigrok package 'minor' version number.

Definition at line 41 of file sigrok.h.

Referenced by sr_package_version_minor_get().

#define SR_PACKAGE_VERSION_STRING   "0.1.1"

The libsigrok package version ("major.minor.micro") as string.

Definition at line 47 of file sigrok.h.

Referenced by sr_package_version_string_get().

#define SR_PRIV   __attribute__((visibility("hidden")))

Definition at line 133 of file sigrok.h.


Typedef Documentation

typedef int(* sr_receive_data_callback_t)(int fd, int revents, void *cb_data)

Definition at line 138 of file sigrok.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
SR_INST_USB 

Device instance type for USB devices.

SR_INST_SERIAL 

Device instance type for serial port devices.

Definition at line 334 of file sigrok.h.

anonymous enum
Enumerator:
SR_ST_NOT_FOUND 
SR_ST_INITIALIZING 
SR_ST_INACTIVE 
SR_ST_ACTIVE 

Definition at line 342 of file sigrok.h.

anonymous enum
Enumerator:
SR_DI_INST 
SR_DI_NUM_PROBES 
SR_DI_PROBE_NAMES 
SR_DI_SAMPLERATES 
SR_DI_TRIGGER_TYPES 
SR_DI_CUR_SAMPLERATE 
SR_DI_PATTERNS 

Definition at line 358 of file sigrok.h.

anonymous enum
Enumerator:
SR_T_UINT64 
SR_T_CHAR 
SR_T_BOOL 

Definition at line 141 of file sigrok.h.

anonymous enum
Enumerator:
SR_DF_HEADER 
SR_DF_END 
SR_DF_TRIGGER 
SR_DF_LOGIC 
SR_DF_PD 

Definition at line 148 of file sigrok.h.

anonymous enum
Enumerator:
SR_PROBE_TYPE_LOGIC 

Definition at line 231 of file sigrok.h.

anonymous enum
Enumerator:
SR_HWCAP_DUMMY 
SR_HWCAP_LOGIC_ANALYZER 

The device can act as logic analyzer.

SR_HWCAP_DEMO_DEV 

The device is demo device.

SR_HWCAP_SAMPLERATE 

The device supports setting/changing its samplerate.

SR_HWCAP_PROBECONFIG 

The device supports setting a probe mask.

SR_HWCAP_CAPTURE_RATIO 

The device supports setting a pre/post-trigger capture ratio.

SR_HWCAP_PATTERN_MODE 

The device supports setting a pattern (pattern generator mode).

SR_HWCAP_RLE 

The device supports Run Length Encoding.

SR_HWCAP_CAPTUREFILE 

The device supports specifying a capturefile to inject.

SR_HWCAP_CAPTURE_UNITSIZE 

The device supports specifying the capturefile unit size.

SR_HWCAP_CAPTURE_NUM_PROBES 

The device supports setting the number of probes.

SR_HWCAP_LIMIT_MSEC 

The device supports setting a sample time limit, i.e.

how long the sample acquisition should run (in ms).

SR_HWCAP_LIMIT_SAMPLES 

The device supports setting a sample number limit, i.e.

how many samples should be acquired.

SR_HWCAP_CONTINUOUS 

The device supports continuous sampling, i.e.

neither a time limit nor a sample number limit has to be supplied, it will just acquire samples continuously, until explicitly stopped by a certain command.

Definition at line 244 of file sigrok.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines