]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/rdtech-dps/protocol.h
rdtech-dps: Send META package when states have changed.
[libsigrok.git] / src / hardware / rdtech-dps / protocol.h
index 9e2b23f336378540e117841236d4da759e0f3621..d6619e5301321d109b68e3daa5156697a134e3d4 100644 (file)
@@ -34,12 +34,20 @@ struct rdtech_dps_model {
        unsigned int max_current;
        unsigned int max_voltage;
        unsigned int max_power;
+       unsigned int current_digits;
+       unsigned int voltage_digits;
 };
 
 struct dev_context {
        const struct rdtech_dps_model *model;
        struct sr_sw_limits limits;
        GMutex rw_mutex;
+       double current_multiplier;
+       double voltage_multiplier;
+       gboolean actual_ovp_state;
+       gboolean actual_ocp_state;
+       uint16_t actual_regulation_state;
+       uint16_t actual_output_state;
 };
 
 enum rdtech_dps_register {
@@ -85,6 +93,9 @@ enum rdtech_dps_mode {
        MODE_CC      = 1,
 };
 
+SR_PRIV int rdtech_dps_read_holding_registers(struct sr_modbus_dev_inst *modbus,
+               int address, int nb_registers, uint16_t *registers);
+
 SR_PRIV int rdtech_dps_get_reg(const struct sr_dev_inst *sdi, uint16_t address, uint16_t *value);
 SR_PRIV int rdtech_dps_set_reg(const struct sr_dev_inst *sdi, uint16_t address, uint16_t value);