X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fserial-dmm%2Fprotocol.h;h=c80180ce0b976c089036b8d26d4b50d249b3ef53;hb=ca314e060f653e6a0b5ec0f58914bac4d426217f;hp=3c2d88b80876cf111cc25e9f25696dc31ec952b6;hpb=2c24077466a299ead689c90f01f55f6d86c7386b;p=libsigrok.git diff --git a/src/hardware/serial-dmm/protocol.h b/src/hardware/serial-dmm/protocol.h index 3c2d88b8..c80180ce 100644 --- a/src/hardware/serial-dmm/protocol.h +++ b/src/hardware/serial-dmm/protocol.h @@ -35,11 +35,15 @@ struct dmm_info { uint32_t baudrate; /** Packet size in bytes. */ int packet_size; - /** Request timeout [ms] before request is considered lost and a new - * one is sent. Used only if device needs polling. */ + /** + * Request timeout [ms] before request is considered lost and a new + * one is sent. Used only if device needs polling. + */ int64_t req_timeout_ms; - /** Delay between reception of packet and next request. Some DMMs - * need this. Used only if device needs polling. */ + /** + * Delay between reception of packet and next request. Some DMMs + * need this. Used only if device needs polling. + */ int64_t req_delay_ms; /** Packet request function. */ int (*packet_request)(struct sr_serial_dev_inst *); @@ -47,38 +51,26 @@ struct dmm_info { gboolean (*packet_valid)(const uint8_t *); /** Packet parsing function. */ int (*packet_parse)(const uint8_t *, float *, - struct sr_datafeed_analog_old *, void *); + struct sr_datafeed_analog *, void *); /** */ - void (*dmm_details)(struct sr_datafeed_analog_old *, void *); + void (*dmm_details)(struct sr_datafeed_analog *, void *); /** Size of chipset info struct. */ gsize info_size; }; #define DMM_BUFSIZE 256 -/** Private, per-device-instance driver context. */ struct dev_context { - /** The current sampling limit (in number of samples). */ - uint64_t limit_samples; - - /** The time limit (in milliseconds). */ - uint64_t limit_msec; - - /** Opaque pointer passed in by the frontend. */ - void *cb_data; - - /** The current number of already received samples. */ - uint64_t num_samples; - - /** The starting time of current sampling run. */ - int64_t starttime; + struct sr_sw_limits limits; uint8_t buf[DMM_BUFSIZE]; int bufoffset; int buflen; - /** The timestamp [µs] to send the next request. - * Used only if device needs polling. */ + /** + * The timestamp [µs] to send the next request. + * Used only if device needs polling. + */ int64_t req_next_at; };