You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

121 lines
5.3 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32l0xx_hal_lptim_ex.h
  4. * @author MCD Application Team
  5. * @brief Header file of LPTIM Extended HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright(c) 2016 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 __STM32L0xx_HAL_LPTIM_EX_H
  21. #define __STM32L0xx_HAL_LPTIM_EX_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32l0xx_hal_def.h"
  27. /** @addtogroup STM32L0xx_HAL_Driver
  28. * @{
  29. */
  30. /** @defgroup LPTIMEx LPTIMEx
  31. * @{
  32. */
  33. /* Exported constants --------------------------------------------------------*/
  34. /** @defgroup LPTIMEx_Exported_Constants LPTIMEx Exported Constants
  35. * @{
  36. */
  37. /** @defgroup LPTIMEx_Trigger_Source LPTIMEx Trigger source
  38. * @{
  39. */
  40. #define LPTIM_TRIGSOURCE_SOFTWARE 0x0000FFFFU /*!< LPTIM counter triggered by software*/
  41. #define LPTIM_TRIGSOURCE_0 0x00000000U /*!< LPTIM counter triggered by GPIO (alternate function LPTIM_ETR) */
  42. #define LPTIM_TRIGSOURCE_1 LPTIM_CFGR_TRIGSEL_0 /*!< LPTIM counter triggered by RTC alarm A */
  43. #define LPTIM_TRIGSOURCE_2 LPTIM_CFGR_TRIGSEL_1 /*!< LPTIM counter triggered by RTC alarm B */
  44. #define LPTIM_TRIGSOURCE_3 (LPTIM_CFGR_TRIGSEL_0 | LPTIM_CFGR_TRIGSEL_1) /*!< LPTIM counter triggered by RTC_TAMP1 input detection */
  45. #define LPTIM_TRIGSOURCE_4 LPTIM_CFGR_TRIGSEL_2 /*!< LPTIM counter triggered by RTC_TAMP2 input detection */
  46. #if defined(RTC_TAMPER3_SUPPORT)
  47. #define LPTIM_TRIGSOURCE_5 (LPTIM_CFGR_TRIGSEL_0 | LPTIM_CFGR_TRIGSEL_2) /*!< LPTIM counter triggered by RTC_TAMP3 input detection */
  48. #endif /* RTC_TAMPER3_SUPPORT */
  49. #if defined(COMP1) && defined(COMP2)
  50. #define LPTIM_TRIGSOURCE_6 (LPTIM_CFGR_TRIGSEL_1 | LPTIM_CFGR_TRIGSEL_2) /*!< LPTIM counter triggered by COMP1_OUT */
  51. #define LPTIM_TRIGSOURCE_7 LPTIM_CFGR_TRIGSEL /*!< LPTIM counter triggered by COMP2_OUT */
  52. #endif /* COMP1 && COMP2 */
  53. /**
  54. * @}
  55. */
  56. /**
  57. * @}
  58. */
  59. /** @addtogroup LPTIMEx_Private
  60. * @{
  61. */
  62. #if defined(RTC_TAMPER3_SUPPORT) && defined(COMP1) && defined(COMP2)
  63. #define IS_LPTIM_TRG_SOURCE(__TRIG__) (((__TRIG__) == LPTIM_TRIGSOURCE_SOFTWARE) || \
  64. ((__TRIG__) == LPTIM_TRIGSOURCE_0) || \
  65. ((__TRIG__) == LPTIM_TRIGSOURCE_1) || \
  66. ((__TRIG__) == LPTIM_TRIGSOURCE_2) || \
  67. ((__TRIG__) == LPTIM_TRIGSOURCE_3) || \
  68. ((__TRIG__) == LPTIM_TRIGSOURCE_4) || \
  69. ((__TRIG__) == LPTIM_TRIGSOURCE_5) || \
  70. ((__TRIG__) == LPTIM_TRIGSOURCE_6) || \
  71. ((__TRIG__) == LPTIM_TRIGSOURCE_7))
  72. #elif defined(RTC_TAMPER3_SUPPORT)
  73. #define IS_LPTIM_TRG_SOURCE(__TRIG__) (((__TRIG__) == LPTIM_TRIGSOURCE_SOFTWARE) || \
  74. ((__TRIG__) == LPTIM_TRIGSOURCE_0) || \
  75. ((__TRIG__) == LPTIM_TRIGSOURCE_1) || \
  76. ((__TRIG__) == LPTIM_TRIGSOURCE_2) || \
  77. ((__TRIG__) == LPTIM_TRIGSOURCE_3) || \
  78. ((__TRIG__) == LPTIM_TRIGSOURCE_4) || \
  79. ((__TRIG__) == LPTIM_TRIGSOURCE_5))
  80. #else
  81. #define IS_LPTIM_TRG_SOURCE(__TRIG__) (((__TRIG__) == LPTIM_TRIGSOURCE_SOFTWARE) || \
  82. ((__TRIG__) == LPTIM_TRIGSOURCE_0) || \
  83. ((__TRIG__) == LPTIM_TRIGSOURCE_1) || \
  84. ((__TRIG__) == LPTIM_TRIGSOURCE_2) || \
  85. ((__TRIG__) == LPTIM_TRIGSOURCE_3) || \
  86. ((__TRIG__) == LPTIM_TRIGSOURCE_4) || \
  87. ((__TRIG__) == LPTIM_TRIGSOURCE_6) || \
  88. ((__TRIG__) == LPTIM_TRIGSOURCE_7))
  89. #endif /* RTC_TAMPER3_SUPPORT && COMP1 && COMP2 */
  90. /**
  91. * @}
  92. */
  93. /**
  94. * @}
  95. */
  96. /**
  97. * @}
  98. */
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102. #endif /* __STM32L0xx_HAL_LPTIM_EX_H */
  103. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/