scTDCLibrary
scTDC.h
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #if defined _WIN32 || defined __CYGWIN__
8  #ifdef SCTDC_EXPORTS
9  #define SCTDCDLL_PUBLIC __declspec(dllexport)
10  #define WIN32_LEAN_AND_MEAN
11  #else
12  #define SCTDCDLL_PUBLIC __declspec(dllimport)
13  #endif
14 #elif __linux__
15  #ifdef SCTDC_EXPORTS
16  #define SCTDCDLL_PUBLIC __attribute__ ((visibility("default")))
17  #else
18  #define SCTDCDLL_PUBLIC
19  #endif
20  #include <sys/types.h>
21 #else
22  #error platform is not supported
23 #endif
24 
25 #include "scTDC_types.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif // __cplusplus
30 
31 
40 SCTDCDLL_PUBLIC void sc_get_err_msg(int err_code, char *err_msg);
41 
53 SCTDCDLL_PUBLIC int
55 (const enum sc_event_type_index type,
56 const void *event,
57 const unsigned event_len_bytes);
58 
59 
60 
61 // -------------------------- api vmaj2 -----------------------------------------
62 
76 SCTDCDLL_PUBLIC int sc_tdc_init_inifile(const char *ini_filename);
77 
94 SCTDCDLL_PUBLIC int
95 sc_tdc_init_with_config_lines(const struct sc_ConfigLine *confline_array);
96 
105 SCTDCDLL_PUBLIC int sc_tdc_deinit2(const int dev_desc);
106 
116 SCTDCDLL_PUBLIC int
117 sc_tdc_get_format2(const int dev_desc, struct sc_tdc_format *format);
118 
119 SCTDCDLL_PUBLIC int sc_tdc_set_complete_callback2
120  (const int, void *owner, void (*cb)(void *, int));
121 
130 SCTDCDLL_PUBLIC int sc_tdc_start_measure2(const int dev_desc, const int ms);
131 
139 SCTDCDLL_PUBLIC int sc_tdc_interrupt2(const int dev_desc);
140 
147 SCTDCDLL_PUBLIC int sc_tdc_get_binsize2(const int dev_desc, double *binsize_ns);
148 
158 SCTDCDLL_PUBLIC int sc_tdc_get_status2(const int dev_desc, int *status);
159 
160 SCTDCDLL_PUBLIC int sc_twi_write2
161 (const int,
162 const unsigned char address,
163 const unsigned char *data,
164 const size_t size,
165 const int stop);
166 
167 SCTDCDLL_PUBLIC int sc_twi_read2
168 (const int,
169 const unsigned char address,
170 unsigned char *data,
171 const size_t size,
172 const int stop);
173 
174 SCTDCDLL_PUBLIC int sc_twi_set_epot2
175 (const int, unsigned int epot, unsigned int value_number, unsigned char value);
176 
201 SCTDCDLL_PUBLIC int sc_pipe_open2
202 (const int dev_desc, const enum sc_pipe_type_t type, const void *params);
203 
210 SCTDCDLL_PUBLIC int sc_pipe_close2(const int dev_desc, const int pipe_id);
211 
230 SCTDCDLL_PUBLIC int sc_pipe_read2
231 (const int dev_desc, const int pipe_id, void **buffer, unsigned int timeout);
232 
233 SCTDCDLL_PUBLIC int
234 sc_tdc_set_flim_scanner2
235 (const int dd,
236 unsigned short pixel_interval,
237 unsigned short pixel_count,
238 unsigned short line_count,
239 unsigned int line_delay_interval,
240 unsigned int multiline_count,
241 double *corr_table);
242 
243 SCTDCDLL_PUBLIC int
244 sc_tdc_set_flim_scanner2ex
245 (const int dd,
246 unsigned short pixel_interval,
247 unsigned short pixel_count,
248 unsigned short line_count,
249 unsigned int line_delay_interval,
250 unsigned int multiline_count,
251 double *corr_table,
252 unsigned int flags);
253 
254 SCTDCDLL_PUBLIC int
255 sc_tdc_is_event2
256 (const enum sc_event_type_index type,
257 const void *event,
258 const unsigned event_len_bytes);
259 
260 SCTDCDLL_PUBLIC int sc_tdc_set_corrections2(const int, const int, const int *, const unsigned char *);
261 SCTDCDLL_PUBLIC int sc_tdc_set_common_shift2(const int, const int);
262 SCTDCDLL_PUBLIC int sc_tdc_set_modulo2(const int, const unsigned int);
263 SCTDCDLL_PUBLIC int sc_tdc_get_modulo2(const int, unsigned int *);
272 SCTDCDLL_PUBLIC int sc_tdc_pipe_open2
273 (const int dd, size_t internal_pipe_size,
274 const struct sc_PipeCbf *pipe_warning,
275 const struct sc_PipeCbf *pipe_alert);
276 
282 SCTDCDLL_PUBLIC int sc_tdc_pipe_close2(const int dd);
283 
293 SCTDCDLL_PUBLIC ssize_t sc_tdc_pipe_read2
294 (const int dd, void *buffer, size_t buffer_size_bytes, unsigned timeout);
295 
304 SCTDCDLL_PUBLIC int sc_tdc_config_get_key
305 (const int dd, const char *key, char *buf, size_t buf_size, const char *def);
306 
310 SCTDCDLL_PUBLIC void sc_tdc_config_get_library_version(unsigned [3]);
311 
312 //v1.1405
313 
323 SCTDCDLL_PUBLIC int sc_tdc_get_device_properties
324 (const int dd, int params_num, void *params);
325 
326 //v1.1406.1
327 SCTDCDLL_PUBLIC int sc_dld_set_hardware_binning
328 (const int dd, const struct sc3du_t *binning);
329 
330 //v1.15xx
331 
338 SCTDCDLL_PUBLIC int sc_tdc_set_iteration_number2(const int dd, int itnum);
339 
340 //v1.1711.1
341 
349 SCTDCDLL_PUBLIC int sc_tdc_set_cmos_and_smoothers_params
350 (const int dd, const struct sc_CmosSmootherParameters *params);
351 
359 SCTDCDLL_PUBLIC int sc_tdc_set_blob_parameters
360 (const int dd, const struct sc_BlobParameters *params);
361 
373 SCTDCDLL_PUBLIC int sc_tdc_get_cmos_and_smoothers_params
374 (const int dd, struct sc_CmosSmootherParameters *params);
375 
387 SCTDCDLL_PUBLIC int sc_tdc_get_blob_parameters
388 (const int dd, struct sc_BlobParameters *params);
389 
390 //v1.3001.0
391 
398 SCTDCDLL_PUBLIC int sc_tdc_set_blob
399 (const int dd, const char *blob);
400 
409 SCTDCDLL_PUBLIC int sc_tdc_get_blob
410 (const int dd, char *str, size_t str_len, size_t *str_len_ret);
411 
412 SCTDCDLL_PUBLIC int sc_tdc_zero_master_reset_counter
413 (const int dd);
414 
415 
416 #ifdef __cplusplus
417 }
418 #endif // __cplusplus
419 
420 #define ERRSTRLEN 256
sc_pipe_type_t
Pipe type.
Definition: scTDC_types.h:187
SCTDCDLL_PUBLIC int sc_tdc_init_with_config_lines(const struct sc_ConfigLine *confline_array)
Initializes the hardware and loads the initial settings taken from array of sc_ConfigLine structures...
SCTDCDLL_PUBLIC int sc_tdc_set_blob(const int dd, const char *blob)
Set blob algorithm.
SCTDCDLL_PUBLIC void sc_tdc_config_get_library_version(unsigned[3])
Get scTDC version.
SCTDCDLL_PUBLIC int sc_tdc_get_format2(const int dev_desc, struct sc_tdc_format *format)
Get data format of the tdc events.
SCTDCDLL_PUBLIC int sc_tdc_deinit2(const int dev_desc)
Deinitialize the hardware.
SCTDCDLL_PUBLIC int sc_tdc_is_event(const enum sc_event_type_index type, const void *event, const unsigned event_len_bytes)
Check type of event data.
SCTDCDLL_PUBLIC int sc_tdc_get_device_properties(const int dd, int params_num, void *params)
Get Device Properties.
SCTDCDLL_PUBLIC int sc_pipe_close2(const int dev_desc, const int pipe_id)
Close data pipe.
SCTDCDLL_PUBLIC int sc_tdc_get_cmos_and_smoothers_params(const int dd, struct sc_CmosSmootherParameters *params)
Get cmos and smoother parameters.
SCTDCDLL_PUBLIC int sc_tdc_get_blob_parameters(const int dd, struct sc_BlobParameters *params)
Get blob parameters.
SCTDCDLL_PUBLIC int sc_tdc_get_blob(const int dd, char *str, size_t str_len, size_t *str_len_ret)
Get default blob algorithm.
SCTDCDLL_PUBLIC void sc_get_err_msg(int err_code, char *err_msg)
Gives an error description in a text form.
SCTDCDLL_PUBLIC int sc_tdc_interrupt2(const int dev_desc)
Stop measure.
SCTDCDLL_PUBLIC int sc_tdc_set_cmos_and_smoothers_params(const int dd, const struct sc_CmosSmootherParameters *params)
Set cmos and smoother parameters.
SCTDCDLL_PUBLIC int sc_tdc_pipe_close2(const int dd)
Close data pipe for tdc events.
sc_event_type_index
Used to find out type of event.
Definition: scTDC_types.h:573
SCTDCDLL_PUBLIC int sc_tdc_init_inifile(const char *ini_filename)
Initializes the hardware and loads the initial settings reading it from ini file. ...
Definition: scTDC_types.h:604
SCTDCDLL_PUBLIC int sc_tdc_get_binsize2(const int dev_desc, double *binsize_ns)
Get binsize in nanoseconds.
SCTDCDLL_PUBLIC int sc_tdc_set_iteration_number2(const int dd, int itnum)
Set Iteration Number.
Blob parameters structure.
Definition: scTDC_types.h:681
SCTDCDLL_PUBLIC int sc_pipe_read2(const int dev_desc, const int pipe_id, void **buffer, unsigned int timeout)
Read data from pipe.
SCTDCDLL_PUBLIC int sc_tdc_start_measure2(const int dev_desc, const int ms)
Start measure.
SCTDCDLL_PUBLIC int sc_pipe_open2(const int dev_desc, const enum sc_pipe_type_t type, const void *params)
Open data pipe.
Unsigned 3d point.
Definition: scTDC_types.h:72
SCTDCDLL_PUBLIC int sc_tdc_get_status2(const int dev_desc, int *status)
Get running status.
Cmos and Smoother parameters structure.
Definition: scTDC_types.h:653
SCTDCDLL_PUBLIC ssize_t sc_tdc_pipe_read2(const int dd, void *buffer, size_t buffer_size_bytes, unsigned timeout)
Read tdc events from the pipe.
Definition: scTDC_types.h:610
SCTDCDLL_PUBLIC int sc_tdc_pipe_open2(const int dd, size_t internal_pipe_size, const struct sc_PipeCbf *pipe_warning, const struct sc_PipeCbf *pipe_alert)
Open data pipe for tdc events.
SCTDCDLL_PUBLIC int sc_tdc_set_blob_parameters(const int dd, const struct sc_BlobParameters *params)
Set blob parameters.
Contains sizes and offsets of data bitfields.
Definition: scTDC_types.h:146
SCTDCDLL_PUBLIC int sc_tdc_config_get_key(const int dd, const char *key, char *buf, size_t buf_size, const char *def)
Get configuration data.