训练营PLSR题目
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

146 linhas
5.0 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_hal_fmpsmbus_ex.c
  4. * @author MCD Application Team
  5. * @brief FMPSMBUS Extended HAL module driver.
  6. * This file provides firmware functions to manage the following
  7. * functionalities of FMPSMBUS Extended peripheral:
  8. * + Extended features functions
  9. *
  10. ******************************************************************************
  11. * @attention
  12. *
  13. * Copyright (c) 2016 STMicroelectronics.
  14. * All rights reserved.
  15. *
  16. * This software is licensed under terms that can be found in the LICENSE file
  17. * in the root directory of this software component.
  18. * If no LICENSE file comes with this software, it is provided AS-IS.
  19. *
  20. ******************************************************************************
  21. @verbatim
  22. ==============================================================================
  23. ##### FMPSMBUS peripheral Extended features #####
  24. ==============================================================================
  25. [..] Comparing to other previous devices, the FMPSMBUS interface for STM32F4xx
  26. devices contains the following additional features
  27. (+) Disable or enable Fast Mode Plus
  28. ##### How to use this driver #####
  29. ==============================================================================
  30. (#) Configure the enable or disable of fast mode plus driving capability using the functions :
  31. (++) HAL_FMPSMBUSEx_EnableFastModePlus()
  32. (++) HAL_FMPSMBUSEx_DisableFastModePlus()
  33. @endverbatim
  34. */
  35. /* Includes ------------------------------------------------------------------*/
  36. #include "stm32f4xx_hal.h"
  37. /** @addtogroup STM32F4xx_HAL_Driver
  38. * @{
  39. */
  40. /** @defgroup FMPSMBUSEx FMPSMBUSEx
  41. * @brief FMPSMBUS Extended HAL module driver
  42. * @{
  43. */
  44. #ifdef HAL_FMPSMBUS_MODULE_ENABLED
  45. #if defined(FMPI2C_CR1_PE)
  46. /* Private typedef -----------------------------------------------------------*/
  47. /* Private define ------------------------------------------------------------*/
  48. /* Private macro -------------------------------------------------------------*/
  49. /* Private variables ---------------------------------------------------------*/
  50. /* Private function prototypes -----------------------------------------------*/
  51. /* Private functions ---------------------------------------------------------*/
  52. /** @defgroup FMPSMBUSEx_Exported_Functions FMPSMBUS Extended Exported Functions
  53. * @{
  54. */
  55. /** @defgroup FMPSMBUSEx_Exported_Functions_Group3 Fast Mode Plus Functions
  56. * @brief Fast Mode Plus Functions
  57. *
  58. @verbatim
  59. ===============================================================================
  60. ##### Fast Mode Plus Functions #####
  61. ===============================================================================
  62. [..] This section provides functions allowing to:
  63. (+) Configure Fast Mode Plus
  64. @endverbatim
  65. * @{
  66. */
  67. /**
  68. * @brief Enable the FMPSMBUS fast mode plus driving capability.
  69. * @param ConfigFastModePlus Selects the pin.
  70. * This parameter can be one of the @ref FMPSMBUSEx_FastModePlus values
  71. * @note For FMPI2C1, fast mode plus driving capability can be enabled on all selected
  72. * FMPI2C1 pins using FMPSMBUS_FASTMODEPLUS_FMPI2C1 parameter or independently
  73. * on each one of the following pins PB6, PB7, PB8 and PB9.
  74. * @note For remaining FMPI2C1 pins (PA14, PA15...) fast mode plus driving capability
  75. * can be enabled only by using FMPSMBUS_FASTMODEPLUS_FMPI2C1 parameter.
  76. * @retval None
  77. */
  78. void HAL_FMPSMBUSEx_EnableFastModePlus(uint32_t ConfigFastModePlus)
  79. {
  80. /* Check the parameter */
  81. assert_param(IS_FMPSMBUS_FASTMODEPLUS(ConfigFastModePlus));
  82. /* Enable SYSCFG clock */
  83. __HAL_RCC_SYSCFG_CLK_ENABLE();
  84. /* Enable fast mode plus driving capability for selected pin */
  85. SET_BIT(SYSCFG->CFGR, (uint32_t)ConfigFastModePlus);
  86. }
  87. /**
  88. * @brief Disable the FMPSMBUS fast mode plus driving capability.
  89. * @param ConfigFastModePlus Selects the pin.
  90. * This parameter can be one of the @ref FMPSMBUSEx_FastModePlus values
  91. * @note For FMPI2C1, fast mode plus driving capability can be disabled on all selected
  92. * FMPI2C1 pins using FMPSMBUS_FASTMODEPLUS_FMPI2C1 parameter or independently
  93. * on each one of the following pins PB6, PB7, PB8 and PB9.
  94. * @note For remaining FMPI2C1 pins (PA14, PA15...) fast mode plus driving capability
  95. * can be disabled only by using FMPSMBUS_FASTMODEPLUS_FMPI2C1 parameter.
  96. * @retval None
  97. */
  98. void HAL_FMPSMBUSEx_DisableFastModePlus(uint32_t ConfigFastModePlus)
  99. {
  100. /* Check the parameter */
  101. assert_param(IS_FMPSMBUS_FASTMODEPLUS(ConfigFastModePlus));
  102. /* Enable SYSCFG clock */
  103. __HAL_RCC_SYSCFG_CLK_ENABLE();
  104. /* Disable fast mode plus driving capability for selected pin */
  105. CLEAR_BIT(SYSCFG->CFGR, (uint32_t)ConfigFastModePlus);
  106. }
  107. /**
  108. * @}
  109. */
  110. /**
  111. * @}
  112. */
  113. /**
  114. * @}
  115. */
  116. #endif /* FMPI2C_CR1_PE */
  117. #endif /* HAL_FMPSMBUS_MODULE_ENABLED */
  118. /**
  119. * @}
  120. */
  121. /**
  122. * @}
  123. */