Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mpu3050.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/mutex.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>

Go to the source code of this file.

Data Structures

struct  axis_data
 
struct  mpu3050_sensor
 

Macros

#define MPU3050_CHIP_ID   0x69
 
#define MPU3050_AUTO_DELAY   1000
 
#define MPU3050_MIN_VALUE   -32768
 
#define MPU3050_MAX_VALUE   32767
 
#define MPU3050_DEFAULT_POLL_INTERVAL   200
 
#define MPU3050_DEFAULT_FS_RANGE   3
 
#define MPU3050_CHIP_ID_REG   0x00
 
#define MPU3050_SMPLRT_DIV   0x15
 
#define MPU3050_DLPF_FS_SYNC   0x16
 
#define MPU3050_INT_CFG   0x17
 
#define MPU3050_XOUT_H   0x1D
 
#define MPU3050_PWR_MGM   0x3E
 
#define MPU3050_PWR_MGM_POS   6
 
#define MPU3050_EXT_SYNC_NONE   0x00
 
#define MPU3050_EXT_SYNC_TEMP   0x20
 
#define MPU3050_EXT_SYNC_GYROX   0x40
 
#define MPU3050_EXT_SYNC_GYROY   0x60
 
#define MPU3050_EXT_SYNC_GYROZ   0x80
 
#define MPU3050_EXT_SYNC_ACCELX   0xA0
 
#define MPU3050_EXT_SYNC_ACCELY   0xC0
 
#define MPU3050_EXT_SYNC_ACCELZ   0xE0
 
#define MPU3050_EXT_SYNC_MASK   0xE0
 
#define MPU3050_FS_250DPS   0x00
 
#define MPU3050_FS_500DPS   0x08
 
#define MPU3050_FS_1000DPS   0x10
 
#define MPU3050_FS_2000DPS   0x18
 
#define MPU3050_FS_MASK   0x18
 
#define MPU3050_DLPF_CFG_256HZ_NOLPF2   0x00
 
#define MPU3050_DLPF_CFG_188HZ   0x01
 
#define MPU3050_DLPF_CFG_98HZ   0x02
 
#define MPU3050_DLPF_CFG_42HZ   0x03
 
#define MPU3050_DLPF_CFG_20HZ   0x04
 
#define MPU3050_DLPF_CFG_10HZ   0x05
 
#define MPU3050_DLPF_CFG_5HZ   0x06
 
#define MPU3050_DLPF_CFG_2100HZ_NOLPF   0x07
 
#define MPU3050_DLPF_CFG_MASK   0x07
 
#define MPU3050_RAW_RDY_EN   0x01
 
#define MPU3050_MPU_RDY_EN   0x02
 
#define MPU3050_LATCH_INT_EN   0x04
 
#define MPU3050_PWR_MGM_PLL_X   0x01
 
#define MPU3050_PWR_MGM_PLL_Y   0x02
 
#define MPU3050_PWR_MGM_PLL_Z   0x03
 
#define MPU3050_PWR_MGM_CLKSEL   0x07
 
#define MPU3050_PWR_MGM_STBY_ZG   0x08
 
#define MPU3050_PWR_MGM_STBY_YG   0x10
 
#define MPU3050_PWR_MGM_STBY_XG   0x20
 
#define MPU3050_PWR_MGM_SLEEP   0x40
 
#define MPU3050_PWR_MGM_RESET   0x80
 
#define MPU3050_PWR_MGM_MASK   0x40
 

