]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/include/rpp/dac.h
Make the RPP layer thread safe
[pes-rpp/rpp-lib.git] / rpp / include / rpp / dac.h
index a8dd064736733b74e4a93f80dcb9626a066404aa..adcffb85c7bac5a3b918ee7407f482cf982817bc 100644 (file)
@@ -26,6 +26,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.
  */
@@ -37,6 +39,8 @@ int8_t rpp_dac_init();
  *
  * Call rpp_dac_update() to commit setup changes to real hardware.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @param[in] pin       The pin number to setup [1-4].
  * @param[in] enabled   TRUE to enable pin or FALSE to disable it.
  *
@@ -51,6 +55,8 @@ int8_t rpp_dac_setup(uint8_t pin, boolean_t enabled);
  *
  * Call rpp_dac_update() to flush cached values to real hardware.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @param[in] pin       The pin number to set [1-4].
  * @param[in] val       The value to be set [0-4095] (DAC is 12bit resolution).
  *
@@ -71,6 +77,8 @@ int8_t rpp_dac_set(uint8_t pin, uint16_t val);
  *
  * Helper function that calculates DAC value given a voltage in millivolts.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @param[in] pin       The pin number to set [1-4].
  * @param[in] mv        Voltage level in mV to be set on specified pin [0-12000].
  *
@@ -84,6 +92,8 @@ int8_t rpp_dac_set_voltage(uint8_t pin, uint16_t mv);
 /**
  * Flush cached output values and configuration changes.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @bug This function should be called only after the FreeRTOS Scheduler has
  * started (which implies from a FreeRTOS Task). If called before starting the
  * scheduler, like for library initialization, or application DAC