bmm150.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* bmm150.c - bmm150 compass driver
  2. *
  3. *
  4. * This software program is licensed subject to the GNU General Public License
  5. * (GPL).Version 2,June 1991, available at http://www.fsf.org/copyleft/gpl.html
  6. * (C) Copyright 2011 Bosch Sensortec GmbH
  7. * All Rights Reserved
  8. */
  9. /*
  10. * Definitions for bmm150 magnetic sensor chip.
  11. */
  12. #ifndef __BMM150_H__
  13. #define __BMM150_H__
  14. #include <linux/ioctl.h>
  15. #define CALIBRATION_DATA_SIZE 12
  16. /* 7-bit addr:
  17. * 0x12 (SDO connected to GND)
  18. * 0x13 (SDO connected to VDDIO)
  19. */
  20. #define BMM150_I2C_ADDR 0x13
  21. // conversion of magnetic data (for bmm150) to uT units
  22. // conversion of magnetic data to uT units
  23. // 32768 = 1Guass = 100 uT
  24. // 100 / 32768 = 25 / 8096
  25. // 65536 = 360Degree
  26. // 360 / 65536 = 45 / 8192
  27. #define CONVERT_M 1
  28. #define CONVERT_M_DIV 4
  29. #define CONVERT_O 1
  30. #define CONVERT_O_DIV 71 //(C_PI_F32X * AXIS_RESOLUTION_FACTOR / 180)
  31. #define CONVERT_G 1
  32. #define CONVERT_G_DIV 938
  33. #define CONVERT_VRV 1
  34. #define CONVERT_VRV_DIV 16384
  35. #define CONVERT_VLA_DIV 16384
  36. #define CONVERT_VG_DIV 16384
  37. #endif /* __BMM150_H__ */