+
+SR_PRIV int lps_process_status(struct sr_dev_inst* sdi, int stat);
+SR_PRIV int lps_send_req(struct sr_serial_dev_inst *serial, const char* fmt, ...);
+
+#define LOG_PREFIX "motech-lps-30x"
+
+#define LINELEN_MAX 50 /**< Max. line length for requests */
+
+#define REQ_TIMEOUT_MS 250 /**< Timeout [ms] for single request. */
+
+#define MAX_CHANNELS 3
+
+typedef enum {
+ LPS_UNKNOWN = 0,/**< Unknown model (used during detection process) */
+ LPS_301, /**< Motech/Amrel LPS-301, 1 output */
+ LPS_302, /**< Motech/Amrel LPS-302, 1 output */
+ LPS_303, /**< Motech/Amrel LPS-303, 1 output */
+ LPS_304, /**< Motech/Amrel LPS-304, 3 outputs */
+ LPS_305, /**< Motech/Amrel LPS-305, 3 outputs */
+} lps_modelid;
+
+/** Channel specification */
+struct channel_spec {
+ /* Min, max, step. */
+ gdouble voltage[3];
+ gdouble current[3];
+};
+
+/** Model properties specification */
+struct lps_modelspec {
+ lps_modelid modelid;
+ const char* modelstr;
+ uint8_t num_channels;
+ struct channel_spec channels[3];
+};
+
+/** Used to implement a little state machine to query all required values in a row. */
+typedef enum {
+ AQ_NONE,
+ AQ_U1,
+ AQ_I1,
+ AQ_I2,
+ AQ_U2,
+ AQ_STATUS,
+} acquisition_req;
+
+/** Status of a single channel. */
+struct channel_status {
+ /* Channel information (struct channel_info*). data (struct) owned by sdi, just a reference to address a single channel. */
+ GSList* info;
+ /* Received from device. */
+ gdouble output_voltage_last;
+ gdouble output_current_last;
+ gboolean output_enabled; /**< Also used when set. */
+ gboolean cc_mode; /**< Constant current mode. If false, constant voltage mode. */
+ /* Set by frontend. */
+ gdouble output_voltage_max;
+ gdouble output_current_max;
+};