Functions

 MODULE_DEVICE_TABLE (i2c, mpu3050_ids)
 
 MODULE_DEVICE_TABLE (of, mpu3050_of_match)
 
 module_i2c_driver (mpu3050_i2c_driver)
 
 MODULE_AUTHOR ("Wistron Corp.")
 
 MODULE_DESCRIPTION ("MPU3050 Tri-axis gyroscope driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define MPU3050_AUTO_DELAY   1000

Definition at line 46 of file mpu3050.c.

#define MPU3050_CHIP_ID   0x69

Definition at line 44 of file mpu3050.c.

#define MPU3050_CHIP_ID_REG   0x00

Definition at line 55 of file mpu3050.c.

#define MPU3050_DEFAULT_FS_RANGE   3

Definition at line 52 of file mpu3050.c.

#define MPU3050_DEFAULT_POLL_INTERVAL   200

Definition at line 51 of file mpu3050.c.

#define MPU3050_DLPF_CFG_10HZ   0x05

Definition at line 85 of file mpu3050.c.

#define MPU3050_DLPF_CFG_188HZ   0x01

Definition at line 81 of file mpu3050.c.

#define MPU3050_DLPF_CFG_20HZ   0x04

Definition at line 84 of file mpu3050.c.

#define MPU3050_DLPF_CFG_2100HZ_NOLPF   0x07

Definition at line 87 of file mpu3050.c.

#define MPU3050_DLPF_CFG_256HZ_NOLPF2   0x00

Definition at line 80 of file mpu3050.c.

#define MPU3050_DLPF_CFG_42HZ   0x03

Definition at line 83 of file mpu3050.c.

#define MPU3050_DLPF_CFG_5HZ   0x06

Definition at line 86 of file mpu3050.c.

#define MPU3050_DLPF_CFG_98HZ   0x02

Definition at line 82 of file mpu3050.c.

#define MPU3050_DLPF_CFG_MASK   0x07

Definition at line 88 of file mpu3050.c.

#define MPU3050_DLPF_FS_SYNC   0x16

Definition at line 57 of file mpu3050.c.

#define MPU3050_EXT_SYNC_ACCELX   0xA0

Definition at line 71 of file mpu3050.c.

#define MPU3050_EXT_SYNC_ACCELY   0xC0

Definition at line 72 of file mpu3050.c.

#define MPU3050_EXT_SYNC_ACCELZ   0xE0

Definition at line 73 of file mpu3050.c.

#define MPU3050_EXT_SYNC_GYROX   0x40

Definition at line 68 of file mpu3050.c.

#define MPU3050_EXT_SYNC_GYROY   0x60

Definition at line 69 of file mpu3050.c.

#define MPU3050_EXT_SYNC_GYROZ   0x80

Definition at line 70 of file mpu3050.c.

#define MPU3050_EXT_SYNC_MASK   0xE0

Definition at line 74 of file mpu3050.c.

#define MPU3050_EXT_SYNC_NONE   0x00

Definition at line 66 of file mpu3050.c.

#define MPU3050_EXT_SYNC_TEMP   0x20

Definition at line 67 of file mpu3050.c.

#define MPU3050_FS_1000DPS   0x10

Definition at line 77 of file mpu3050.c.

#define MPU3050_FS_2000DPS   0x18

Definition at line 78 of file mpu3050.c.

#define MPU3050_FS_250DPS   0x00

Definition at line 75 of file mpu3050.c.

#define MPU3050_FS_500DPS   0x08

Definition at line 76 of file mpu3050.c.

#define MPU3050_FS_MASK   0x18

Definition at line 79 of file mpu3050.c.

#define MPU3050_INT_CFG   0x17

Definition at line 58 of file mpu3050.c.

#define MPU3050_LATCH_INT_EN   0x04

Definition at line 92 of file mpu3050.c.

#define MPU3050_MAX_VALUE   32767

Definition at line 49 of file mpu3050.c.

#define MPU3050_MIN_VALUE   -32768

Definition at line 48 of file mpu3050.c.

#define MPU3050_MPU_RDY_EN   0x02

Definition at line 91 of file mpu3050.c.

#define MPU3050_PWR_MGM   0x3E

Definition at line 60 of file mpu3050.c.

#define MPU3050_PWR_MGM_CLKSEL   0x07

Definition at line 97 of file mpu3050.c.

#define MPU3050_PWR_MGM_MASK   0x40

Definition at line 103 of file mpu3050.c.

#define MPU3050_PWR_MGM_PLL_X   0x01

Definition at line 94 of file mpu3050.c.

#define MPU3050_PWR_MGM_PLL_Y   0x02

Definition at line 95 of file mpu3050.c.

#define MPU3050_PWR_MGM_PLL_Z   0x03

Definition at line 96 of file mpu3050.c.

#define MPU3050_PWR_MGM_POS   6

Definition at line 61 of file mpu3050.c.

#define MPU3050_PWR_MGM_RESET   0x80

Definition at line 102 of file mpu3050.c.

#define MPU3050_PWR_MGM_SLEEP   0x40

Definition at line 101 of file mpu3050.c.

#define MPU3050_PWR_MGM_STBY_XG   0x20

Definition at line 100 of file mpu3050.c.

#define MPU3050_PWR_MGM_STBY_YG   0x10

Definition at line 99 of file mpu3050.c.

#define MPU3050_PWR_MGM_STBY_ZG   0x08

Definition at line 98 of file mpu3050.c.

#define MPU3050_RAW_RDY_EN   0x01

Definition at line 90 of file mpu3050.c.

#define MPU3050_SMPLRT_DIV   0x15

Definition at line 56 of file mpu3050.c.

#define MPU3050_XOUT_H   0x1D

Definition at line 59 of file mpu3050.c.

Function Documentation

MODULE_AUTHOR ( "Wistron Corp."  )
MODULE_DESCRIPTION ( "MPU3050 Tri-axis gyroscope driver )
MODULE_DEVICE_TABLE ( i2c  ,
mpu3050_ids   
)
MODULE_DEVICE_TABLE ( of  ,
mpu3050_of_match   
)
module_i2c_driver ( mpu3050_i2c_driver  )
MODULE_LICENSE ( "GPL"  )