gyro.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /**
  2. ******************************************************************************
  3. * @file gyro.h
  4. * @author MCD Application Team
  5. * @brief This header file contains the functions prototypes for the gyroscope driver.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef __GYRO_H
  21. #define __GYRO_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include <stdint.h>
  27. /** @addtogroup BSP
  28. * @{
  29. */
  30. /** @addtogroup Components
  31. * @{
  32. */
  33. /** @addtogroup GYRO
  34. * @{
  35. */
  36. /** @defgroup GYRO_Exported_Types
  37. * @{
  38. */
  39. /** @defgroup GYRO_Driver_structure Gyroscope Driver structure
  40. * @{
  41. */
  42. typedef struct
  43. {
  44. void (*Init)(uint16_t);
  45. void (*DeInit)(void);
  46. uint8_t (*ReadID)(void);
  47. void (*Reset)(void);
  48. void (*LowPower)(uint16_t);
  49. void (*ConfigIT)(uint16_t);
  50. void (*EnableIT)(uint8_t);
  51. void (*DisableIT)(uint8_t);
  52. uint8_t (*ITStatus)(uint16_t, uint16_t);
  53. void (*ClearIT)(uint16_t, uint16_t);
  54. void (*FilterConfig)(uint8_t);
  55. void (*FilterCmd)(uint8_t);
  56. void (*GetXYZ)(float *);
  57. }GYRO_DrvTypeDef;
  58. /**
  59. * @}
  60. */
  61. /** @defgroup GYRO_Config_structure Gyroscope Configuration structure
  62. * @{
  63. */
  64. typedef struct
  65. {
  66. uint8_t Power_Mode; /* Power-down/Sleep/Normal Mode */
  67. uint8_t Output_DataRate; /* OUT data rate */
  68. uint8_t Axes_Enable; /* Axes enable */
  69. uint8_t Band_Width; /* Bandwidth selection */
  70. uint8_t BlockData_Update; /* Block Data Update */
  71. uint8_t Endianness; /* Endian Data selection */
  72. uint8_t Full_Scale; /* Full Scale selection */
  73. }GYRO_InitTypeDef;
  74. /* GYRO High Pass Filter struct */
  75. typedef struct
  76. {
  77. uint8_t HighPassFilter_Mode_Selection; /* Internal filter mode */
  78. uint8_t HighPassFilter_CutOff_Frequency; /* High pass filter cut-off frequency */
  79. }GYRO_FilterConfigTypeDef;
  80. /*GYRO Interrupt struct */
  81. typedef struct
  82. {
  83. uint8_t Latch_Request; /* Latch interrupt request into CLICK_SRC register */
  84. uint8_t Interrupt_Axes; /* X, Y, Z Axes Interrupts */
  85. uint8_t Interrupt_ActiveEdge; /* Interrupt Active edge */
  86. }GYRO_InterruptConfigTypeDef;
  87. /**
  88. * @}
  89. */
  90. /**
  91. * @}
  92. */
  93. /**
  94. * @}
  95. */
  96. /**
  97. * @}
  98. */
  99. /**
  100. * @}
  101. */
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105. #endif /* __GYRO_H */
  106. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/