gpio.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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) 2023 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. /*Configure GPIO pin Output Level */
  41. HAL_GPIO_WritePin(GPIOA, RST_Pin|DC_Pin|SPI_CS_Pin|PWR_Pin, GPIO_PIN_RESET);
  42. /*Configure GPIO pins : PAPin PAPin PAPin PAPin */
  43. GPIO_InitStruct.Pin = RST_Pin|DC_Pin|SPI_CS_Pin|PWR_Pin;
  44. GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  45. GPIO_InitStruct.Pull = GPIO_NOPULL;
  46. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  47. HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  48. /*Configure GPIO pin : PtPin */
  49. GPIO_InitStruct.Pin = BUSY_Pin;
  50. GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
  51. GPIO_InitStruct.Pull = GPIO_NOPULL;
  52. HAL_GPIO_Init(BUSY_GPIO_Port, &GPIO_InitStruct);
  53. }
  54. /* USER CODE BEGIN 2 */
  55. /* USER CODE END 2 */
  56. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/