X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fkorad-kaxxxxp%2Fprotocol.h;h=2423ce99a8e4f672d8d1aa0296546711d8f9afe5;hb=ca314e060f653e6a0b5ec0f58914bac4d426217f;hp=5df3fce60c35ab6725a9f9aef3f8619b8feb2d5c;hpb=2c5bdf1bbdf8d68b8ff9b352c790f50f23d90a23;p=libsigrok.git diff --git a/src/hardware/korad-kaxxxxp/protocol.h b/src/hardware/korad-kaxxxxp/protocol.h index 5df3fce6..2423ce99 100644 --- a/src/hardware/korad-kaxxxxp/protocol.h +++ b/src/hardware/korad-kaxxxxp/protocol.h @@ -17,12 +17,6 @@ * along with this program. If not, see . */ -/** - * @file - * Korad KAxxxxP power supply driver - * @internal - */ - #ifndef LIBSIGROK_HARDWARE_KORAD_KAXXXXP_PROTOCOL_H #define LIBSIGROK_HARDWARE_KORAD_KAXXXXP_PROTOCOL_H @@ -37,8 +31,10 @@ #define KAXXXXP_POLL_INTERVAL_MS 80 enum { - VELLEMAN_LABPS_3005D, - KORAD_KA3005D, + VELLEMAN_PS3005D, + VELLEMAN_LABPS3005D, + KORAD_KA3005P, + KORAD_KA3005P_0X01, /* Support for future devices with this protocol. */ }; @@ -68,22 +64,13 @@ enum { KAXXXXP_RECALL, }; -/** Private, per-device-instance driver context. */ struct dev_context { - /* Model-specific information */ const struct korad_kaxxxxp_model *model; /**< Model information. */ - /* Acquisition settings */ - uint64_t limit_samples; - uint64_t limit_msec; - uint64_t num_samples; - int64_t starttime; + struct sr_sw_limits limits; int64_t req_sent_at; gboolean reply_pending; - void *cb_data; - - /* Operational state */ float current; /**< Last current value [A] read from device. */ float current_max; /**< Output current set. */ float voltage; /**< Last voltage value [V] read from device. */ @@ -95,7 +82,6 @@ struct dev_context { gboolean ocp_enabled; /**< Output current protection enabled. */ gboolean ovp_enabled; /**< Output voltage protection enabled. */ - /* Temporary state across callbacks */ int target; /**< What reply to expect. */ int program; /**< Program to store or recall. */ char reply[6];