gpio.c 942 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-01-15 19813 the first version
  9. */
  10. #include "gpio.h"
  11. void MX_GPIO_Init(void)
  12. {
  13. GPIO_InitTypeDef GPIO_InitStruct = {0};
  14. /* GPIO Ports Clock Enable */
  15. // __HAL_RCC_GPIOC_CLK_ENABLE();
  16. // __HAL_RCC_GPIOD_CLK_ENABLE();
  17. __HAL_RCC_GPIOA_CLK_ENABLE();
  18. __HAL_RCC_GPIOB_CLK_ENABLE();
  19. GPIO_InitStruct.Pin = FLASH_CS_Pin|Flash_CTL_Pin;
  20. GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  21. GPIO_InitStruct.Pull = GPIO_NOPULL;
  22. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  23. HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  24. GPIO_InitStruct.Pin = RUN_STATUS_Pin;
  25. GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  26. GPIO_InitStruct.Pull = GPIO_NOPULL;
  27. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  28. HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
  29. }