]> sigrok.org Git - libsigrok.git/blobdiff - src/hwdriver.c
Fix #442 by renaming sr_dev_driver.priv to .context
[libsigrok.git] / src / hwdriver.c
index dea7c9e42c604760c999e2c0b0e7f22e0d0af797..74d75e6a1e5bdad58909aabb93e207b8f68d7f1e 100644 (file)
@@ -65,6 +65,8 @@ static struct sr_config_info sr_config_info_data[] = {
                "Connection", NULL},
        {SR_CONF_SERIALCOMM, SR_T_STRING, "serialcomm",
                "Serial communication", NULL},
+       {SR_CONF_MODBUSADDR, SR_T_UINT64, "modbusaddr",
+               "Modbus slave address", NULL},
 
        /* Device (or channel group) configuration */
        {SR_CONF_SAMPLERATE, SR_T_UINT64, "samplerate",
@@ -125,18 +127,18 @@ static struct sr_config_info sr_config_info_data[] = {
                "Number of logic channels", NULL},
        {SR_CONF_NUM_ANALOG_CHANNELS, SR_T_INT32, "analog_channels",
                "Number of analog channels", NULL},
-       {SR_CONF_OUTPUT_VOLTAGE, SR_T_FLOAT, "output_voltage",
-               "Current output voltage", NULL},
-       {SR_CONF_OUTPUT_VOLTAGE_TARGET, SR_T_FLOAT, "output_voltage_target",
-               "Output voltage target", NULL},
-       {SR_CONF_OUTPUT_CURRENT, SR_T_FLOAT, "output_current",
-               "Current output current", NULL},
-       {SR_CONF_OUTPUT_CURRENT_LIMIT, SR_T_FLOAT, "output_current_limit",
-               "Output current limit", NULL},
-       {SR_CONF_OUTPUT_ENABLED, SR_T_BOOL, "output_enabled",
-               "Output enabled", NULL},
-       {SR_CONF_OUTPUT_CHANNEL_CONFIG, SR_T_STRING, "output_channel_config",
-               "Output channel modes", NULL},
+       {SR_CONF_VOLTAGE, SR_T_FLOAT, "voltage",
+               "Current voltage", NULL},
+       {SR_CONF_VOLTAGE_TARGET, SR_T_FLOAT, "voltage_target",
+               "Voltage target", NULL},
+       {SR_CONF_CURRENT, SR_T_FLOAT, "current",
+               "Current current", NULL},
+       {SR_CONF_CURRENT_LIMIT, SR_T_FLOAT, "current_limit",
+               "Current limit", NULL},
+       {SR_CONF_ENABLED, SR_T_BOOL, "enabled",
+               "Channel enabled", NULL},
+       {SR_CONF_CHANNEL_CONFIG, SR_T_STRING, "channel_config",
+               "Channel modes", NULL},
        {SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED, SR_T_BOOL, "ovp_enabled",
                "Over-voltage protection enabled", NULL},
        {SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE, SR_T_BOOL, "ovp_active",
@@ -153,8 +155,8 @@ static struct sr_config_info sr_config_info_data[] = {
                "Clock edge", NULL},
        {SR_CONF_AMPLITUDE, SR_T_FLOAT, "amplitude",
                "Amplitude", NULL},
-       {SR_CONF_OUTPUT_REGULATION, SR_T_STRING, "output_regulation",
-               "Output channel regulation", NULL},
+       {SR_CONF_REGULATION, SR_T_STRING, "regulation",
+               "Channel regulation", NULL},
        {SR_CONF_OVER_TEMPERATURE_PROTECTION, SR_T_BOOL, "otp",
                "Over-temperature protection", NULL},
        {SR_CONF_OUTPUT_FREQUENCY, SR_T_FLOAT, "output_frequency",
@@ -167,6 +169,8 @@ static struct sr_config_info sr_config_info_data[] = {
                "Measured secondary quantity", NULL},
        {SR_CONF_EQUIV_CIRCUIT_MODEL, SR_T_STRING, "equiv_circuit_model",
                "Equivalent circuit model", NULL},
+       {SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE, SR_T_BOOL, "otp_active",
+               "Over-temperature protection active", NULL},
 
        /* Special stuff */
        {SR_CONF_SCAN_OPTIONS, SR_T_STRING, "scan_options",
@@ -393,7 +397,7 @@ SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options)
                return NULL;
        }
 
-       if (!driver->priv) {
+       if (!driver->context) {
                sr_err("Driver not initialized, can't scan for devices.");
                return NULL;
        }
@@ -430,7 +434,7 @@ SR_PRIV void sr_hw_cleanup_all(const struct sr_context *ctx)
        for (i = 0; drivers[i]; i++) {
                if (drivers[i]->cleanup)
                        drivers[i]->cleanup(drivers[i]);
-               drivers[i]->priv = NULL;
+               drivers[i]->context = NULL;
        }
 }