accelero.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. ******************************************************************************
  3. * @file accelero.h
  4. * @author MCD Application Team
  5. * @brief This header file contains the functions prototypes for the Accelerometer 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 __ACCELERO_H
  21. #define __ACCELERO_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 ACCELERO
  34. * @{
  35. */
  36. /** @defgroup ACCELERO_Exported_Types
  37. * @{
  38. */
  39. /** @defgroup ACCELERO_Driver_structure Accelerometer 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)(void);
  50. void (*EnableIT)(uint8_t);
  51. void (*DisableIT)(uint8_t);
  52. uint8_t (*ITStatus)(uint16_t);
  53. void (*ClearIT)(void);
  54. void (*FilterConfig)(uint8_t);
  55. void (*FilterCmd)(uint8_t);
  56. void (*GetXYZ)(int16_t *);
  57. }ACCELERO_DrvTypeDef;
  58. /**
  59. * @}
  60. */
  61. /** @defgroup ACCELERO_Configuration_structure Accelerometer Configuration structure
  62. * @{
  63. */
  64. /* ACCELERO struct */
  65. typedef struct
  66. {
  67. uint8_t Power_Mode; /* Power-down/Normal Mode */
  68. uint8_t AccOutput_DataRate; /* OUT data rate */
  69. uint8_t Axes_Enable; /* Axes enable */
  70. uint8_t High_Resolution; /* High Resolution enabling/disabling */
  71. uint8_t BlockData_Update; /* Block Data Update */
  72. uint8_t Endianness; /* Endian Data selection */
  73. uint8_t AccFull_Scale; /* Full Scale selection */
  74. uint8_t Communication_Mode;
  75. }ACCELERO_InitTypeDef;
  76. /* ACCELERO High Pass Filter struct */
  77. typedef struct
  78. {
  79. uint8_t HighPassFilter_Mode_Selection; /* Internal filter mode */
  80. uint8_t HighPassFilter_CutOff_Frequency; /* High pass filter cut-off frequency */
  81. uint8_t HighPassFilter_AOI1; /* HPF_enabling/disabling for AOI function on interrupt 1 */
  82. uint8_t HighPassFilter_AOI2; /* HPF_enabling/disabling for AOI function on interrupt 2 */
  83. uint8_t HighPassFilter_Data_Sel;
  84. uint8_t HighPassFilter_Stat;
  85. }ACCELERO_FilterConfigTypeDef;
  86. /**
  87. * @}
  88. */
  89. /**
  90. * @}
  91. */
  92. /**
  93. * @}
  94. */
  95. /**
  96. * @}
  97. */
  98. /**
  99. * @}
  100. */
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104. #endif /* __ACCELERO_H */
  105. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/