tsensor.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /**
  2. ******************************************************************************
  3. * @file tsensor.h
  4. * @author MCD Application Team
  5. * @version V4.0.1
  6. * @date 21-July-2015
  7. * @brief This header file contains the functions prototypes for the
  8. * Temperature Sensor driver.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
  13. *
  14. * Redistribution and use in source and binary forms, with or without modification,
  15. * are permitted provided that the following conditions are met:
  16. * 1. Redistributions of source code must retain the above copyright notice,
  17. * this list of conditions and the following disclaimer.
  18. * 2. Redistributions in binary form must reproduce the above copyright notice,
  19. * this list of conditions and the following disclaimer in the documentation
  20. * and/or other materials provided with the distribution.
  21. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  22. * may be used to endorse or promote products derived from this software
  23. * without specific prior written permission.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  26. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  27. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  28. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  29. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  30. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  31. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  32. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  33. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. *
  36. ******************************************************************************
  37. */
  38. /* Define to prevent recursive inclusion -------------------------------------*/
  39. #ifndef __TSENSOR_H
  40. #define __TSENSOR_H
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. /* Includes ------------------------------------------------------------------*/
  45. #include <stdint.h>
  46. /** @addtogroup BSP
  47. * @{
  48. */
  49. /** @addtogroup Components
  50. * @{
  51. */
  52. /** @addtogroup TSENSOR
  53. * @{
  54. */
  55. /** @defgroup TSENSOR_Exported_Types
  56. * @{
  57. */
  58. /** @defgroup TSENSOR_Config_structure Temperature Sensor Configuration structure
  59. * @{
  60. */
  61. typedef struct
  62. {
  63. uint8_t AlertMode; /* Alert Mode Temperature out of range*/
  64. uint8_t ConversionMode; /* Continuous/One Shot Mode */
  65. uint8_t ConversionResolution; /* Temperature Resolution */
  66. uint8_t ConversionRate; /* Number of measure per second */
  67. uint8_t TemperatureLimitHigh; /* High Temperature Limit Range */
  68. uint8_t TemperatureLimitLow; /* Low Temperature Limit Range */
  69. }TSENSOR_InitTypeDef;
  70. /**
  71. * @}
  72. */
  73. /** @defgroup TSENSOR_Driver_structure Temperature Sensor Driver structure
  74. * @{
  75. */
  76. typedef struct
  77. {
  78. void (*Init)(uint16_t, TSENSOR_InitTypeDef *);
  79. uint8_t (*IsReady)(uint16_t, uint32_t);
  80. uint8_t (*ReadStatus)(uint16_t);
  81. uint16_t (*ReadTemp)(uint16_t);
  82. }TSENSOR_DrvTypeDef;
  83. /**
  84. * @}
  85. */
  86. /**
  87. * @}
  88. */
  89. /**
  90. * @}
  91. */
  92. /**
  93. * @}
  94. */
  95. /**
  96. * @}
  97. */
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101. #endif /* __TSENSOR_H */
  102. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/