hi_comm_motionfusion.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /************************************************************************
  2. * Copyright (C) 2018, Hisilicon Tech. Co., Ltd.
  3. * ALL RIGHTS RESERVED
  4. * FileName: hi_comm_motionfusion.h
  5. * Description: init draft
  6. *
  7. *************************************************************************/
  8. #ifndef _COMM_MONTIONFUSION_H_
  9. #define _COMM_MONTIONFUSION_H_
  10. #include "hi_type.h"
  11. #include "hi_errno.h"
  12. #ifdef __cplusplus
  13. #if __cplusplus
  14. extern "C" {
  15. #endif
  16. #endif /* __cplusplus */
  17. #define HI_ERR_MOTIONFUSION_NOBUF HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF)
  18. #define HI_ERR_MOTIONFUSION_BUF_EMPTY HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY)
  19. #define HI_ERR_MOTIONFUSION_NULL_PTR HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
  20. #define HI_ERR_MOTIONFUSION_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
  21. #define HI_ERR_MOTIONFUSION_BUF_FULL HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL)
  22. #define HI_ERR_MOTIONFUSION_SYS_NOTREADY HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
  23. #define HI_ERR_MOTIONFUSION_NOT_SUPPORT HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
  24. #define HI_ERR_MOTIONFUSION_NOT_PERMITTED HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
  25. #define HI_ERR_MOTIONFUSION_BUSY HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY)
  26. #define HI_ERR_MOTIONFUSION_INVALID_CHNID HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID)
  27. #define HI_ERR_MOTIONFUSION_CHN_UNEXIST HI_DEF_ERR(HI_ID_MOTIONFUSION, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST)
  28. #define HI_TRACE_MOTIONFUSION(level, fmt, ...)\
  29. do{ \
  30. HI_TRACE(level, HI_ID_MOTIONFUSION,"[Func]:%s [Line]:%d [Info]:"fmt,__FUNCTION__, __LINE__,##__VA_ARGS__);\
  31. }while(0)
  32. #define AXIS_NUM (3)
  33. #define MATRIX_NUM (9)
  34. #define MFUSION_TEMP_GYRO 0x1
  35. #define MFUSION_TEMP_ACC 0x2
  36. #define MFUSION_TEMP_MAGN 0x4
  37. typedef HI_S32 IMU_DRIFT[AXIS_NUM];
  38. typedef HI_S32 IMU_MATRIX[MATRIX_NUM];
  39. typedef struct hiMFUSION_EULER_S
  40. {
  41. HI_S32 s32Roll;
  42. HI_S32 s32Pitch;
  43. HI_S32 s32Yaw;
  44. } MFUSION_EULER_S;
  45. typedef enum hiMFUSION_MODE_E
  46. {
  47. MFUSION_MODE_3AXIS = 0,
  48. MFUSION_MODE_6AXIS ,
  49. MFUSION_MODE_9AXIS ,
  50. MFUSION_MODE_BUTT
  51. } MFUSION_MODE_E;
  52. typedef enum hiMFUSION_DEVICE_E
  53. {
  54. MFUSION_DEVICE_GYRO = 0,
  55. MFUSION_DEVICE_ACC ,
  56. MFUSION_DEVICE_MAGN ,
  57. MFUSION_DEVICE_BUTT
  58. } MFUSION_DEVICE_E;
  59. typedef enum hiMFUSION_USECASE_E
  60. {
  61. MFUSION_USECASE_DIS = 0,
  62. MFUSION_USECASE_RECTIFY ,
  63. MFUSION_USECASE_BUTT
  64. } MFUSION_USECASE_E;
  65. typedef struct hiMFUSION_ATTR_S
  66. {
  67. MFUSION_MODE_E enMFusionMode;
  68. HI_S32 s32TemperatureMask;
  69. } MFUSION_ATTR_S;
  70. #ifdef __cplusplus
  71. #if __cplusplus
  72. }
  73. #endif
  74. #endif /* __cplusplus */
  75. #endif