训练营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.
 
 
 
 
 
 

81 linhas
2.3 KiB

  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file gpio.c
  5. * @brief This file provides code for the configuration
  6. * of all used GPIO pins.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2025 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Includes ------------------------------------------------------------------*/
  21. #include "gpio.h"
  22. /* USER CODE BEGIN 0 */
  23. /* USER CODE END 0 */
  24. /*----------------------------------------------------------------------------*/
  25. /* Configure GPIO */
  26. /*----------------------------------------------------------------------------*/
  27. /* USER CODE BEGIN 1 */
  28. /* USER CODE END 1 */
  29. /** Configure pins as
  30. * Analog
  31. * Input
  32. * Output
  33. * EVENT_OUT
  34. * EXTI
  35. */
  36. void MX_GPIO_Init(void)
  37. {
  38. GPIO_InitTypeDef GPIO_InitStruct = {0};
  39. /* GPIO Ports Clock Enable */
  40. __HAL_RCC_GPIOF_CLK_ENABLE();
  41. __HAL_RCC_GPIOH_CLK_ENABLE();
  42. __HAL_RCC_GPIOA_CLK_ENABLE();
  43. __HAL_RCC_GPIOG_CLK_ENABLE();
  44. __HAL_RCC_GPIOB_CLK_ENABLE();
  45. /*Configure GPIO pin Output Level */
  46. HAL_GPIO_WritePin(GPIOH, Y15_Pin|Y14_Pin|Y13_Pin|Y12_Pin, GPIO_PIN_RESET);
  47. /*Configure GPIO pins : PHPin PHPin PHPin PHPin */
  48. GPIO_InitStruct.Pin = Y15_Pin|Y14_Pin|Y13_Pin|Y12_Pin;
  49. GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  50. GPIO_InitStruct.Pull = GPIO_NOPULL;
  51. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  52. HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
  53. /*Configure GPIO pin : PG12 */
  54. GPIO_InitStruct.Pin = GPIO_PIN_12;
  55. GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
  56. GPIO_InitStruct.Pull = GPIO_NOPULL;
  57. HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
  58. /*Configure GPIO pin : PB5 */
  59. GPIO_InitStruct.Pin = GPIO_PIN_5;
  60. GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
  61. GPIO_InitStruct.Pull = GPIO_NOPULL;
  62. HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
  63. }
  64. /* USER CODE BEGIN 2 */
  65. /* USER CODE END 2 */