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 {
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;
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;
};
/** 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: <data bits><parity><stop bit> e.g. 8n1 */
+ SR_HWCAP_SERIALCOMM,
+
+
+ /*--- Device configuration ------------------------------------------*/
/** The device supports setting/changing its samplerate. */
SR_HWCAP_SAMPLERATE,
/** Filter. */
SR_HWCAP_FILTER,
+ /** Volts/div. */
+ SR_HWCAP_VDIV,
+
+ /** Coupling. */
+ SR_HWCAP_COUPLING,
+
+
/*--- Special stuff -------------------------------------------------*/
/* TODO: Better description. */
/** The device supports setting the number of probes. */
SR_HWCAP_CAPTURE_NUM_PROBES,
+
/*--- Acquisition modes ---------------------------------------------*/
/**
SR_DI_TRIGGER_SOURCES,
/* Supported filter targets */
SR_DI_FILTERS,
+ /* Valid volts/div values */
+ SR_DI_VDIVS,
+ /* Coupling options */
+ SR_DI_COUPLING,
};
/*
uint64_t low;
uint64_t high;
uint64_t step;
- uint64_t *list;
+ const uint64_t *list;
};
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);
};