summaryrefslogtreecommitdiffstats
path: root/events.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2023-05-25 23:10:58 +0200
committerSuren A. Chilingaryan <csa@suren.me>2023-05-25 23:10:58 +0200
commitd852b637800b0f91b9c921cda17311bc203939e5 (patch)
treecda6aa7900621002302da399aab9d66c8d568574 /events.h
parent6f4af841f6fdd099b97d071ae64c8be60f809456 (diff)
downloadpcidev-d852b637800b0f91b9c921cda17311bc203939e5.tar.gz
pcidev-d852b637800b0f91b9c921cda17311bc203939e5.tar.bz2
pcidev-d852b637800b0f91b9c921cda17311bc203939e5.tar.xz
pcidev-d852b637800b0f91b9c921cda17311bc203939e5.zip
Move event api definition to events.h
Diffstat (limited to 'events.h')
-rw-r--r--events.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/events.h b/events.h
index 5d09d74..2c19713 100644
--- a/events.h
+++ b/events.h
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <pcilib.h>
+
#include "pcidev.h"
pcilib_context_t *pcidev_init(pcilib_t *pcilib);
@@ -21,4 +22,38 @@ int pcidev_stream(pcilib_context_t *vctx, pcilib_event_callback_t callback, void
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 */