X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=sigrok.h.in;h=091eb3cfebed35fc37efd1f852e960e0767da354;hb=8489264f1e3ef07ba8f1143ed62fa88d90980f94;hp=759565dfb4a9f14ef2515a2f265fea79fa3e2e73;hpb=b7f578bef53ff0e645ca0cae3f9781f577b7367a;p=libsigrok.git diff --git a/sigrok.h.in b/sigrok.h.in index 759565df..091eb3cf 100644 --- a/sigrok.h.in +++ b/sigrok.h.in @@ -145,6 +145,7 @@ enum { SR_T_FLOAT, SR_T_RATIONAL_PERIOD, SR_T_RATIONAL_VOLT, + SR_T_KEYVALUE, }; struct sr_rational { @@ -167,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; @@ -194,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; }; @@ -278,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, @@ -326,6 +365,7 @@ enum { /** Coupling. */ SR_HWCAP_COUPLING, + /*--- Special stuff -------------------------------------------------*/ /* TODO: Better description. */ @@ -340,6 +380,7 @@ enum { /** The device supports setting the number of probes. */ SR_HWCAP_CAPTURE_NUM_PROBES, + /*--- Acquisition modes ---------------------------------------------*/ /** @@ -449,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 { @@ -466,7 +507,7 @@ struct sr_dev_driver { const void *(*dev_info_get) (int dev_index, int dev_info_id); int (*dev_status_get) (int dev_index); const int *(*hwcap_get_all) (void); - int (*dev_config_set) (int dev_index, int hwcap, void *value); + 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); };