main.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file : main.h
  5. * @brief : Header for main.c file.
  6. * This file contains the common defines of the application.
  7. ******************************************************************************
  8. ** This notice applies to any and all portions of this file
  9. * that are not between comment pairs USER CODE BEGIN and
  10. * USER CODE END. Other portions of this file, whether
  11. * inserted by the user or by software development tools
  12. * are owned by their respective copyright owners.
  13. *
  14. * COPYRIGHT(c) 2018 STMicroelectronics
  15. *
  16. * Redistribution and use in source and binary forms, with or without modification,
  17. * are permitted provided that the following conditions are met:
  18. * 1. Redistributions of source code must retain the above copyright notice,
  19. * this list of conditions and the following disclaimer.
  20. * 2. Redistributions in binary form must reproduce the above copyright notice,
  21. * this list of conditions and the following disclaimer in the documentation
  22. * and/or other materials provided with the distribution.
  23. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  24. * may be used to endorse or promote products derived from this software
  25. * without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  28. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  29. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  30. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  31. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  32. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  33. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  34. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  35. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  36. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. ******************************************************************************
  39. */
  40. /* USER CODE END Header */
  41. /* Define to prevent recursive inclusion -------------------------------------*/
  42. #ifndef __MAIN_H
  43. #define __MAIN_H
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. /* Includes ------------------------------------------------------------------*/
  48. #include "stm32f4xx_hal.h"
  49. /* Private includes ----------------------------------------------------------*/
  50. /* USER CODE BEGIN Includes */
  51. /* USER CODE END Includes */
  52. /* Exported types ------------------------------------------------------------*/
  53. /* USER CODE BEGIN ET */
  54. /* USER CODE END ET */
  55. /* Exported constants --------------------------------------------------------*/
  56. /* USER CODE BEGIN EC */
  57. /* USER CODE END EC */
  58. /* Exported macro ------------------------------------------------------------*/
  59. /* USER CODE BEGIN EM */
  60. /* USER CODE END EM */
  61. void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
  62. /* Exported functions prototypes ---------------------------------------------*/
  63. void Error_Handler(void);
  64. /* USER CODE BEGIN EFP */
  65. /* USER CODE END EFP */
  66. /* Private defines -----------------------------------------------------------*/
  67. #define USER_Btn_Pin GPIO_PIN_13
  68. #define USER_Btn_GPIO_Port GPIOC
  69. #define MCO_Pin GPIO_PIN_0
  70. #define MCO_GPIO_Port GPIOH
  71. #define LD3_Pin GPIO_PIN_14
  72. #define LD3_GPIO_Port GPIOB
  73. #define STLK_RX_Pin GPIO_PIN_8
  74. #define STLK_RX_GPIO_Port GPIOD
  75. #define STLK_TX_Pin GPIO_PIN_9
  76. #define STLK_TX_GPIO_Port GPIOD
  77. #define USB_PowerSwitchOn_Pin GPIO_PIN_6
  78. #define USB_PowerSwitchOn_GPIO_Port GPIOG
  79. #define USB_OverCurrent_Pin GPIO_PIN_7
  80. #define USB_OverCurrent_GPIO_Port GPIOG
  81. #define LD1_Pin GPIO_PIN_9
  82. #define LD1_GPIO_Port GPIOC
  83. #define USB_SOF_Pin GPIO_PIN_8
  84. #define USB_SOF_GPIO_Port GPIOA
  85. #define USB_VBUS_Pin GPIO_PIN_9
  86. #define USB_VBUS_GPIO_Port GPIOA
  87. #define USB_ID_Pin GPIO_PIN_10
  88. #define USB_ID_GPIO_Port GPIOA
  89. #define USB_DM_Pin GPIO_PIN_11
  90. #define USB_DM_GPIO_Port GPIOA
  91. #define USB_DP_Pin GPIO_PIN_12
  92. #define USB_DP_GPIO_Port GPIOA
  93. #define TMS_Pin GPIO_PIN_13
  94. #define TMS_GPIO_Port GPIOA
  95. #define TCK_Pin GPIO_PIN_14
  96. #define TCK_GPIO_Port GPIOA
  97. #define SWO_Pin GPIO_PIN_3
  98. #define SWO_GPIO_Port GPIOB
  99. #define LD2_Pin GPIO_PIN_7
  100. #define LD2_GPIO_Port GPIOB
  101. /* USER CODE BEGIN Private defines */
  102. /* USER CODE END Private defines */
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif /* __MAIN_H */
  107. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/