]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/include/rpp/gio.h
Make the RPP layer thread safe
[pes-rpp/rpp-lib.git] / rpp / include / rpp / gio.h
index 0ffc8426847abb7b6aafcc00494a5cd886fc7d50..9b00364089276f655a40652d6c4dc2eef0cc8fa1 100644 (file)
@@ -31,6 +31,9 @@
  * @param[in] init_ports Specifies which ports to initialize.
  * RPP_GIO_PORT_ALL causes all ports to be initialized.
  *
+ * This function is not thread safe. Do not call it from multiple
+ * threads.
+ *
  * @return SUCCESS if successful, FAILURE otherwise.
  */
 int8_t rpp_gio_init(uint32_t init_ports);
@@ -38,6 +41,8 @@ int8_t rpp_gio_init(uint32_t init_ports);
 /**
  * Sets GIO output pin to a value.
  *
+ * The function is thread safe.
+ *
  * @param pin Pin to set
  * @param value Value to the pin to.
  *
@@ -48,6 +53,8 @@ int8_t rpp_gio_set(enum pin_name pin, boolean_t value);
 /**
  * Reads the value of a GIO pin.
  *
+ * The function is thread safe.
+ *
  * @param pin Pin to read.
  *
  * @return Pin value (0 or 1) in case of success, FAILURE otherwise.
@@ -70,6 +77,8 @@ enum rpp_gio_io {
 /**
  * Configure GIO pin.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
+ *
  * @param pin Pin to configure
  * @param io Configure the pin as input or output.
  * @param in_mode Input settings. Ignored when pin is configured as