1
0

gpio.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. ******************************************************************************
  3. * File Name : gpio.c
  4. * Description : This file provides code for the configuration
  5. * of all used GPIO pins.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2022 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. /* Includes ------------------------------------------------------------------*/
  20. #include "gpio.h"
  21. /* USER CODE BEGIN 0 */
  22. /* USER CODE END 0 */
  23. /*----------------------------------------------------------------------------*/
  24. /* Configure GPIO */
  25. /*----------------------------------------------------------------------------*/
  26. /* USER CODE BEGIN 1 */
  27. /* USER CODE END 1 */
  28. /** Configure pins
  29. */
  30. void MX_GPIO_Init(void)
  31. {
  32. GPIO_InitTypeDef GPIO_InitStruct = {0};
  33. /* GPIO Ports Clock Enable */
  34. __HAL_RCC_GPIOA_CLK_ENABLE();
  35. __HAL_RCC_GPIOD_CLK_ENABLE();
  36. __HAL_RCC_GPIOC_CLK_ENABLE();
  37. __HAL_RCC_GPIOB_CLK_ENABLE();
  38. /*Configure GPIO pin Output Level */
  39. HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET);
  40. /*Configure GPIO pins : PD12 PD13 PD14 PD15 */
  41. GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
  42. GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  43. GPIO_InitStruct.Pull = GPIO_NOPULL;
  44. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  45. HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
  46. }
  47. /* USER CODE BEGIN 2 */
  48. /* USER CODE END 2 */
  49. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/