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.
 
 
 

105 lines
3.8 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32wbxx_hal_irda_ex.h
  4. * @author MCD Application Team
  5. * @brief Header file of IRDA HAL Extended module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2019 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 STM32WBxx_HAL_IRDA_EX_H
  21. #define STM32WBxx_HAL_IRDA_EX_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32wbxx_hal_def.h"
  27. /** @addtogroup STM32WBxx_HAL_Driver
  28. * @{
  29. */
  30. /** @defgroup IRDAEx IRDAEx
  31. * @{
  32. */
  33. /* Exported types ------------------------------------------------------------*/
  34. /* Exported constants --------------------------------------------------------*/
  35. /* Exported macros -----------------------------------------------------------*/
  36. /* Exported functions --------------------------------------------------------*/
  37. /* Private macros ------------------------------------------------------------*/
  38. /** @defgroup IRDAEx_Private_Macros IRDAEx Private Macros
  39. * @{
  40. */
  41. /** @brief Report the IRDA clock source.
  42. * @param __HANDLE__ specifies the IRDA Handle.
  43. * @param __CLOCKSOURCE__ output variable.
  44. * @retval IRDA clocking source, written in __CLOCKSOURCE__.
  45. */
  46. #define IRDA_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
  47. do { \
  48. if((__HANDLE__)->Instance == USART1) \
  49. { \
  50. switch(__HAL_RCC_GET_USART1_SOURCE()) \
  51. { \
  52. case RCC_USART1CLKSOURCE_PCLK2: \
  53. (__CLOCKSOURCE__) = IRDA_CLOCKSOURCE_PCLK2; \
  54. break; \
  55. case RCC_USART1CLKSOURCE_HSI: \
  56. (__CLOCKSOURCE__) = IRDA_CLOCKSOURCE_HSI; \
  57. break; \
  58. case RCC_USART1CLKSOURCE_SYSCLK: \
  59. (__CLOCKSOURCE__) = IRDA_CLOCKSOURCE_SYSCLK; \
  60. break; \
  61. case RCC_USART1CLKSOURCE_LSE: \
  62. (__CLOCKSOURCE__) = IRDA_CLOCKSOURCE_LSE; \
  63. break; \
  64. default: \
  65. (__CLOCKSOURCE__) = IRDA_CLOCKSOURCE_UNDEFINED; \
  66. break; \
  67. } \
  68. } \
  69. else \
  70. { \
  71. (__CLOCKSOURCE__) = IRDA_CLOCKSOURCE_UNDEFINED; \
  72. } \
  73. } while(0U)
  74. /**
  75. * @}
  76. */
  77. /* Exported functions --------------------------------------------------------*/
  78. /**
  79. * @}
  80. */
  81. /**
  82. * @}
  83. */
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif /* STM32WBxx_HAL_IRDA_EX_H */
  88. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/