/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to event.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-04-27 00:28:57 UTC
  • Revision ID: csa@suren.me-20150427002857-82fk6r3e8rfgy4wr
First stand-alone ipecamera implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _PCILIB_EVENT_H
2
 
#define _PCILIB_EVENT_H
3
 
 
4
 
#include "pcilib.h"
5
 
 
6
 
 
7
 
/*
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.
17
 
 */
18
 
 
19
 
struct pcilib_event_api_description_s {
20
 
    const char *title;
21
 
    
22
 
    pcilib_context_t *(*init)(pcilib_t *ctx);
23
 
    void (*free)(pcilib_context_t *ctx);
24
 
 
25
 
    pcilib_dma_context_t *(*init_dma)(pcilib_context_t *ctx);
26
 
 
27
 
    int (*reset)(pcilib_context_t *ctx);
28
 
 
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);
32
 
    
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);
35
 
 
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);
38
 
};
39
 
 
40
 
 
41
 
typedef struct {
42
 
    size_t max_events;
43
 
    pcilib_timeout_t duration;
44
 
} pcilib_autostop_parameters_t;
45
 
 
46
 
typedef struct {
47
 
    pcilib_event_rawdata_callback_t callback;
48
 
    void *user;
49
 
} pcilib_rawdata_parameters_t;
50
 
 
51
 
typedef struct {
52
 
    size_t max_threads;
53
 
} pcilib_parallel_parameters_t;
54
 
 
55
 
typedef struct {
56
 
    pcilib_autostop_parameters_t autostop;
57
 
    pcilib_rawdata_parameters_t rawdata;
58
 
    pcilib_parallel_parameters_t parallel;
59
 
} pcilib_event_parameters_t;
60
 
 
61
 
struct pcilib_event_context_s {
62
 
    pcilib_event_parameters_t params;
63
 
    pcilib_t *pcilib;
64
 
};
65
 
 
66
 
 
67
 
int pcilib_init_event_engine(pcilib_t *ctx);
68
 
 
69
 
#endif /* _PCILIB_EVENT_H */