X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=sigrok.h.in;h=091eb3cfebed35fc37efd1f852e960e0767da354;hb=8489264f1e3ef07ba8f1143ed62fa88d90980f94;hp=7da26b2f25ae31551b38ae7eeddad676c9696305;hpb=3c4976c9c4b9dd09204c7c3797f1122e4b641631;p=libsigrok.git diff --git a/sigrok.h.in b/sigrok.h.in index 7da26b2f..091eb3cf 100644 --- a/sigrok.h.in +++ b/sigrok.h.in @@ -143,7 +143,9 @@ enum { SR_T_CHAR, SR_T_BOOL, SR_T_FLOAT, - SR_T_RATIONAL, + SR_T_RATIONAL_PERIOD, + SR_T_RATIONAL_VOLT, + SR_T_KEYVALUE, }; struct sr_rational { @@ -166,6 +168,29 @@ enum { SR_DF_FRAME_END, }; +/* sr_datafeed_analog.mq values */ +enum { + SR_MQ_VOLTAGE, + SR_MQ_CURRENT, + SR_MQ_RESISTANCE, + SR_MQ_CAPACITANCE, + SR_MQ_TEMPERATURE, + SR_MQ_FREQUENCY, + SR_MQ_DUTY_CYCLE, +}; + +/* sr_datafeed_analog.unit values */ +enum { + SR_UNIT_VOLT, + SR_UNIT_AMPERE, + SR_UNIT_OHM, + SR_UNIT_FARAD, + SR_UNIT_CELSIUS, + SR_UNIT_KELVIN, + SR_UNIT_HERTZ, + SR_UNIT_PERCENTAGE, +}; + struct sr_datafeed_packet { uint16_t type; void *payload; @@ -193,6 +218,8 @@ struct sr_datafeed_meta_analog { struct sr_datafeed_analog { int num_samples; + int mq; /* Measured quantity (e.g. voltage, current, temperature) */ + int unit; /* Unit in which the MQ is measured. */ float *data; }; @@ -277,12 +304,25 @@ enum { /** The device can act as an oscilloscope. */ SR_HWCAP_OSCILLOSCOPE, - /*--- Device types --------------------------------------------------*/ + /** The device can act as a multimeter. */ + SR_HWCAP_MULTIMETER, - /** The device is demo device. */ + /** The device is a demo device. */ SR_HWCAP_DEMO_DEV, - /*--- Device options ------------------------------------------------*/ + + /*--- Device communication ------------------------------------------*/ + /** Some drivers cannot detect the exact model they're talking to. */ + SR_HWCAP_MODEL, + + /** Specification on how to connect to a device */ + SR_HWCAP_CONN, + + /** Serial communication spec: e.g. 8n1 */ + SR_HWCAP_SERIALCOMM, + + + /*--- Device configuration ------------------------------------------*/ /** The device supports setting/changing its samplerate. */ SR_HWCAP_SAMPLERATE, @@ -319,6 +359,13 @@ enum { /** Filter. */ SR_HWCAP_FILTER, + /** Volts/div. */ + SR_HWCAP_VDIV, + + /** Coupling. */ + SR_HWCAP_COUPLING, + + /*--- Special stuff -------------------------------------------------*/ /* TODO: Better description. */ @@ -333,6 +380,7 @@ enum { /** The device supports setting the number of probes. */ SR_HWCAP_CAPTURE_NUM_PROBES, + /*--- Acquisition modes ---------------------------------------------*/ /** @@ -427,6 +475,10 @@ enum { SR_DI_TRIGGER_SOURCES, /* Supported filter targets */ SR_DI_FILTERS, + /* Valid volts/div values */ + SR_DI_VDIVS, + /* Coupling options */ + SR_DI_COUPLING, }; /* @@ -438,7 +490,7 @@ struct sr_samplerates { uint64_t low; uint64_t high; uint64_t step; - uint64_t *list; + const uint64_t *list; }; struct sr_dev_driver { @@ -452,10 +504,10 @@ struct sr_dev_driver { /* Device-specific */ int (*dev_open) (int dev_index); int (*dev_close) (int dev_index); - void *(*dev_info_get) (int dev_index, int dev_info_id); + const void *(*dev_info_get) (int dev_index, int dev_info_id); int (*dev_status_get) (int dev_index); - int *(*hwcap_get_all) (void); - int (*dev_config_set) (int dev_index, int hwcap, void *value); + const int *(*hwcap_get_all) (void); + int (*dev_config_set) (int dev_index, int hwcap, const void *value); int (*dev_acquisition_start) (int dev_index, void *session_dev_id); int (*dev_acquisition_stop) (int dev_index, void *session_dev_id); };