X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhwdriver.c;h=74d75e6a1e5bdad58909aabb93e207b8f68d7f1e;hb=81b3ce374c3b6d48e5ed321ac7a871ce4248a0bb;hp=ec0c706e97279ee431d516b9a19d4ba81d9d412d;hpb=032da34b786333a1af811235c5cf29855479f0b6;p=libsigrok.git diff --git a/src/hwdriver.c b/src/hwdriver.c index ec0c706e..74d75e6a 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -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,18 +155,22 @@ 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_UINT64, "output_frequency", + {SR_CONF_OUTPUT_FREQUENCY, SR_T_FLOAT, "output_frequency", "Output frequency", NULL}, + {SR_CONF_OUTPUT_FREQUENCY_TARGET, SR_T_FLOAT, "output_frequency_target", + "Output frequency target", NULL}, {SR_CONF_MEASURED_QUANTITY, SR_T_STRING, "measured_quantity", "Measured quantity", NULL}, {SR_CONF_MEASURED_2ND_QUANTITY, SR_T_STRING, "measured_2nd_quantity", "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", @@ -391,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; } @@ -428,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; } }