diff options
author | zilio nicolas <nicolas.zilio@kit.edu> | 2015-09-10 16:09:02 +0200 |
---|---|---|
committer | zilio nicolas <nicolas.zilio@kit.edu> | 2015-09-10 16:09:02 +0200 |
commit | 9bcd0b7b98dfb10d054913dad34313391f6029f2 (patch) | |
tree | 5b9369469a09080e0ab3e9ec698943e0b94d3dd5 /pcilib/views.h | |
parent | df677a8fdc70082fe27028ca17c3c643f4d79dd1 (diff) | |
download | pcitool-9bcd0b7b98dfb10d054913dad34313391f6029f2.tar.gz pcitool-9bcd0b7b98dfb10d054913dad34313391f6029f2.tar.bz2 pcitool-9bcd0b7b98dfb10d054913dad34313391f6029f2.tar.xz pcitool-9bcd0b7b98dfb10d054913dad34313391f6029f2.zip |
compilation ok
Diffstat (limited to 'pcilib/views.h')
-rw-r--r-- | pcilib/views.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/pcilib/views.h b/pcilib/views.h new file mode 100644 index 0000000..bdae9f4 --- /dev/null +++ b/pcilib/views.h @@ -0,0 +1,39 @@ +#ifndef _PCILIB_VIEWS_H +#define _PCILIB_VIEWS_H + +#include "pcilib.h" + +typedef struct pcilib_view_enum_s pcilib_view_enum_t; + +typedef struct pcilib_view_formula_s pcilib_view_formula_t; + +/** + * new type to define an enum view + */ +struct pcilib_view_enum_s { + const char *name; /**<corresponding string to value*/ + pcilib_register_value_t value, min, max; +}; + + +/** + * new type to define a formula view + */ +struct pcilib_view_formula_s { + const char *name; /**<name of the view*/ + const char *read_formula; /**< formula to parse to read from a register*/ + const char *write_formula; /**<formula to parse to write to a register*/ + // **see it later** const char *unit; (?) +}; + +/** + * function to read a register using a view + */ +int pcilib_read_view(pcilib_t *ctx, const char *bank, const char *regname, const char *view/*, const char *unit*/, size_t value_size, void *value); + +/** + * function to write to a register using a view + */ +int pcilib_write_view(pcilib_t *ctx, const char *bank, const char *regname, const char *view/*, const char *unit*/, size_t value_size, void *value); + +#endif |