self-balancing-robot

Dependencies:   mbed mbed-rtos Motor

Committer:
pandirimukund
Date:
Mon Apr 27 16:57:40 2020 +0000
Revision:
41:b9c8d527dd2b
Parent:
13:8d8ac3189984
added comments and cleaned up code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pandirimukund 13:8d8ac3189984 1 /******************************************************************************
pandirimukund 13:8d8ac3189984 2 LSM9DS1_Registers.h
pandirimukund 13:8d8ac3189984 3 SFE_LSM9DS1 Library - LSM9DS1 Register Map
pandirimukund 13:8d8ac3189984 4 Jim Lindblom @ SparkFun Electronics
pandirimukund 13:8d8ac3189984 5 Original Creation Date: April 21, 2015
pandirimukund 13:8d8ac3189984 6 https://github.com/sparkfun/LSM9DS1_Breakout
pandirimukund 13:8d8ac3189984 7
pandirimukund 13:8d8ac3189984 8 This file defines all registers internal to the gyro/accel and magnetometer
pandirimukund 13:8d8ac3189984 9 devices in the LSM9DS1.
pandirimukund 13:8d8ac3189984 10
pandirimukund 13:8d8ac3189984 11 Development environment specifics:
pandirimukund 13:8d8ac3189984 12 IDE: Arduino 1.6.0
pandirimukund 13:8d8ac3189984 13 Hardware Platform: Arduino Uno
pandirimukund 13:8d8ac3189984 14 LSM9DS1 Breakout Version: 1.0
pandirimukund 13:8d8ac3189984 15
pandirimukund 13:8d8ac3189984 16 This code is beerware; if you see me (or any other SparkFun employee) at the
pandirimukund 13:8d8ac3189984 17 local, and you've found our code helpful, please buy us a round!
pandirimukund 13:8d8ac3189984 18
pandirimukund 13:8d8ac3189984 19 Distributed as-is; no warranty is given.
pandirimukund 13:8d8ac3189984 20 ******************************************************************************/
pandirimukund 13:8d8ac3189984 21
pandirimukund 13:8d8ac3189984 22 #ifndef __LSM9DS1_Registers_H__
pandirimukund 13:8d8ac3189984 23 #define __LSM9DS1_Registers_H__
pandirimukund 13:8d8ac3189984 24
pandirimukund 13:8d8ac3189984 25 /////////////////////////////////////////
pandirimukund 13:8d8ac3189984 26 // LSM9DS1 Accel/Gyro (XL/G) Registers //
pandirimukund 13:8d8ac3189984 27 /////////////////////////////////////////
pandirimukund 13:8d8ac3189984 28 #define ACT_THS 0x04
pandirimukund 13:8d8ac3189984 29 #define ACT_DUR 0x05
pandirimukund 13:8d8ac3189984 30 #define INT_GEN_CFG_XL 0x06
pandirimukund 13:8d8ac3189984 31 #define INT_GEN_THS_X_XL 0x07
pandirimukund 13:8d8ac3189984 32 #define INT_GEN_THS_Y_XL 0x08
pandirimukund 13:8d8ac3189984 33 #define INT_GEN_THS_Z_XL 0x09
pandirimukund 13:8d8ac3189984 34 #define INT_GEN_DUR_XL 0x0A
pandirimukund 13:8d8ac3189984 35 #define REFERENCE_G 0x0B
pandirimukund 13:8d8ac3189984 36 #define INT1_CTRL 0x0C
pandirimukund 13:8d8ac3189984 37 #define INT2_CTRL 0x0D
pandirimukund 13:8d8ac3189984 38 #define WHO_AM_I_XG 0x0F
pandirimukund 13:8d8ac3189984 39 #define CTRL_REG1_G 0x10
pandirimukund 13:8d8ac3189984 40 #define CTRL_REG2_G 0x11
pandirimukund 13:8d8ac3189984 41 #define CTRL_REG3_G 0x12
pandirimukund 13:8d8ac3189984 42 #define ORIENT_CFG_G 0x13
pandirimukund 13:8d8ac3189984 43 #define INT_GEN_SRC_G 0x14
pandirimukund 13:8d8ac3189984 44 #define OUT_TEMP_L 0x15
pandirimukund 13:8d8ac3189984 45 #define OUT_TEMP_H 0x16
pandirimukund 13:8d8ac3189984 46 #define STATUS_REG_0 0x17
pandirimukund 13:8d8ac3189984 47 #define OUT_X_L_G 0x18
pandirimukund 13:8d8ac3189984 48 #define OUT_X_H_G 0x19
pandirimukund 13:8d8ac3189984 49 #define OUT_Y_L_G 0x1A
pandirimukund 13:8d8ac3189984 50 #define OUT_Y_H_G 0x1B
pandirimukund 13:8d8ac3189984 51 #define OUT_Z_L_G 0x1C
pandirimukund 13:8d8ac3189984 52 #define OUT_Z_H_G 0x1D
pandirimukund 13:8d8ac3189984 53 #define CTRL_REG4 0x1E
pandirimukund 13:8d8ac3189984 54 #define CTRL_REG5_XL 0x1F
pandirimukund 13:8d8ac3189984 55 #define CTRL_REG6_XL 0x20
pandirimukund 13:8d8ac3189984 56 #define CTRL_REG7_XL 0x21
pandirimukund 13:8d8ac3189984 57 #define CTRL_REG8 0x22
pandirimukund 13:8d8ac3189984 58 #define CTRL_REG9 0x23
pandirimukund 13:8d8ac3189984 59 #define CTRL_REG10 0x24
pandirimukund 13:8d8ac3189984 60 #define INT_GEN_SRC_XL 0x26
pandirimukund 13:8d8ac3189984 61 #define STATUS_REG_1 0x27
pandirimukund 13:8d8ac3189984 62 #define OUT_X_L_XL 0x28
pandirimukund 13:8d8ac3189984 63 #define OUT_X_H_XL 0x29
pandirimukund 13:8d8ac3189984 64 #define OUT_Y_L_XL 0x2A
pandirimukund 13:8d8ac3189984 65 #define OUT_Y_H_XL 0x2B
pandirimukund 13:8d8ac3189984 66 #define OUT_Z_L_XL 0x2C
pandirimukund 13:8d8ac3189984 67 #define OUT_Z_H_XL 0x2D
pandirimukund 13:8d8ac3189984 68 #define FIFO_CTRL 0x2E
pandirimukund 13:8d8ac3189984 69 #define FIFO_SRC 0x2F
pandirimukund 13:8d8ac3189984 70 #define INT_GEN_CFG_G 0x30
pandirimukund 13:8d8ac3189984 71 #define INT_GEN_THS_XH_G 0x31
pandirimukund 13:8d8ac3189984 72 #define INT_GEN_THS_XL_G 0x32
pandirimukund 13:8d8ac3189984 73 #define INT_GEN_THS_YH_G 0x33
pandirimukund 13:8d8ac3189984 74 #define INT_GEN_THS_YL_G 0x34
pandirimukund 13:8d8ac3189984 75 #define INT_GEN_THS_ZH_G 0x35
pandirimukund 13:8d8ac3189984 76 #define INT_GEN_THS_ZL_G 0x36
pandirimukund 13:8d8ac3189984 77 #define INT_GEN_DUR_G 0x37
pandirimukund 13:8d8ac3189984 78
pandirimukund 13:8d8ac3189984 79 ///////////////////////////////
pandirimukund 13:8d8ac3189984 80 // LSM9DS1 Magneto Registers //
pandirimukund 13:8d8ac3189984 81 ///////////////////////////////
pandirimukund 13:8d8ac3189984 82 #define OFFSET_X_REG_L_M 0x05
pandirimukund 13:8d8ac3189984 83 #define OFFSET_X_REG_H_M 0x06
pandirimukund 13:8d8ac3189984 84 #define OFFSET_Y_REG_L_M 0x07
pandirimukund 13:8d8ac3189984 85 #define OFFSET_Y_REG_H_M 0x08
pandirimukund 13:8d8ac3189984 86 #define OFFSET_Z_REG_L_M 0x09
pandirimukund 13:8d8ac3189984 87 #define OFFSET_Z_REG_H_M 0x0A
pandirimukund 13:8d8ac3189984 88 #define WHO_AM_I_M 0x0F
pandirimukund 13:8d8ac3189984 89 #define CTRL_REG1_M 0x20
pandirimukund 13:8d8ac3189984 90 #define CTRL_REG2_M 0x21
pandirimukund 13:8d8ac3189984 91 #define CTRL_REG3_M 0x22
pandirimukund 13:8d8ac3189984 92 #define CTRL_REG4_M 0x23
pandirimukund 13:8d8ac3189984 93 #define CTRL_REG5_M 0x24
pandirimukund 13:8d8ac3189984 94 #define STATUS_REG_M 0x27
pandirimukund 13:8d8ac3189984 95 #define OUT_X_L_M 0x28
pandirimukund 13:8d8ac3189984 96 #define OUT_X_H_M 0x29
pandirimukund 13:8d8ac3189984 97 #define OUT_Y_L_M 0x2A
pandirimukund 13:8d8ac3189984 98 #define OUT_Y_H_M 0x2B
pandirimukund 13:8d8ac3189984 99 #define OUT_Z_L_M 0x2C
pandirimukund 13:8d8ac3189984 100 #define OUT_Z_H_M 0x2D
pandirimukund 13:8d8ac3189984 101 #define INT_CFG_M 0x30
pandirimukund 13:8d8ac3189984 102 #define INT_SRC_M 0x30
pandirimukund 13:8d8ac3189984 103 #define INT_THS_L_M 0x32
pandirimukund 13:8d8ac3189984 104 #define INT_THS_H_M 0x33
pandirimukund 13:8d8ac3189984 105
pandirimukund 13:8d8ac3189984 106 ////////////////////////////////
pandirimukund 13:8d8ac3189984 107 // LSM9DS1 WHO_AM_I Responses //
pandirimukund 13:8d8ac3189984 108 ////////////////////////////////
pandirimukund 13:8d8ac3189984 109 #define WHO_AM_I_AG_RSP 0x68
pandirimukund 13:8d8ac3189984 110 #define WHO_AM_I_M_RSP 0x3D
pandirimukund 13:8d8ac3189984 111
pandirimukund 13:8d8ac3189984 112 #endif