bzr branch
http://darksoft.org/webbzr/alps/pcitool
315
by Suren A. Chilingaryan
Support properties of arbitrary type |
1 |
#ifndef _PCILIB_PROPERTY_H
|
2 |
#define _PCILIB_PROPERTY_H
|
|
3 |
||
4 |
#ifdef __cplusplus
|
|
5 |
extern "C" { |
|
6 |
#endif
|
|
7 |
/**
|
|
324
by Suren A. Chilingaryan
Documentation update |
8 |
* This is an internal function used to add property views for all model registers. It is automatically
|
315
by Suren A. Chilingaryan
Support properties of arbitrary type |
9 |
* called from pcilib_add_registers and should not be called by the users. On error no new views are
|
10 |
* initalized.
|
|
324
by Suren A. Chilingaryan
Documentation update |
11 |
* @param[in,out] ctx - pcilib context
|
12 |
* @param[in] n - number of views to initialize.
|
|
13 |
* @param[in] banks - array containing a bank id for each of the considered registers
|
|
14 |
* @param[in] registers - register descriptions
|
|
15 |
* @return - error or 0 on success
|
|
315
by Suren A. Chilingaryan
Support properties of arbitrary type |
16 |
*/
|
321
by Suren A. Chilingaryan
Support computed (property-based) registers |
17 |
int pcilib_add_properties_from_registers(pcilib_t *ctx, size_t n, const pcilib_register_bank_t *banks, const pcilib_register_description_t *registers); |
18 |
||
19 |
||
20 |
/**
|
|
324
by Suren A. Chilingaryan
Documentation update |
21 |
* This is an internal function used to add registers providing alternative access to values of the properties.
|
321
by Suren A. Chilingaryan
Support computed (property-based) registers |
22 |
* To reduce number of required interfaces, some of the property views may be also mapped into the
|
23 |
* model as registers. The client application, then, is able to use either register or property APIs
|
|
24 |
* to access them. This is an internal function which processes the supplied views, finds which views
|
|
25 |
* have to be mapped in the register space, and finally pushes corresponding registers into the model.
|
|
26 |
* The function is automatically called from pcilib_add_views and should never be called by the user.
|
|
27 |
* On error no new registers are added.
|
|
324
by Suren A. Chilingaryan
Documentation update |
28 |
* @param[in,out] ctx - pcilib context
|
29 |
* @param[in] n - number of views to analyze.
|
|
30 |
* @param[in] view_ctx - views to analyze
|
|
31 |
* @param[in] view - array of pointers to corresponding view descriptions
|
|
32 |
* @return - error or 0 on success
|
|
321
by Suren A. Chilingaryan
Support computed (property-based) registers |
33 |
*/
|
34 |
int pcilib_add_registers_from_properties(pcilib_t *ctx, size_t n, pcilib_view_context_t* const *view_ctx, pcilib_view_description_t* const *view); |
|
315
by Suren A. Chilingaryan
Support properties of arbitrary type |
35 |
|
36 |
#ifdef __cplusplus
|
|
37 |
}
|
|
38 |
#endif
|
|
39 |
||
40 |
#endif /* _PCILIB_PROPERTY_H */ |
|
41 |
||
42 |
||
43 |
||
44 |
||
45 |
||
46 |
// free'd by user. Do we need it?
|
|
47 |