X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fhardware%2Frdtech-dps%2Fprotocol.h;h=456e20419bf6f785de425588111ccaa195ebe920;hp=fc23ed3ab1c087e2fdbe86484e330c4728386dc4;hb=7a78fd56f70b4739d6002ae6bd8ca2a70a2e96e3;hpb=d7a4dad881bf78ce17519d3d7728f74d0ec11415 diff --git a/src/hardware/rdtech-dps/protocol.h b/src/hardware/rdtech-dps/protocol.h index fc23ed3a..456e2041 100644 --- a/src/hardware/rdtech-dps/protocol.h +++ b/src/hardware/rdtech-dps/protocol.h @@ -32,7 +32,14 @@ #define LOG_PREFIX "rdtech-dps" +enum rdtech_dps_model_type { + MODEL_NONE, + MODEL_DPS, + MODEL_RD, +}; + struct rdtech_dps_model { + enum rdtech_dps_model_type model_type; unsigned int id; const char *name; unsigned int max_current; @@ -79,13 +86,20 @@ struct rdtech_dps_state { float voltage, current, power; }; +enum rdtech_dps_state_context { + ST_CTX_NONE, + ST_CTX_CONFIG, + ST_CTX_PRE_ACQ, + ST_CTX_IN_ACQ, +}; SR_PRIV int rdtech_dps_get_state(const struct sr_dev_inst *sdi, - struct rdtech_dps_state *state); + struct rdtech_dps_state *state, enum rdtech_dps_state_context reason); SR_PRIV int rdtech_dps_set_state(const struct sr_dev_inst *sdi, struct rdtech_dps_state *state); SR_PRIV int rdtech_dps_get_model_version(struct sr_modbus_dev_inst *modbus, - uint16_t *model, uint16_t *version); + enum rdtech_dps_model_type model_type, + uint16_t *model, uint16_t *version, uint32_t *serno); SR_PRIV int rdtech_dps_seed_receive(const struct sr_dev_inst *sdi); SR_PRIV int rdtech_dps_receive_data(int fd, int revents, void *cb_data);