bexus_mpu.h 636 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef bexus_mpu_h
  2. #define bexus_mpu_h
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. //#include "FreeRTOS.h"
  7. #include "i2c.h"
  8. #include "bexus_variables.h"
  9. #include "bexus_sysclock.h"
  10. #include "main.h"
  11. #include "Math.h"
  12. #include <string.h>
  13. #define MPU_ADDR 0xD0
  14. #define RAD_TO_DEG (180/3.141592)
  15. #define DIV_180_PI (180/3.141592)
  16. #define MPU_ADDR_ACCEL 0x3B
  17. #define MPU_ADDR_GYRO 0x43
  18. void Mpu_Init(void);
  19. int Bexus_Mpu_Read(void);
  20. int sendByteToMpu(uint8_t* data, uint8_t len);
  21. void ConfigMpu(uint8_t reg, uint8_t data);
  22. uint8_t recvByteFromMpu(uint8_t reg);
  23. int16_t recvIntFromMpu(uint8_t reg);
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif