idd.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /**
  2. ******************************************************************************
  3. * @file idd.h
  4. * @author MCD Application Team
  5. * @brief This file contains all the functions prototypes for the IDD 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 __IDD_H
  21. #define __IDD_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 IDD
  34. * @{
  35. */
  36. /** @defgroup IDD_Exported_Types IDD Exported Types
  37. * @{
  38. */
  39. /** @defgroup IDD_Config_structure IDD Configuration structure
  40. * @{
  41. */
  42. typedef struct
  43. {
  44. uint16_t AmpliGain; /*!< Specifies ampli gain value
  45. */
  46. uint16_t VddMin; /*!< Specifies minimum MCU VDD can reach to protect MCU from reset
  47. */
  48. uint16_t Shunt0Value; /*!< Specifies value of Shunt 0 if existing
  49. */
  50. uint16_t Shunt1Value; /*!< Specifies value of Shunt 1 if existing
  51. */
  52. uint16_t Shunt2Value; /*!< Specifies value of Shunt 2 if existing
  53. */
  54. uint16_t Shunt3Value; /*!< Specifies value of Shunt 3 if existing
  55. */
  56. uint16_t Shunt4Value; /*!< Specifies value of Shunt 4 if existing
  57. */
  58. uint16_t Shunt0StabDelay; /*!< Specifies delay of Shunt 0 stabilization if existing
  59. */
  60. uint16_t Shunt1StabDelay; /*!< Specifies delay of Shunt 1 stabilization if existing
  61. */
  62. uint16_t Shunt2StabDelay; /*!< Specifies delay of Shunt 2 stabilization if existing
  63. */
  64. uint16_t Shunt3StabDelay; /*!< Specifies delay of Shunt 3 stabilization if existing
  65. */
  66. uint16_t Shunt4StabDelay; /*!< Specifies delay of Shunt 4 stabilization if existing
  67. */
  68. uint8_t ShuntNbOnBoard; /*!< Specifies number of shunts that are present on board
  69. This parameter can be a value of @ref IDD_shunt_number */
  70. uint8_t ShuntNbUsed; /*!< Specifies number of shunts used for measurement
  71. This parameter can be a value of @ref IDD_shunt_number */
  72. uint8_t VrefMeasurement; /*!< Specifies if Vref is automatically measured before each Idd measurement
  73. This parameter can be a value of @ref IDD_Vref_Measurement */
  74. uint8_t Calibration; /*!< Specifies if calibration is done before each Idd measurement
  75. */
  76. uint8_t PreDelayUnit; /*!< Specifies Pre delay unit
  77. This parameter can be a value of @ref IDD_PreDelay */
  78. uint8_t PreDelayValue; /*!< Specifies Pre delay value in selected unit
  79. */
  80. uint8_t MeasureNb; /*!< Specifies number of Measure to be performed
  81. This parameter can be a value between 1 and 256 */
  82. uint8_t DeltaDelayUnit; /*!< Specifies Delta delay unit
  83. This parameter can be a value of @ref IDD_DeltaDelay */
  84. uint8_t DeltaDelayValue; /*!< Specifies Delta delay between 2 measures
  85. value can be between 1 and 128 */
  86. }IDD_ConfigTypeDef;
  87. /**
  88. * @}
  89. */
  90. /** @defgroup IDD_Driver_structure IDD Driver structure
  91. * @{
  92. */
  93. typedef struct
  94. {
  95. void (*Init)(uint16_t);
  96. void (*DeInit)(uint16_t);
  97. uint16_t (*ReadID)(uint16_t);
  98. void (*Reset)(uint16_t);
  99. void (*LowPower)(uint16_t);
  100. void (*WakeUp)(uint16_t);
  101. void (*Start)(uint16_t);
  102. void (*Config)(uint16_t,IDD_ConfigTypeDef);
  103. void (*GetValue)(uint16_t, uint32_t *);
  104. void (*EnableIT)(uint16_t);
  105. void (*ClearIT)(uint16_t);
  106. uint8_t (*GetITStatus)(uint16_t);
  107. void (*DisableIT)(uint16_t);
  108. void (*ErrorEnableIT)(uint16_t);
  109. void (*ErrorClearIT)(uint16_t);
  110. uint8_t (*ErrorGetITStatus)(uint16_t);
  111. void (*ErrorDisableIT)(uint16_t);
  112. uint8_t (*ErrorGetSrc)(uint16_t);
  113. uint8_t (*ErrorGetCode)(uint16_t);
  114. }IDD_DrvTypeDef;
  115. /**
  116. * @}
  117. */
  118. /**
  119. * @}
  120. */
  121. /**
  122. * @}
  123. */
  124. /**
  125. * @}
  126. */
  127. /**
  128. * @}
  129. */
  130. #ifdef __cplusplus
  131. }
  132. #endif
  133. #endif /* __IDD_H */
  134. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/