41
41
} pcilib_endianess_t;
44
PCILIB_ACCESS_R = 1, /**< getting property is allowed */
45
PCILIB_ACCESS_W = 2, /**< setting property is allowed */
47
} pcilib_access_mode_t;
44
50
PCILIB_TYPE_INVALID = 0, /**< uninitialized */
45
51
PCILIB_TYPE_DEFAULT = 0, /**< default type */
46
52
PCILIB_TYPE_STRING = 1, /**< char* */
74
80
} pcilib_dma_flags_t;
77
PCILIB_STREAMING_STOP = 0, /**< stop streaming */
78
PCILIB_STREAMING_CONTINUE = 1, /**< wait the default DMA timeout for a new data */
79
PCILIB_STREAMING_WAIT = 2, /**< wait the specified timeout for a new data */
80
PCILIB_STREAMING_CHECK = 3, /**< do not wait for the data, bail out imideatly if no data ready */
81
PCILIB_STREAMING_FAIL = 4, /**< fail if data is not available on timeout */
82
PCILIB_STREAMING_REQ_FRAGMENT = 5, /**< only fragment of a packet is read, wait for next fragment and fail if no data during DMA timeout */
83
PCILIB_STREAMING_REQ_PACKET = 6, /**< wait for next packet and fail if no data during the specified timeout */
84
PCILIB_STREAMING_TIMEOUT_MASK = 3 /**< mask specifying all timeout modes */
83
PCILIB_STREAMING_STOP = 0, /**< stop streaming */
84
PCILIB_STREAMING_CONTINUE = 1, /**< wait the default DMA timeout for a new data */
85
PCILIB_STREAMING_WAIT = 2, /**< wait the specified timeout for a new data */
86
PCILIB_STREAMING_CHECK = 3, /**< do not wait for the data, bail out imideatly if no data ready */
87
PCILIB_STREAMING_FAIL = 4, /**< fail if data is not available on timeout */
88
PCILIB_STREAMING_REQ_FRAGMENT = 5, /**< only fragment of a packet is read, wait for next fragment and fail if no data during DMA timeout */
89
PCILIB_STREAMING_REQ_PACKET = 6, /**< wait for next packet and fail if no data during the specified timeout */
90
PCILIB_STREAMING_TIMEOUT_MASK = 3 /**< mask specifying all timeout modes */
85
91
} pcilib_streaming_action_t;
104
110
pcilib_event_info_flags_t flags; /**< flags */
105
111
} pcilib_event_info_t;
114
PCILIB_LIST_FLAGS_DEFAULT = 0,
115
PCILIB_LIST_FLAG_CHILDS = 1 /**< Request all sub-elements or indicated that sub-elements are available */
116
} pcilib_list_flags_t;
108
pcilib_value_type_t type;
119
pcilib_value_type_t type; /**< Current data type */
120
const char *unit; /**< Units (if known) */
121
const char *format; /**< requested printf format (may enforce using output in hex form) */
124
long ival; /**< The value if type = PCILIB_TYPE_LONG */
125
double fval; /**< The value if type = PCILIB_TYPE_DOUBLE */
126
const char *sval; /**< The value if type = PCILIB_TYPE_STRING, the pointer may point to static location or reference actual string in str or data */
118
129
// This is a private part
130
size_t size; /**< Size of the data */
131
void *data; /**< Arbitrary data, for instance actual string referenced by the sval */
132
char str[16]; /**< Used for shorter strings converted from integer/float types */
122
133
} pcilib_value_t;
136
const char *name; /**< Name of the property view */
137
const char *path; /**< Full path to the property */
138
const char *description; /**< Short description */
139
pcilib_value_type_t type; /**< The default data type or PCILIB_TYPE_INVALID if directory */
140
pcilib_access_mode_t mode; /**< Specifies if the view is read/write-only */
141
pcilib_list_flags_t flags; /**< Indicates if have sub-folders, etc. */
142
const char *unit; /**< Returned unit (if any) */
143
} pcilib_property_info_t;
125
146
#define PCILIB_BAR_DETECT ((pcilib_bar_t)-1)
126
147
#define PCILIB_BAR_INVALID ((pcilib_bar_t)-1)
218
239
int pcilib_write_register_by_id(pcilib_t *ctx, pcilib_register_t reg, pcilib_register_value_t value);
219
240
int pcilib_read_register(pcilib_t *ctx, const char *bank, const char *regname, pcilib_register_value_t *value);
220
241
int pcilib_write_register(pcilib_t *ctx, const char *bank, const char *regname, pcilib_register_value_t value);
242
int pcilib_read_register_view(pcilib_t *ctx, const char *bank, const char *regname, const char *unit, pcilib_value_t *value);
243
int pcilib_write_register_view(pcilib_t *ctx, const char *bank, const char *regname, const char *unit, const pcilib_value_t *value);
222
245
void pcilib_clean_value(pcilib_t *ctx, pcilib_value_t *val);
223
246
int pcilib_copy_value(pcilib_t *ctx, pcilib_value_t *dst, const pcilib_value_t *src);
228
251
double pcilib_get_value_as_float(pcilib_t *ctx, const pcilib_value_t *val, int *err);
229
252
long pcilib_get_value_as_int(pcilib_t *ctx, const pcilib_value_t *val, int *err);
230
253
pcilib_register_value_t pcilib_get_value_as_register_value(pcilib_t *ctx, const pcilib_value_t *val, int *err);
232
254
int pcilib_convert_value_unit(pcilib_t *ctx, pcilib_value_t *val, const char *unit_name);
233
255
int pcilib_convert_value_type(pcilib_t *ctx, pcilib_value_t *val, pcilib_value_type_t type);
235
int pcilib_read_register_view(pcilib_t *ctx, const char *bank, const char *regname, const char *unit, pcilib_value_t *value);
236
int pcilib_write_register_view(pcilib_t *ctx, const char *bank, const char *regname, const char *unit, const pcilib_value_t *value);
257
pcilib_property_info_t *pcilib_get_property_list(pcilib_t *ctx, const char *branch, pcilib_list_flags_t flags);
258
void pcilib_free_property_info(pcilib_t *ctx, pcilib_property_info_t *info);
259
int pcilib_get_property(pcilib_t *ctx, const char *prop, pcilib_value_t *val);
260
int pcilib_set_property(pcilib_t *ctx, const char *prop, const pcilib_value_t *val);
238
263
int pcilib_reset(pcilib_t *ctx);
239
264
int pcilib_trigger(pcilib_t *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data);