X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hwdriver.c;h=0fe7c703f385fe8c385fa10fc764b65c9cfe1424;hb=aac0ea256327bdff8f2a98bf62c7ac6a42dd1e44;hp=43f0762f0ec8b4e61cb3a0b4b8f5a02eb8049585;hpb=0fe11789961861a68d2de45136a7869f9b8c1717;p=libsigrok.git diff --git a/hwdriver.c b/hwdriver.c index 43f0762f..0fe7c703 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -23,8 +23,8 @@ #include #include #include -#include "sigrok.h" -#include "sigrok-internal.h" +#include "libsigrok.h" +#include "libsigrok-internal.h" /* * This enumerates which driver capabilities correspond to user-settable @@ -41,7 +41,13 @@ SR_API struct sr_hwcap_option sr_hwcap_options[] = { {SR_HWCAP_HORIZ_TRIGGERPOS, SR_T_FLOAT, "Horizontal trigger position", "horiz_triggerpos"}, {SR_HWCAP_BUFFERSIZE, SR_T_UINT64, "Buffer size", "buffersize"}, - {SR_HWCAP_TIMEBASE, SR_T_RATIONAL, "Time base", "timebase"}, + {SR_HWCAP_TIMEBASE, SR_T_RATIONAL_PERIOD, "Time base", "timebase"}, + {SR_HWCAP_FILTER, SR_T_CHAR, "Filter targets", "filter"}, + {SR_HWCAP_VDIV, SR_T_RATIONAL_VOLT, "Volts/div", "vdiv"}, + {SR_HWCAP_COUPLING, SR_T_CHAR, "Coupling", "coupling"}, + {SR_HWCAP_MODEL, SR_T_KEYVALUE, "Model", "model"}, + {SR_HWCAP_CONN, SR_T_CHAR, "Connection", "connect"}, + {SR_HWCAP_SERIALCOMM, SR_T_CHAR, "Serial communication", "serialcomm"}, {0, 0, NULL, NULL}, }; @@ -70,7 +76,13 @@ extern SR_PRIV struct sr_dev_driver alsa_driver_info; extern SR_PRIV struct sr_dev_driver fx2lafw_driver_info; #endif #ifdef HAVE_HW_HANTEK_DSO -extern SR_PRIV struct sr_dev_driver hantek_dso_plugin_info; +extern SR_PRIV struct sr_dev_driver hantek_dso_driver_info; +#endif +#ifdef HAVE_HW_MASTECH_VA18B +extern SR_PRIV struct sr_dev_driver mastech_va18b_driver_info; +#endif +#ifdef HAVE_HW_GENERICDMM +extern SR_PRIV struct sr_dev_driver genericdmm_driver_info; #endif static struct sr_dev_driver *drivers_list[] = { @@ -99,7 +111,13 @@ static struct sr_dev_driver *drivers_list[] = { &fx2lafw_driver_info, #endif #ifdef HAVE_HW_HANTEK_DSO - &hantek_dso_plugin_info, + &hantek_dso_driver_info, +#endif +#ifdef HAVE_HW_MASTECH_VA18B + &mastech_va18b_driver_info, +#endif +#ifdef HAVE_HW_GENERICDMM + &genericdmm_driver_info, #endif NULL, }; @@ -225,7 +243,7 @@ SR_PRIV struct sr_usb_dev_inst *sr_usb_dev_inst_new(uint8_t bus, udi->bus = bus; udi->address = address; - udi->devhdl = hdl; /* TODO: Check if this is NULL? */ + udi->devhdl = hdl; return udi; } @@ -273,7 +291,8 @@ SR_PRIV void sr_serial_dev_inst_free(struct sr_serial_dev_inst *serial) */ SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap) { - int *hwcaps, i; + const int *hwcaps; + int i; if (!driver) { sr_err("hwdriver: %s: driver was NULL", __func__); @@ -301,7 +320,7 @@ SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap) * @return A pointer to a struct with information about the parameter, or NULL * if the capability was not found. */ -SR_API struct sr_hwcap_option *sr_hw_hwcap_get(int hwcap) +SR_API const struct sr_hwcap_option *sr_hw_hwcap_get(int hwcap) { int i;