]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/include/rpp/din.h
Make the RPP layer thread safe
[pes-rpp/rpp-lib.git] / rpp / include / rpp / din.h
index 5e36bfc4e2792187bbcdecd0eb6bae84444e6bac..7c6a81bcb5c51992a10c8f09d9e9b8ad39bfec19 100644 (file)
@@ -17,6 +17,8 @@
  *
  * Call this method before using this module.
  *
+ * This function is not thread safe. Do not call it from multiple threads.
+ *
  * @return SUCCESS if initialization successful.\n
  *         FAILURE if module already initialized.
  */
@@ -27,6 +29,8 @@ int8_t rpp_din_init();
  * Configure voltage reference levels for digital inputs using variable
  * reference threshold.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @param[in] refA      [0-4095] value to set (DAC is 12bits) the reference
  *                      voltage A (pins 12-15).
  * @param[in] refB      [0-4095] value to set (DAC is 12bits) the reference
@@ -43,6 +47,8 @@ int8_t rpp_din_ref(uint16_t refA, uint16_t refB);
  *
  * Call rpp_din_update() to commit configuration changes to the hardware.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @param[in] pin       The pin number to setup [0-15].
  * @param[in] pull_up   TRUE to setup pin as pull-up (a switch-to-ground device
  *                      is connected) or FALSE to setup as pull-down
@@ -67,6 +73,8 @@ int8_t rpp_din_setup(uint8_t pin, boolean_t pull_up,
  *
  * Call rpp_din_update() to update cached values.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @param[in] pin       The pin number to read [0-15].
  *
  * @return RPP_CLOSED or RPP_OPEN if successful.\n
@@ -83,6 +91,8 @@ int8_t rpp_din_get(uint8_t pin);
  * Inputs [8-11] use programmable threshold B and [12-15] use
  * programmable threshold A.\n
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @see rpp_din_ref().
  *
  * @param[in] pin       The pin number to read [8-15].
@@ -99,6 +109,8 @@ int8_t rpp_din_get_tr(uint8_t pin);
  *
  * Call rpp_din_update() to update cached values.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @param[in] pin       The pin number to read [0-15].
  *
  * @return HIGH or LOW if successful.\n
@@ -112,6 +124,8 @@ int8_t rpp_din_diag(uint8_t pin);
  * Read and update cached values and diagnostic values of all pins. Also commit
  * configuration changes.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @return SUCCESS when transaction was successful.\n
  *         FAILURE if transaction could not be confirmed.
  */