tsensor.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /**
  2. ******************************************************************************
  3. * @file tsensor.h
  4. * @author MCD Application Team
  5. * @brief This header file contains the functions prototypes for the
  6. * Temperature Sensor driver.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software component is licensed by ST under BSD 3-Clause license,
  14. * the "License"; You may not use this file except in compliance with the
  15. * License. You may obtain a copy of the License at:
  16. * opensource.org/licenses/BSD-3-Clause
  17. *
  18. ******************************************************************************
  19. */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __TSENSOR_H
  22. #define __TSENSOR_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include <stdint.h>
  28. /** @addtogroup BSP
  29. * @{
  30. */
  31. /** @addtogroup Components
  32. * @{
  33. */
  34. /** @addtogroup TSENSOR
  35. * @{
  36. */
  37. /** @defgroup TSENSOR_Exported_Types
  38. * @{
  39. */
  40. /** @defgroup TSENSOR_Config_structure Temperature Sensor Configuration structure
  41. * @{
  42. */
  43. typedef struct
  44. {
  45. uint8_t AlertMode; /* Alert Mode Temperature out of range*/
  46. uint8_t ConversionMode; /* Continuous/One Shot Mode */
  47. uint8_t ConversionResolution; /* Temperature Resolution */
  48. uint8_t ConversionRate; /* Number of measure per second */
  49. int8_t TemperatureLimitHigh; /* High Temperature Limit Range */
  50. int8_t TemperatureLimitLow; /* Low Temperature Limit Range */
  51. }TSENSOR_InitTypeDef;
  52. /**
  53. * @}
  54. */
  55. /** @defgroup TSENSOR_Driver_structure Temperature Sensor Driver structure
  56. * @{
  57. */
  58. typedef struct
  59. {
  60. void (*Init)(uint16_t, TSENSOR_InitTypeDef *);
  61. uint8_t (*IsReady)(uint16_t, uint32_t);
  62. uint8_t (*ReadStatus)(uint16_t);
  63. float (*ReadTemp)(uint16_t);
  64. }TSENSOR_DrvTypeDef;
  65. /**
  66. * @}
  67. */
  68. /**
  69. * @}
  70. */
  71. /**
  72. * @}
  73. */
  74. /**
  75. * @}
  76. */
  77. /**
  78. * @}
  79. */
  80. #ifdef __cplusplus
  81. }
  82. #endif
  83. #endif /* __TSENSOR_H */
  84. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/