Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: mylib/devices/inc/L3GD20.h
- Revision:
- 0:fb4269aa5fb4
diff -r 000000000000 -r fb4269aa5fb4 mylib/devices/inc/L3GD20.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mylib/devices/inc/L3GD20.h Fri May 26 03:51:19 2017 +0000
@@ -0,0 +1,43 @@
+#ifndef __l3gd20_H
+#define __l3gd20_H
+
+#include "spi.h"
+//#include "mxconstants.h"
+#include <stdio.h>
+
+
+#define L3GD20_RW 0x80
+
+/*-------------------------------*/
+#define WHO_AM_I 0x0F
+#define CTRL_REG1 0x20
+#define CTRL_REG2 0x21
+#define CTRL_REG3 0x22
+#define CTRL_REG4 0x23
+
+#define OUT_TEMP 0x26
+
+#define OUT_X_L 0x28
+#define OUT_X_H 0x29
+#define OUT_Y_L 0x2A
+#define OUT_Y_H 0x2B
+#define OUT_Z_L 0x2C
+#define OUT_Z_H 0x2D
+/*-------------------------------*/
+
+typedef struct{
+
+ int32_t x;
+ int32_t y;
+ int32_t z;
+
+ int32_t temp;
+
+ } gyro_t;
+
+extern gyro_t l3gd20;
+
+void L3GD20_Init();
+void L3GD20_Read();
+
+#endif
\ No newline at end of file