8 #endif /* __cplusplus */
15 unsigned int *clkfreqs
;
17 unsigned int *ev_lengths
;
19 int ev_tstamp_supported
;
23 extern const char *libsis33_version
;
25 typedef struct sis33lib sis33_t
; /**< opaque libsis33 handle struct */
27 sis33_t
*sis33_open(int index
);
28 int sis33_close(sis33_t
*device
);
30 int sis33_loglevel(int loglevel
);
31 int sis33_errno(void);
32 char *sis33_strerror(int errnum
);
33 void sis33_perror(const char *string
);
35 int sis33_acq(sis33_t
*device
, unsigned int segment
, unsigned int nr_events
, unsigned int ev_length
);
36 int sis33_acq_wait(sis33_t
*device
, unsigned int segment
, unsigned int nr_events
, unsigned int ev_length
);
37 int sis33_acq_timeout(sis33_t
*device
, unsigned int segment
, unsigned int nr_events
, unsigned int ev_length
, const struct timespec
*timeout
);
38 int sis33_acq_cancel(sis33_t
*device
);
40 struct sis33_acq
*sis33_acqs_zalloc(unsigned int nr_events
, unsigned int ev_length
);
41 void sis33_acqs_free(struct sis33_acq
*acqs
, unsigned int n_acqs
);
43 int sis33_fetch(sis33_t
*device
, unsigned int segment
, unsigned int channel
,
44 struct sis33_acq
*acqs
, unsigned int n_acqs
, struct timeval
*endtime
);
45 int sis33_fetch_wait(sis33_t
*device
, unsigned int segment
, unsigned int channel
,
46 struct sis33_acq
*acqs
, unsigned int n_acqs
, struct timeval
*endtime
);
47 int sis33_fetch_timeout(sis33_t
*device
, unsigned int segment
, unsigned int channel
,
48 struct sis33_acq
*acqs
, unsigned int n_acqs
,
49 struct timeval
*endtime
, struct timespec
*timeout
);
51 int sis33_set_clock_source(sis33_t
*device
, enum sis33_clksrc clksrc
);
52 int sis33_get_clock_source(sis33_t
*device
, enum sis33_clksrc
*clksrc
);
53 int sis33_get_nr_clock_frequencies(sis33_t
*device
);
54 int sis33_get_available_clock_frequencies(sis33_t
*device
, unsigned int *clkfreqs
, int n
);
55 unsigned int sis33_round_clock_frequency(sis33_t
*device
, unsigned int clkfreq
, enum sis33_round round
);
56 int sis33_set_clock_frequency(sis33_t
*device
, unsigned int hz
);
57 int sis33_get_clock_frequency(sis33_t
*device
, unsigned int *hz
);
59 int sis33_get_nr_event_lengths(sis33_t
*device
);
60 int sis33_get_available_event_lengths(sis33_t
*device
, unsigned int *lengths
, int n
);
61 unsigned int sis33_round_event_length(sis33_t
*device
, unsigned int ev_length
, enum sis33_round round
);
63 int sis33_trigger(sis33_t
*device
, enum sis33_trigger trigger
);
64 int sis33_set_enable_external_trigger(sis33_t
*device
, int value
);
65 int sis33_get_enable_external_trigger(sis33_t
*device
, int *value
);
67 int sis33_set_start_auto(sis33_t
*device
, int value
);
68 int sis33_get_start_auto(sis33_t
*device
, int *value
);
69 int sis33_set_start_delay(sis33_t
*device
, int delay
);
70 int sis33_get_start_delay(sis33_t
*device
, int *delay
);
72 int sis33_set_stop_auto(sis33_t
*device
, int value
);
73 int sis33_get_stop_auto(sis33_t
*device
, int *value
);
74 int sis33_set_stop_delay(sis33_t
*device
, int delay
);
75 int sis33_get_stop_delay(sis33_t
*device
, int *delay
);
77 int sis33_get_nr_channels(sis33_t
*device
);
78 int sis33_channel_set_offset(sis33_t
*device
, int channel_nr
, unsigned int offset
);
79 int sis33_channel_set_offset_all(sis33_t
*device
, unsigned int offset
);
80 int sis33_channel_get_offset(sis33_t
*device
, int channel_nr
, unsigned int *offset
);
82 int sis33_set_nr_segments(sis33_t
*device
, unsigned int segments
);
83 int sis33_get_nr_segments(sis33_t
*device
, unsigned int *segments
);
84 int sis33_get_max_nr_segments(sis33_t
*device
, unsigned int *segments
);
85 int sis33_get_min_nr_segments(sis33_t
*device
, unsigned int *segments
);
87 int sis33_get_max_nr_events(sis33_t
*device
, unsigned int *events
);
88 int sis33_get_nr_bits(sis33_t
*device
);
90 int sis33_event_timestamping_is_supported(sis33_t
*device
);
91 int sis33_get_max_event_timestamping_divider(sis33_t
*device
, unsigned int *max
);
92 int sis33_get_event_timestamping_divider(sis33_t
*device
, unsigned int *divider
);
93 int sis33_set_event_timestamping_divider(sis33_t
*device
, unsigned int divider
);
94 int sis33_get_max_event_timestamping_clock_ticks(sis33_t
*device
, unsigned int *log2
);
98 #endif /* __cplusplus */
100 #endif /* _SIS33_LIB_H_ */