25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

68 lines
2.0 KiB

  1. /**
  2. ******************************************************************************
  3. * @file gpio.c
  4. * @brief This file provides code for the configuration
  5. * of all used GPIO pins.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2021 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 as
  29. * Analog
  30. * Input
  31. * Output
  32. * EVENT_OUT
  33. * EXTI
  34. */
  35. void MX_GPIO_Init(void)
  36. {
  37. GPIO_InitTypeDef GPIO_InitStruct = {0};
  38. /* GPIO Ports Clock Enable */
  39. __HAL_RCC_GPIOA_CLK_ENABLE();
  40. __HAL_RCC_GPIOH_CLK_ENABLE();
  41. __HAL_RCC_GPIOF_CLK_ENABLE();
  42. /*Configure GPIO pin Output Level */
  43. HAL_GPIO_WritePin(GPIOF, GPIO_PIN_7|GPIO_PIN_6|GPIO_PIN_8, GPIO_PIN_SET);
  44. /*Configure GPIO pins : PF7 PF6 PF8 */
  45. GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_6|GPIO_PIN_8;
  46. GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  47. GPIO_InitStruct.Pull = GPIO_NOPULL;
  48. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  49. HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
  50. }
  51. /* USER CODE BEGIN 2 */
  52. /* USER CODE END 2 */
  53. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/