simple-api: reposition the prototypes in the public header
authorBartosz Golaszewski <bartekgola@gmail.com>
Sat, 1 Jul 2017 09:14:52 +0000 (11:14 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Thu, 6 Jul 2017 09:11:36 +0000 (11:11 +0200)
Move the 'multiple' variants below the single value ones.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
include/gpiod.h

index d2e62042835b42266187ff010b544d29524f1e88..581900255e91903fed123bb203744850efdd7bb5 100644 (file)
@@ -60,6 +60,17 @@ struct gpiod_chip_iter;
  * Simple high-level routines for straightforward GPIO manipulation.
  */
 
+/**
+ * @brief Read current value from a single GPIO line.
+ * @param consumer Name of the consumer.
+ * @param device Name, path or number of the gpiochip.
+ * @param offset GPIO line offset on the chip.
+ * @param active_low The active state of this line - true if low.
+ * @return 0 or 1 (GPIO value) if the operation succeeds, -1 on error.
+ */
+int gpiod_simple_get_value(const char *consumer, const char *device,
+                          unsigned int offset, bool active_low) GPIOD_API;
+
 /**
  * @brief Read current values from a set of GPIO lines.
  * @param consumer Name of the consumer.
@@ -76,20 +87,26 @@ int gpiod_simple_get_value_multiple(const char *consumer, const char *device,
                                    bool active_low) GPIOD_API;
 
 /**
- * @brief Read current value from a single GPIO line.
+ * @brief Simple set value callback signature.
+ */
+typedef void (*gpiod_set_value_cb)(void *);
+
+/**
+ * @brief Set value of a single GPIO line.
  * @param consumer Name of the consumer.
  * @param device Name, path or number of the gpiochip.
  * @param offset GPIO line offset on the chip.
+ * @param value New value.
  * @param active_low The active state of this line - true if low.
- * @return 0 or 1 (GPIO value) if the operation succeeds, -1 on error.
- */
-int gpiod_simple_get_value(const char *consumer, const char *device,
-                          unsigned int offset, bool active_low) GPIOD_API;
-
-/**
- * @brief Simple set value callback signature.
+ * @param cb Callback function that will be called right after the value is
+ *        set. Users can use this, for example, to pause the execution after
+ *        toggling a GPIO.
+ * @param data User data that will be passed to the callback function.
+ * @return 0 if the operation succeeds, -1 on error.
  */
-typedef void (*gpiod_set_value_cb)(void *);
+int gpiod_simple_set_value(const char *consumer, const char *device,
+                          unsigned int offset, int value, bool active_low,
+                          gpiod_set_value_cb cb, void *data) GPIOD_API;
 
 /**
  * @brief Set values of a set of a set of GPIO lines.
@@ -110,23 +127,6 @@ int gpiod_simple_set_value_multiple(const char *consumer, const char *device,
                                    bool active_low, gpiod_set_value_cb cb,
                                    void *data) GPIOD_API;
 
-/**
- * @brief Set value of a single GPIO line.
- * @param consumer Name of the consumer.
- * @param device Name, path or number of the gpiochip.
- * @param offset GPIO line offset on the chip.
- * @param value New value.
- * @param active_low The active state of this line - true if low.
- * @param cb Callback function that will be called right after the value is
- *        set. Users can use this, for example, to pause the execution after
- *        toggling a GPIO.
- * @param data User data that will be passed to the callback function.
- * @return 0 if the operation succeeds, -1 on error.
- */
-int gpiod_simple_set_value(const char *consumer, const char *device,
-                          unsigned int offset, int value, bool active_low,
-                          gpiod_set_value_cb cb, void *data) GPIOD_API;
-
 /**
  * @brief Event types that can be passed to the simple event callback.
  */