Browse Source

adis16448: updated header and example with new tags

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Mihai Tudor Panu 9 years ago
parent
commit
02147dfe4b
2 changed files with 39 additions and 19 deletions
  1. 18
    17
      examples/c++/adis16448.cxx
  2. 21
    2
      src/adis16448/adis16448.h

+ 18
- 17
examples/c++/adis16448.cxx View File

@@ -11,7 +11,7 @@
11 11
 //
12 12
 // This example code runs on an Intel Edison and uses mraa to acquire data
13 13
 // from an ADIS16448. This data is then scaled and printed onto the terminal.
14
-// 
14
+//
15 15
 // This software has been tested to connect to an ADIS16448 through a level shifter
16 16
 // such as the TI TXB0104. The SPI lines (DIN, DOUT, SCLK, /CS) are all wired through
17 17
 // the level shifter and the ADIS16448 is also being powered by the Intel Edison.
@@ -45,21 +45,22 @@
45 45
 int
46 46
 main(int argc, char **argv)
47 47
 {
48
-	while(true)
49
-	{
50
-		upm::ADIS16448* imu = new upm::ADIS16448(0,3); //upm::ADIS16448(SPI,RST)
51
-
52
-		//Read the specified register, scale it, and display it on the screen
53
-		std::cout << "XGYRO_OUT:" << imu->gyroScale(imu->regRead(XGYRO_OUT)) << std::endl;
54
-		std::cout << "YGYRO_OUT:" << imu->gyroScale(imu->regRead(YGYRO_OUT)) << std::endl;
55
-		std::cout << "ZGYRO_OUT:" << imu->gyroScale(imu->regRead(ZGYRO_OUT)) << std::endl;
56
-		std::cout << " " << std::endl;
57
-		std::cout << "XACCL_OUT:" << imu->accelScale(imu->regRead(XACCL_OUT)) << std::endl;
58
-		std::cout << "YACCL_OUT:" << imu->accelScale(imu->regRead(YACCL_OUT)) << std::endl;
59
-		std::cout << "ZACCL_OUT:" << imu->accelScale(imu->regRead(ZACCL_OUT)) << std::endl;
60
-		std::cout << " " << std::endl;
48
+    while(true)
49
+    {
50
+    //! [Interesting]
51
+        upm::ADIS16448* imu = new upm::ADIS16448(0,3); //upm::ADIS16448(SPI,RST)
61 52
 
62
-		sleep(1);
63
-	}
64
-	return (0);
53
+        //Read the specified register, scale it, and display it on the screen
54
+        std::cout << "XGYRO_OUT:" << imu->gyroScale(imu->regRead(XGYRO_OUT)) << std::endl;
55
+        std::cout << "YGYRO_OUT:" << imu->gyroScale(imu->regRead(YGYRO_OUT)) << std::endl;
56
+        std::cout << "ZGYRO_OUT:" << imu->gyroScale(imu->regRead(ZGYRO_OUT)) << std::endl;
57
+        std::cout << " " << std::endl;
58
+        std::cout << "XACCL_OUT:" << imu->accelScale(imu->regRead(XACCL_OUT)) << std::endl;
59
+        std::cout << "YACCL_OUT:" << imu->accelScale(imu->regRead(YACCL_OUT)) << std::endl;
60
+        std::cout << "ZACCL_OUT:" << imu->accelScale(imu->regRead(ZACCL_OUT)) << std::endl;
61
+        std::cout << " " << std::endl;
62
+    //! [Interesting]
63
+        sleep(1);
64
+    }
65
+    return (0);
65 66
 }

+ 21
- 2
src/adis16448/adis16448.h View File

@@ -83,8 +83,27 @@
83 83
 #define SERIAL_NUM 0x58 //Lot-specific serial number
84 84
 
85 85
 namespace upm {
86
-
87
-	// ADIS16448 class definition
86
+ /**
87
+  * @brief Adis16448
88
+  * @defgroup adis16448 libupm-adis16488
89
+  * @ingroup generic spi accelerometer
90
+  */
91
+ 
92
+ /**
93
+  * @library adis16448
94
+  * @sensor adis16448
95
+  * @comname ADIS16448 Accelerometer
96
+  * @type accelerometer
97
+  * @man generic
98
+  * @web http://www.analog.com/en/products/sensors/isensor-mems-inertial-measurement-units/adis16448.html
99
+  * @con spi
100
+  *
101
+  * @brief C++ API for Analog Devices ADIS16448
102
+  *
103
+  *	This is an industrial grade accelerometer by Analog Devices.
104
+  *
105
+  * @snippet adis16448.cxx Interesting
106
+  */
88 107
 	class ADIS16448{
89 108
 
90 109
 		public: