X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=include%2Flibsigrok%2Fproto.h;h=70bb5978d7237f4a6b62103fdbe871c4d70b403c;hb=8a174d23427735617d69c7502ed8dcade786bbf9;hp=a159baed6c541d0626ac4231053145397ff35a90;hpb=fc74643098877824b7a3cf16cc24de624b191615;p=libsigrok.git diff --git a/include/libsigrok/proto.h b/include/libsigrok/proto.h index a159baed..70bb5978 100644 --- a/include/libsigrok/proto.h +++ b/include/libsigrok/proto.h @@ -26,6 +26,15 @@ * Header file containing API function prototypes. */ +/*--- analog.c --------------------------------------------------------------*/ + +SR_API int sr_analog_to_float(const struct sr_datafeed_analog2 *analog, + float *buf); +SR_API int sr_analog_float_to_string(float value, int digits, char **result); +SR_API int sr_analog_unit_to_string(const struct sr_datafeed_analog2 *analog, + char **result); +SR_API inline void sr_rational_set(struct sr_rational *r, uint64_t p, uint64_t q); + /*--- backend.c -------------------------------------------------------------*/ SR_API int sr_init(struct sr_context **ctx); @@ -55,6 +64,19 @@ SR_API int sr_dev_clear(const struct sr_dev_driver *driver); SR_API int sr_dev_open(struct sr_dev_inst *sdi); SR_API int sr_dev_close(struct sr_dev_inst *sdi); +SR_API struct sr_dev_driver *sr_dev_inst_driver_get(const struct sr_dev_inst *sdi); +SR_API const char *sr_dev_inst_vendor_get(const struct sr_dev_inst *sdi); +SR_API const char *sr_dev_inst_model_get(const struct sr_dev_inst *sdi); +SR_API const char *sr_dev_inst_version_get(const struct sr_dev_inst *sdi); +SR_API const char *sr_dev_inst_sernum_get(const struct sr_dev_inst *sdi); +SR_API const char *sr_dev_inst_connid_get(const struct sr_dev_inst *sdi); +SR_API GSList *sr_dev_inst_channels_get(const struct sr_dev_inst *sdi); +SR_API GSList *sr_dev_inst_channel_groups_get(const struct sr_dev_inst *sdi); + +SR_API struct sr_dev_inst *sr_dev_inst_user_new(const char *vendor, + const char *model, const char *version); +SR_API int sr_dev_inst_channel_add(struct sr_dev_inst *sdi, int index, int type, const char *name); + /*--- hwdriver.c ------------------------------------------------------------*/ SR_API struct sr_dev_driver **sr_driver_list(void); @@ -64,16 +86,16 @@ SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options); SR_API int sr_config_get(const struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg, - int key, GVariant **data); + uint32_t key, GVariant **data); SR_API int sr_config_set(const struct sr_dev_inst *sdi, const struct sr_channel_group *cg, - int key, GVariant *data); + uint32_t key, GVariant *data); SR_API int sr_config_commit(const struct sr_dev_inst *sdi); SR_API int sr_config_list(const struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg, - int key, GVariant **data); -SR_API const struct sr_config_info *sr_config_info_get(int key); + uint32_t key, GVariant **data); +SR_API const struct sr_config_info *sr_config_info_get(uint32_t key); SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname); /*--- session.c -------------------------------------------------------------*/ @@ -124,7 +146,23 @@ SR_API int sr_session_source_remove_channel(struct sr_session *session, /*--- input/input.c ---------------------------------------------------------*/ -SR_API struct sr_input_format **sr_input_list(void); +SR_API const struct sr_input_module **sr_input_list(void); +SR_API const char *sr_input_id_get(const struct sr_input_module *in); +SR_API const char *sr_input_name_get(const struct sr_input_module *in); +SR_API const char *sr_input_description_get(const struct sr_input_module *in); +SR_API const char *const *sr_input_extensions_get( + const struct sr_input_module *o); +SR_API const struct sr_input_module *sr_input_find(char *id); +SR_API const struct sr_option **sr_input_options_get(const struct sr_input_module *in); +SR_API void sr_input_options_free(const struct sr_option **options); +SR_API struct sr_input *sr_input_new(const struct sr_input_module *imod, + GHashTable *options); +SR_API int sr_input_scan_buffer(GString *buf, const struct sr_input **in); +SR_API int sr_input_scan_file(const char *filename, const struct sr_input **in); +SR_API struct sr_dev_inst *sr_input_dev_inst_get(const struct sr_input *in); +SR_API int sr_input_send(const struct sr_input *in, GString *buf); +SR_API int sr_input_end(const struct sr_input *in); +SR_API void sr_input_free(const struct sr_input *in); /*--- output/output.c -------------------------------------------------------*/ @@ -132,6 +170,8 @@ SR_API const struct sr_output_module **sr_output_list(void); SR_API const char *sr_output_id_get(const struct sr_output_module *o); SR_API const char *sr_output_name_get(const struct sr_output_module *o); SR_API const char *sr_output_description_get(const struct sr_output_module *o); +SR_API const char *const *sr_output_extensions_get( + const struct sr_output_module *o); SR_API const struct sr_output_module *sr_output_find(char *id); SR_API const struct sr_option **sr_output_options_get(const struct sr_output_module *o); SR_API void sr_output_options_free(const struct sr_option **opts); @@ -149,6 +189,11 @@ SR_API struct sr_trigger_stage *sr_trigger_stage_add(struct sr_trigger *trig); SR_API int sr_trigger_match_add(struct sr_trigger_stage *stage, struct sr_channel *ch, int trigger_match, float value); +/*--- serial.c --------------------------------------------------------------*/ + +SR_API GSList *sr_serial_list(const struct sr_dev_driver *driver); +SR_API void sr_serial_free(struct sr_serial_port *serial); + /*--- strutil.c -------------------------------------------------------------*/ SR_API char *sr_si_string_u64(uint64_t x, const char *unit);