spi.c: moved struct _spi declaration into mraa_internal_types.h
authorAlex Tereschenko <alext.mkrs@gmail.com>
Sun, 14 Jun 2015 14:34:15 +0000 (16:34 +0200)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Mon, 15 Jun 2015 08:55:54 +0000 (09:55 +0100)
The declaration seems to be misplaced compared to all other similar structs.
It's also a prerequisite for introducing the _replace hook for spi_lsbmode(),
per issue #178.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
include/mraa_internal_types.h
src/spi/spi.c

index 5eb5804..70b212d 100644 (file)
@@ -64,6 +64,19 @@ struct _i2c {
 };
 
 /**
+ * A structure representing the SPI device
+ */
+struct _spi {
+    /*@{*/
+    int devfd;          /**< File descriptor to SPI Device */
+    uint32_t mode;      /**< Spi mode see spidev.h */
+    int clock;          /**< clock to run transactions at */
+    mraa_boolean_t lsb; /**< least significant bit mode */
+    unsigned int bpw;   /**< Bits per word */
+    /*@}*/
+};
+
+/**
  * A structure representing a PWM pin
  */
 struct _pwm {
index c478e7f..7af38d9 100644 (file)
 #define MAX_SIZE 64
 #define SPI_MAX_LENGTH 4096
 
-/**
- * A structure representing the SPI device
- */
-struct _spi {
-    /*@{*/
-    int devfd;          /**< File descriptor to SPI Device */
-    uint32_t mode;      /**< Spi mode see spidev.h */
-    int clock;          /**< clock to run transactions at */
-    mraa_boolean_t lsb; /**< least significant bit mode */
-    unsigned int bpw;   /**< Bits per word */
-    /*@}*/
-};
-
 mraa_spi_context
 mraa_spi_init(int bus)
 {