diff options
Diffstat (limited to 'Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/Src/stm32wbxx_hal_msp.c')
-rw-r--r-- | Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/Src/stm32wbxx_hal_msp.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/Src/stm32wbxx_hal_msp.c index cb9aeaf0d..212dee04c 100644 --- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/Src/stm32wbxx_hal_msp.c +++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/Src/stm32wbxx_hal_msp.c @@ -7,13 +7,12 @@ ****************************************************************************** * @attention * - * <h2><center>© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.</center></h2> + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ @@ -83,6 +82,7 @@ void HAL_MspInit(void) void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c) { GPIO_InitTypeDef GPIO_InitStruct = {0}; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; if(hi2c->Instance==I2C1) { /* USER CODE BEGIN I2C1_MspInit 0 */ @@ -104,6 +104,14 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c) RCC_PeriphCLKInitStruct.I2c1ClockSelection = RCC_I2C1CLKSOURCE_HSI; HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct); /* USER CODE END I2C1_MspInit 0 */ + /** Initializes the peripherals clock + */ + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2C1; + PeriphClkInitStruct.I2c1ClockSelection = RCC_I2C1CLKSOURCE_HSI; + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) + { + Error_Handler(); + } __HAL_RCC_GPIOB_CLK_ENABLE(); /**I2C1 GPIO Configuration @@ -168,5 +176,3 @@ void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c) /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |