/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool
47 by Suren A. Chilingaryan
Support FIFO reading/writting, code restructurization, few fixes
1
#ifndef _PCILIB_EVENT_H
2
#define _PCILIB_EVENT_H
3
240 by Suren A. Chilingaryan
More structural changes to get ready for stand-alone event engines
4
#include <pcilib.h>
253 by Suren A. Chilingaryan
Include version information in all API descriptions
5
#include <pcilib/version.h>
241 by Suren A. Chilingaryan
Further adjustments to get ready for independent event plugins
6
#include <pcilib/dma.h>
7
253 by Suren A. Chilingaryan
Include version information in all API descriptions
8
#define PCILIB_EVENT_INTERFACE_VERSION PCILIB_VERSION
47 by Suren A. Chilingaryan
Support FIFO reading/writting, code restructurization, few fixes
9
236 by Suren A. Chilingaryan
Big redign of model structures
10
typedef struct {
11
    size_t max_events;
12
    pcilib_timeout_t duration;
13
} pcilib_autostop_parameters_t;
14
15
typedef struct {
16
    pcilib_event_rawdata_callback_t callback;
17
    void *user;
18
} pcilib_rawdata_parameters_t;
19
20
typedef struct {
21
    size_t max_threads;
22
} pcilib_parallel_parameters_t;
23
24
typedef struct {
25
    pcilib_autostop_parameters_t autostop;
26
    pcilib_rawdata_parameters_t rawdata;
27
    pcilib_parallel_parameters_t parallel;
28
} pcilib_event_parameters_t;
29
30
struct pcilib_event_context_s {
31
    pcilib_event_parameters_t params;
32
    pcilib_t *pcilib;
33
};
34
35
typedef struct {
36
    pcilib_event_t evid;
37
    const char *name;
38
    const char *description;
39
} pcilib_event_description_t;
40
41
typedef struct {
42
    pcilib_event_data_type_t data_type;
43
    pcilib_event_t evid;
44
    const char *name;
45
    const char *description;
46
} pcilib_event_data_type_description_t;
47
126 by Suren A. Chilingaryan
multithread preprocessing of ipecamera frames and code reorganization
48
/*
49
 * get_data: This call is used by get_data and copy_data functions of public  
50
 * interface. When copy_data is the caller, the data parameter will be passed.
51
 * Therefore, depending on data the parameter, the function should behave
52
 * diferently. If get get_data function is used (buf == NULL), the caller is 
53
 * expected to call return_data afterwards. Otherwise, if buf != NULL and 
54
 * copy_data is used, the return call will not be executed.
55
 * Still, the get_data function is not obliged to return the data in the
56
 * passed buf, but a reference to the staticaly allocated memory may be 
57
 * returned instead. The copy can be managed by the envelope function.
58
 */
59
236 by Suren A. Chilingaryan
Big redign of model structures
60
typedef struct {
253 by Suren A. Chilingaryan
Include version information in all API descriptions
61
    pcilib_version_t version;
62
47 by Suren A. Chilingaryan
Support FIFO reading/writting, code restructurization, few fixes
63
    pcilib_context_t *(*init)(pcilib_t *ctx);
64
    void (*free)(pcilib_context_t *ctx);
65
227 by Suren A. Chilingaryan
Initial implementation of IPEDMA, dummy driver for KAPTURE, start of API changes
66
    pcilib_dma_context_t *(*init_dma)(pcilib_context_t *ctx);
67
47 by Suren A. Chilingaryan
Support FIFO reading/writting, code restructurization, few fixes
68
    int (*reset)(pcilib_context_t *ctx);
69
117 by Suren A. Chilingaryan
new event architecture, first trial
70
    int (*start)(pcilib_context_t *ctx, pcilib_event_t event_mask, pcilib_event_flags_t flags);
71
    int (*stop)(pcilib_context_t *ctx, pcilib_event_flags_t flags);
47 by Suren A. Chilingaryan
Support FIFO reading/writting, code restructurization, few fixes
72
    int (*trigger)(pcilib_context_t *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data);
73
    
117 by Suren A. Chilingaryan
new event architecture, first trial
74
    int (*stream)(pcilib_context_t *ctx, pcilib_event_callback_t callback, void *user);
126 by Suren A. Chilingaryan
multithread preprocessing of ipecamera frames and code reorganization
75
    int (*next_event)(pcilib_context_t *ctx, pcilib_timeout_t timeout, pcilib_event_id_t *evid, size_t info_size, pcilib_event_info_t *info);
117 by Suren A. Chilingaryan
new event architecture, first trial
76
126 by Suren A. Chilingaryan
multithread preprocessing of ipecamera frames and code reorganization
77
    int (*get_data)(pcilib_context_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t arg_size, void *arg, size_t *size, void **data);
78
    int (*return_data)(pcilib_context_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, void *data);
236 by Suren A. Chilingaryan
Big redign of model structures
79
} pcilib_event_api_description_t;
117 by Suren A. Chilingaryan
new event architecture, first trial
80
277 by Suren A. Chilingaryan
Keep C++ compilers happy
81
#ifdef __cplusplus
82
extern "C" {
83
#endif
117 by Suren A. Chilingaryan
new event architecture, first trial
84
85
int pcilib_init_event_engine(pcilib_t *ctx);
47 by Suren A. Chilingaryan
Support FIFO reading/writting, code restructurization, few fixes
86
324 by Suren A. Chilingaryan
Documentation update
87
/*
88
 * Configures maximal number of preprocessing threads. Actual amount of threads 
89
 * may be bigger. For instance, additionaly a real-time reader thread will be 
90
 * executed for most of hardware
91
 */
92
int pcilib_configure_preprocessing_threads(pcilib_t *ctx, size_t max_threads);
236 by Suren A. Chilingaryan
Big redign of model structures
93
277 by Suren A. Chilingaryan
Keep C++ compilers happy
94
#ifdef __cplusplus
95
}
96
#endif
97
47 by Suren A. Chilingaryan
Support FIFO reading/writting, code restructurization, few fixes
98
#endif /* _PCILIB_EVENT_H */