1
#ifndef _PCILIB_EVENT_H
2
#define _PCILIB_EVENT_H
8
* get_data: This call is used by get_data and copy_data functions of public
9
* interface. When copy_data is the caller, the data parameter will be passed.
10
* Therefore, depending on data the parameter, the function should behave
11
* diferently. If get get_data function is used (buf == NULL), the caller is
12
* expected to call return_data afterwards. Otherwise, if buf != NULL and
13
* copy_data is used, the return call will not be executed.
14
* Still, the get_data function is not obliged to return the data in the
15
* passed buf, but a reference to the staticaly allocated memory may be
16
* returned instead. The copy can be managed by the envelope function.
19
struct pcilib_event_api_description_s {
22
pcilib_context_t *(*init)(pcilib_t *ctx);
23
void (*free)(pcilib_context_t *ctx);
25
pcilib_dma_context_t *(*init_dma)(pcilib_context_t *ctx);
27
int (*reset)(pcilib_context_t *ctx);
29
int (*start)(pcilib_context_t *ctx, pcilib_event_t event_mask, pcilib_event_flags_t flags);
30
int (*stop)(pcilib_context_t *ctx, pcilib_event_flags_t flags);
31
int (*trigger)(pcilib_context_t *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data);
33
int (*stream)(pcilib_context_t *ctx, pcilib_event_callback_t callback, void *user);
34
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);
36
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);
37
int (*return_data)(pcilib_context_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, void *data);
43
pcilib_timeout_t duration;
44
} pcilib_autostop_parameters_t;
47
pcilib_event_rawdata_callback_t callback;
49
} pcilib_rawdata_parameters_t;
53
} pcilib_parallel_parameters_t;
56
pcilib_autostop_parameters_t autostop;
57
pcilib_rawdata_parameters_t rawdata;
58
pcilib_parallel_parameters_t parallel;
59
} pcilib_event_parameters_t;
61
struct pcilib_event_context_s {
62
pcilib_event_parameters_t params;
67
int pcilib_init_event_engine(pcilib_t *ctx);
69
#endif /* _PCILIB_EVENT_H */