scTDCLibrary
|
Go to the source code of this file.
Macros | |
#define | ERRSTRLEN 256 |
Functions | |
SCTDCDLL_PUBLIC void | sc_get_err_msg (int err_code, char *err_msg) |
Gives an error description in a text form. More... | |
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. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_init_inifile (const char *ini_filename) |
Initializes the hardware and loads the initial settings reading it from ini file. More... | |
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. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_deinit2 (const int dev_desc) |
Deinitialize the hardware. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_get_format2 (const int dev_desc, struct sc_tdc_format *format) |
Get data format of the tdc events. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_set_complete_callback2 (const int, void *owner, void(*cb)(void *, int)) |
SCTDCDLL_PUBLIC int | sc_tdc_start_measure2 (const int dev_desc, const int ms) |
Start measure. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_interrupt2 (const int dev_desc) |
Stop measure. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_get_binsize2 (const int dev_desc, double *binsize_ns) |
Get binsize in nanoseconds. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_get_status2 (const int dev_desc, int *status) |
Get running status. More... | |
SCTDCDLL_PUBLIC int | sc_twi_write2 (const int, const unsigned char address, const unsigned char *data, const size_t size, const int stop) |
SCTDCDLL_PUBLIC int | sc_twi_read2 (const int, const unsigned char address, unsigned char *data, const size_t size, const int stop) |
SCTDCDLL_PUBLIC int | sc_twi_set_epot2 (const int, unsigned int epot, unsigned int value_number, unsigned char value) |
SCTDCDLL_PUBLIC int | sc_pipe_open2 (const int dev_desc, const enum sc_pipe_type_t type, const void *params) |
Open data pipe. More... | |
SCTDCDLL_PUBLIC int | sc_pipe_close2 (const int dev_desc, const int pipe_id) |
Close data pipe. More... | |
SCTDCDLL_PUBLIC int | sc_pipe_read2 (const int dev_desc, const int pipe_id, void **buffer, unsigned int timeout) |
Read data from pipe. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_set_flim_scanner2 (const int dd, unsigned short pixel_interval, unsigned short pixel_count, unsigned short line_count, unsigned int line_delay_interval, unsigned int multiline_count, double *corr_table) |
SCTDCDLL_PUBLIC int | sc_tdc_set_flim_scanner2ex (const int dd, unsigned short pixel_interval, unsigned short pixel_count, unsigned short line_count, unsigned int line_delay_interval, unsigned int multiline_count, double *corr_table, unsigned int flags) |
SCTDCDLL_PUBLIC int | sc_tdc_is_event2 (const enum sc_event_type_index type, const void *event, const unsigned event_len_bytes) |
SCTDCDLL_PUBLIC int | sc_tdc_set_corrections2 (const int, const int, const int *, const unsigned char *) |
SCTDCDLL_PUBLIC int | sc_tdc_set_common_shift2 (const int, const int) |
SCTDCDLL_PUBLIC int | sc_tdc_set_modulo2 (const int, const unsigned int) |
SCTDCDLL_PUBLIC int | sc_tdc_get_modulo2 (const int, unsigned int *) |
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. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_pipe_close2 (const int dd) |
Close data pipe for tdc events. More... | |
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. More... | |
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. More... | |
SCTDCDLL_PUBLIC void | sc_tdc_config_get_library_version (unsigned[3]) |
Get scTDC version. | |
SCTDCDLL_PUBLIC int | sc_tdc_get_device_properties (const int dd, int params_num, void *params) |
Get Device Properties. More... | |
SCTDCDLL_PUBLIC int | sc_dld_set_hardware_binning (const int dd, const struct sc3du_t *binning) |
SCTDCDLL_PUBLIC int | sc_tdc_set_iteration_number2 (const int dd, int itnum) |
Set Iteration Number. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_set_cmos_and_smoothers_params (const int dd, const struct sc_CmosSmootherParameters *params) |
Set cmos and smoother parameters. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_set_blob_parameters (const int dd, const struct sc_BlobParameters *params) |
Set blob parameters. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_get_cmos_and_smoothers_params (const int dd, struct sc_CmosSmootherParameters *params) |
Get cmos and smoother parameters. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_get_blob_parameters (const int dd, struct sc_BlobParameters *params) |
Get blob parameters. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_set_blob (const int dd, const char *blob) |
Set blob algorithm. More... | |
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. More... | |
SCTDCDLL_PUBLIC int | sc_tdc_zero_master_reset_counter (const int dd) |
SCTDCDLL_PUBLIC void sc_get_err_msg | ( | int | err_code, |
char * | err_msg | ||
) |
Gives an error description in a text form.
err_code | Integer error code |
err_msg | Pointer to put a text description. |
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.
type | Event type for comparison. |
event | Event under testing. |
event_len_bytes | Length of event in bytes. |
Call this function to test whether event is special sign or not.
Returns non zero value if event is of requested type otherwise returns zero.
SCTDCDLL_PUBLIC int sc_tdc_init_inifile | ( | const char * | ini_filename | ) |
Initializes the hardware and loads the initial settings reading it from ini file.
ini_filename | Name of the inifile used for initialization. |
The function must be called before any other operation and associates an positive integer number (device descriptor) with the device. Device descriptor must be used to identify hardware for any other operation.
Hardware with the same serial number cannot be opened twice. Call sc_tdc_deinit2() to close and deinitialize hardware.
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.
confline_array | Array of sc_ConfigLine structures which contains configuration needed. |
The function must be called before any other operation and associates an positive integer number (device destriptor) with the device. Device descriptor must be used to identify hardware for any other operation.
Hardware with the same serial number cannot be opened twice. Call sc_tdc_deinit2() to close and deinitialize hardware.
Last structure of the array must contain sc_ConfigLine::section equal NULL.
SCTDCDLL_PUBLIC int sc_tdc_deinit2 | ( | const int | dev_desc | ) |
Deinitialize the hardware.
dev_desc | Device descriptor of the hardware to be deinitialized. |
Call this function to release device and resources allocated to operate. Hardware is deinitialized after the call.
SCTDCDLL_PUBLIC int sc_tdc_get_format2 | ( | const int | dev_desc, |
struct sc_tdc_format * | format | ||
) |
Get data format of the tdc events.
dev_desc | Device descriptor. |
format | Pointer on the structure where format should be placed. |
Call this function to get event format got from tdc pipe. See sc_tdc_pipe_open2() for details.
SCTDCDLL_PUBLIC int sc_tdc_start_measure2 | ( | const int | dev_desc, |
const int | ms | ||
) |
Start measure.
dev_desc | Device destriptor. |
ms | Exposure time in milliseconds. |
Start measurement.
SCTDCDLL_PUBLIC int sc_tdc_interrupt2 | ( | const int | dev_desc | ) |
Stop measure.
dev_desc | Device descriptor. |
Stops started exposure.
SCTDCDLL_PUBLIC int sc_tdc_get_binsize2 | ( | const int | dev_desc, |
double * | binsize_ns | ||
) |
Get binsize in nanoseconds.
dev_desc | Device descriptor. |
binsize_ns | Pointer where binsize should be stored. |
SCTDCDLL_PUBLIC int sc_tdc_get_status2 | ( | const int | dev_desc, |
int * | status | ||
) |
Get running status.
dev_desc | Device descriptor. |
status | Pointer where status info must be stored. |
The function could be used to get status of hardware. status 0 means idle state, 1 means that exposure is running.
SCTDCDLL_PUBLIC int sc_pipe_open2 | ( | const int | dev_desc, |
const enum sc_pipe_type_t | type, | ||
const void * | params | ||
) |
Open data pipe.
dev_desc | Device descriptor |
type | Pipe type. |
params | Pipe parameters. |
User can get as many pipes as required. It is not error to get two or more pipes of the same type, but for example with different roi or binning setting.
SCTDCDLL_PUBLIC int sc_pipe_close2 | ( | const int | dev_desc, |
const int | pipe_id | ||
) |
Close data pipe.
dev_desc | Device descriptor. |
pipe_id | Pipe id. |
SCTDCDLL_PUBLIC int sc_pipe_read2 | ( | const int | dev_desc, |
const int | pipe_id, | ||
void ** | buffer, | ||
unsigned int | timeout | ||
) |
Read data from pipe.
dev_desc | Device descriptor. |
pipe_id | Pipe id. |
buffer | Pointe to pointer where data block must be stored. |
timeout | Timeout in millisecond. |
This function allocates memory with allocator callback from pipe parameters structure if callback function was installed or allocates memory internally. Then copies data from the last exposure and returns the memory block in buffer. If memory was allocated internally it will be deallocated when next call to the function will be performed or pipe will be closed. If memory allocation callback function was installed in the pipe parameters no any deallocation of the memory will be performed. User must manage memory by him-/her- self.
Function returns when: data is available or timeout or pipe is closed.
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.
dd | Device descriptor. |
internal_pipe_size | Size of internal data buffer for events in bytes. |
pipe_warning | 90% pipe level callback function. |
pipe_alert | 99% pipe level callback function. |
SCTDCDLL_PUBLIC int sc_tdc_pipe_close2 | ( | const int | dd | ) |
Close data pipe for tdc events.
dd | Device descriptor. |
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.
dd | Device descriptor. |
buffer | Space for events. |
buffer_size_bytes | Size of the buffer in bytes. |
timeout | Timeout in milliseconds. |
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.
dd | Device descriptor. |
key | Configuration key in form 'section:key' |
buf | Space for configuration value as a string. |
buf_size | Size of buf in bytes. |
def | Default value. |
SCTDCDLL_PUBLIC int sc_tdc_get_device_properties | ( | const int | dd, |
int | params_num, | ||
void * | params | ||
) |
Get Device Properties.
dd | Device descriptor. |
params_num | Number of properties structure. |
params | Properties structure casted to void pointer. |
params_num 1 coresponds to sc_DeviceProperties1 structure. params_num 2 coresponds to sc_DeviceProperties2 structure.
SCTDCDLL_PUBLIC int sc_tdc_set_iteration_number2 | ( | const int | dd, |
int | itnum | ||
) |
Set Iteration Number.
dd | Device descriptor. |
itnum | Number of iteration per measure. |
SCTDCDLL_PUBLIC int sc_tdc_set_cmos_and_smoothers_params | ( | const int | dd, |
const struct sc_CmosSmootherParameters * | params | ||
) |
Set cmos and smoother parameters.
dd | Device descriptor. |
params | Cmos and smoother parameters structure. |
SCTDCDLL_PUBLIC int sc_tdc_set_blob_parameters | ( | const int | dd, |
const struct sc_BlobParameters * | params | ||
) |
Set blob parameters.
dd | Device descriptor. |
params | Blob parameters. |
SCTDCDLL_PUBLIC int sc_tdc_get_cmos_and_smoothers_params | ( | const int | dd, |
struct sc_CmosSmootherParameters * | params | ||
) |
Get cmos and smoother parameters.
dd | Device descriptor. |
params | Cmos and smoother parameters structure. |
Function reads default configuration for cmos and smoother from the inifile. Setting parameters with sc_tdc_set_cmos_and_smoothers_params() does not change default parameters.
SCTDCDLL_PUBLIC int sc_tdc_get_blob_parameters | ( | const int | dd, |
struct sc_BlobParameters * | params | ||
) |
Get blob parameters.
dd | Device descriptor. |
params | Blob parameters structure. |
Function read default configuration for blob algorithm from inifile. Setting parameters with sc_tdc_set_blob_parameters does not change default parameters.
SCTDCDLL_PUBLIC int sc_tdc_set_blob | ( | const int | dd, |
const char * | blob | ||
) |
Set blob algorithm.
dd | Device descriptor. |
blob | Library name where blob algorithm implemented. |
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.
dd | Device descriptor. |
str | Buffer for blob name string. |
str_len | Buffer for blob name string length. |
str_len_ret | Used memory space for blob name string. |