summaryrefslogtreecommitdiffstats
path: root/pcilib/pcilib.h
diff options
context:
space:
mode:
Diffstat (limited to 'pcilib/pcilib.h')
-rw-r--r--pcilib/pcilib.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/pcilib/pcilib.h b/pcilib/pcilib.h
index c32d1fb..8ab8e9e 100644
--- a/pcilib/pcilib.h
+++ b/pcilib/pcilib.h
@@ -43,7 +43,8 @@ typedef enum {
typedef enum {
PCILIB_ACCESS_R = 1, /**< getting property is allowed */
PCILIB_ACCESS_W = 2, /**< setting property is allowed */
- PCILIB_ACCESS_RW = 3
+ PCILIB_ACCESS_RW = 3,
+ PCILIB_ACCESS_INCONSISTENT = 0x10000 /**< inconsistent access, one will not read that one has written */
} pcilib_access_mode_t;
typedef enum {
@@ -54,7 +55,7 @@ typedef enum {
PCILIB_REGISTER_RW1C = 5,
PCILIB_REGISTER_W1I = 8, /**< writting 1 inversts the bit, writting 0 keeps the value */
PCILIB_REGISTER_RW1I = 9,
- PCILIB_REGISTER_INCONSISTENT = 0x1000 /**< dont check register value after set*/
+ PCILIB_REGISTER_INCONSISTENT = 0x10000 /**< inconsistent register, writting and reading does not match */
} pcilib_register_mode_t;
typedef enum {
@@ -1257,6 +1258,16 @@ int pcilib_set_value_from_register_value(pcilib_t *ctx, pcilib_value_t *val, pci
int pcilib_set_value_from_static_string(pcilib_t *ctx, pcilib_value_t *val, const char *str);
/**
+ * Initializes the polymorphic value from the string. The string is copied.
+ * If `val` already contains the value, cleans it first. Therefore, before first usage the value should be always initialized to 0.
+ * @param[in] ctx - pcilib context
+ * @param[in,out] val - initialized polymorphic value
+ * @param[in] str - initializer
+ * @return - 0 on success or memory error
+ */
+int pcilib_set_value_from_string(pcilib_t *ctx, pcilib_value_t *value, const char *str);
+
+/**
* Get the floating point value from the polymorphic type. May inmply impliced type conversion,
* for isntance parsing the number from the string. Will return 0. and report an error if
* conversion failed.