Icm20948Augmented.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * ________________________________________________________________________________________________________
  3. * Copyright © 2014-2015 InvenSense Inc. Portions Copyright © 2014-2015 Movea. All rights reserved.
  4. * This software, related documentation and any modifications thereto (collectively “Software”) is subject
  5. * to InvenSense and its licensors' intellectual property rights under U.S. and international copyright and
  6. * other intellectual property rights laws.
  7. * InvenSense and its licensors retain all intellectual property and proprietary rights in and to the Software
  8. * and any use, reproduction, disclosure or distribution of the Software without an express license
  9. * agreement from InvenSense is strictly prohibited.
  10. * ________________________________________________________________________________________________________
  11. */
  12. /** @defgroup icm20948_augmented_sensors augmented_sensors
  13. @ingroup SmartSensor_driver
  14. @{
  15. */
  16. #ifndef INV_ICM20948_AUGMENTED_SENSORS__
  17. #define INV_ICM20948_AUGMENTED_SENSORS__
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. #include "Icm20948Defs.h"
  23. /* forward declaration */
  24. struct inv_icm20948;
  25. /** @brief Initialize structure values
  26. * @param[in] base state structre
  27. */
  28. int INV_EXPORT inv_icm20948_augmented_init(struct inv_icm20948 * s);
  29. /** @brief Gets the 3 axis gravity value based on GRV quaternion
  30. * @param[out] gravity 3 components resulting gravity in Q16 in m/s2
  31. * @param[in] quat 3 components input AG-based quaternion in Q30
  32. * @return 0 in case of success, -1 for any error
  33. */
  34. int INV_EXPORT inv_icm20948_augmented_sensors_get_gravity(struct inv_icm20948 * s, long gravity[3], const long quat6axis_3e[3]);
  35. /** @brief Gets the 3 axis linear acceleration value based on gravity and accelerometer values
  36. * @param[out] linacc 3 components resulting linear acceleration in Q16 in m/s2
  37. * @param[in] gravity 3 components gravity in Q16 in m/s2
  38. * @param[in] accel 3 components acceleration in Q16 in m/s2
  39. * @return 0 in case of success, -1 for any error
  40. */
  41. int INV_EXPORT inv_icm20948_augmented_sensors_get_linearacceleration(long linacc[3], const long gravity[3], const long accel[3]);
  42. /** @brief Gets the 3 axis orientation value based on RV quaternion
  43. * @param[out] orientation 3 components resulting orientation in Q16 in degrees
  44. The x field is azimuth, the angle between the magnetic north direction and the y axis around the the z axis.
  45. The y field is pitch, the rotation arounf x axis, positive when the z axis moves toward the y axis.
  46. The z field is roll, the rotation arount the y axis, positive when the x axis moves toward the z axis.
  47. * @param[in] quat9axis_3e 3 components input AGM-based quaternion in Q30
  48. * @return 0 in case of success, -1 for any error
  49. */
  50. int INV_EXPORT inv_icm20948_augmented_sensors_get_orientation(long orientation[3], const long quat9axis_3e[4]);
  51. /** @brief Set ODR for one of the augmented sensor-related Android sensor
  52. * @param[in] androidSensor Android sensor ID for which a new delay in to be applied
  53. * @param[in] delayInMs the new delay in ms requested for androidSensor
  54. * @return the delay in ms to be applied to quat6 output
  55. */
  56. unsigned short INV_EXPORT inv_icm20948_augmented_sensors_set_odr(struct inv_icm20948 * s, unsigned char androidSensor, unsigned short delayInMs);
  57. /** @brief Update ODR when an augmented sensor-related Android sensor was enabled or disable with ODR unchanged
  58. * @param[in] androidSensor Android sensor ID for which status was updated
  59. * @param[out] updatedDelayPtr Handler where should be written new delay to be applied
  60. * @return None
  61. */
  62. void INV_EXPORT inv_icm20948_augmented_sensors_update_odr(struct inv_icm20948 * s, unsigned char androidSensor, unsigned short * updatedDelayPtr);
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66. #endif // INV_ICM20948_AUGMENTED_SENSORS__
  67. /** @} */