summaryrefslogtreecommitdiffstats
path: root/events.h
blob: 2c19713bb010e5dfd148e3c8abeaf727a2c93c3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef _PCIDEV_EVENTS_H
#define _PCIDEV_EVENTS_H

#include <stdio.h>

#include <pcilib.h>

#include "pcidev.h"

pcilib_context_t *pcidev_init(pcilib_t *pcilib);
void pcidev_free(pcilib_context_t *ctx);

pcilib_dma_context_t *pcidev_init_dma(pcilib_context_t *ctx);

int pcidev_reset(pcilib_context_t *ctx);
int pcidev_start(pcilib_context_t *ctx, pcilib_event_t event_mask, pcilib_event_flags_t flags);
int pcidev_stop(pcilib_context_t *ctx, pcilib_event_flags_t flags);
int pcidev_trigger(pcilib_context_t *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data);
int pcidev_stream(pcilib_context_t *vctx, pcilib_event_callback_t callback, void *user);
//int pcidev_next_event(pcilib_context_t *vctx, pcilib_timeout_t timeout, pcilib_event_id_t *evid, size_t info_size, pcilib_event_info_t *info);

int pcidev_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 **buf);
int pcidev_return_data(pcilib_context_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, void *data);


# ifdef _PCIDEV_MODEL_C
static const pcilib_event_description_t pcidev_events[] = {
    {PCILIB_EVENT0, "new_event", ""},
    {0, NULL, NULL}
};

static const pcilib_event_data_type_description_t pcidev_data_types[] = {
    {PCIDEV_RAW_DATA,		PCILIB_EVENT0, "raw", 	"raw data from device" },
    {PCIDEV_STANDARD_DATA,	PCILIB_EVENT0, "std",	"processed data" },
    {0, 0, NULL, NULL}
};


pcilib_event_api_description_t pcidev_event_api = {
    PCIDEV_VERSION,

    pcidev_init,
    pcidev_free,

    pcidev_init_dma,

    pcidev_reset,
    pcidev_start,
    pcidev_stop,
    pcidev_trigger,

    pcidev_stream,
    NULL,
    pcidev_get_data,
    pcidev_return_data
};
# endif /* _PCIDEV_MODEL_C */

#endif /* _PCIDEV_EVENTS_H */