You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.9 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  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) 2023 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_GPIOE_CLK_ENABLE();
  41. __HAL_RCC_GPIOH_CLK_ENABLE();
  42. __HAL_RCC_GPIOC_CLK_ENABLE();
  43. __HAL_RCC_GPIOA_CLK_ENABLE();
  44. __HAL_RCC_GPIOB_CLK_ENABLE();
  45. __HAL_RCC_GPIOD_CLK_ENABLE();
  46. /*Configure GPIO pin Output Level */
  47. HAL_GPIO_WritePin(DEBUG_LIGHT_GPIO_Port, DEBUG_LIGHT_Pin, GPIO_PIN_RESET);
  48. /*Configure GPIO pin Output Level */
  49. HAL_GPIO_WritePin(ETH_RST_GPIO_Port, ETH_RST_Pin, GPIO_PIN_RESET);
  50. /*Configure GPIO pin : PtPin */
  51. GPIO_InitStruct.Pin = DEBUG_LIGHT_Pin;
  52. GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  53. GPIO_InitStruct.Pull = GPIO_PULLUP;
  54. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  55. HAL_GPIO_Init(DEBUG_LIGHT_GPIO_Port, &GPIO_InitStruct);
  56. /*Configure GPIO pin : PtPin */
  57. GPIO_InitStruct.Pin = KEY1_Pin;
  58. GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
  59. GPIO_InitStruct.Pull = GPIO_PULLUP;
  60. HAL_GPIO_Init(KEY1_GPIO_Port, &GPIO_InitStruct);
  61. /*Configure GPIO pin : PtPin */
  62. GPIO_InitStruct.Pin = GENLOCK_Pin;
  63. GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
  64. GPIO_InitStruct.Pull = GPIO_NOPULL;
  65. HAL_GPIO_Init(GENLOCK_GPIO_Port, &GPIO_InitStruct);
  66. /*Configure GPIO pin : PtPin */
  67. GPIO_InitStruct.Pin = KEY0_Pin;
  68. GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
  69. GPIO_InitStruct.Pull = GPIO_PULLUP;
  70. HAL_GPIO_Init(KEY0_GPIO_Port, &GPIO_InitStruct);
  71. /*Configure GPIO pin : PtPin */
  72. GPIO_InitStruct.Pin = ETH_RST_Pin;
  73. GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  74. GPIO_InitStruct.Pull = GPIO_NOPULL;
  75. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  76. HAL_GPIO_Init(ETH_RST_GPIO_Port, &GPIO_InitStruct);
  77. }
  78. /* USER CODE BEGIN 2 */
  79. /* USER CODE END 2 */