main.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software component is licensed by ST under Ultimate Liberty license
  14. * SLA0044, the "License"; You may not use this file except in compliance with
  15. * the License. You may obtain a copy of the License at:
  16. * www.st.com/SLA0044
  17. *
  18. ******************************************************************************
  19. */
  20. /* USER CODE END Header */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __MAIN_H
  23. #define __MAIN_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f1xx_hal.h"
  29. #include "motorcontrol.h"
  30. /* Private includes ----------------------------------------------------------*/
  31. /* USER CODE BEGIN Includes */
  32. /* USER CODE END Includes */
  33. /* Exported types ------------------------------------------------------------*/
  34. /* USER CODE BEGIN ET */
  35. /* USER CODE END ET */
  36. /* Exported constants --------------------------------------------------------*/
  37. /* USER CODE BEGIN EC */
  38. /* USER CODE END EC */
  39. /* Exported macro ------------------------------------------------------------*/
  40. /* USER CODE BEGIN EM */
  41. /* USER CODE END EM */
  42. void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
  43. /* Exported functions prototypes ---------------------------------------------*/
  44. void Error_Handler(void);
  45. /* USER CODE BEGIN EFP */
  46. /* USER CODE END EFP */
  47. /* Private defines -----------------------------------------------------------*/
  48. #define M1_HALL_H1_Pin GPIO_PIN_0
  49. #define M1_HALL_H1_GPIO_Port GPIOA
  50. #define M1_HALL_H2_Pin GPIO_PIN_1
  51. #define M1_HALL_H2_GPIO_Port GPIOA
  52. #define M1_HALL_H3_Pin GPIO_PIN_2
  53. #define M1_HALL_H3_GPIO_Port GPIOA
  54. #define M1_BUS_VOLTAGE_Pin GPIO_PIN_3
  55. #define M1_BUS_VOLTAGE_GPIO_Port GPIOA
  56. #define M1_CURR_AMPL_U_Pin GPIO_PIN_5
  57. #define M1_CURR_AMPL_U_GPIO_Port GPIOA
  58. #define M1_CURR_AMPL_V_Pin GPIO_PIN_6
  59. #define M1_CURR_AMPL_V_GPIO_Port GPIOA
  60. #define M1_CURR_AMPL_W_Pin GPIO_PIN_7
  61. #define M1_CURR_AMPL_W_GPIO_Port GPIOA
  62. #define M1_OCP_Pin GPIO_PIN_12
  63. #define M1_OCP_GPIO_Port GPIOB
  64. #define M1_PWM_UL_Pin GPIO_PIN_13
  65. #define M1_PWM_UL_GPIO_Port GPIOB
  66. #define M1_PWM_VL_Pin GPIO_PIN_14
  67. #define M1_PWM_VL_GPIO_Port GPIOB
  68. #define M1_PWM_WL_Pin GPIO_PIN_15
  69. #define M1_PWM_WL_GPIO_Port GPIOB
  70. #define M1_PWM_UH_Pin GPIO_PIN_8
  71. #define M1_PWM_UH_GPIO_Port GPIOA
  72. #define M1_PWM_VH_Pin GPIO_PIN_9
  73. #define M1_PWM_VH_GPIO_Port GPIOA
  74. #define M1_PWM_WH_Pin GPIO_PIN_10
  75. #define M1_PWM_WH_GPIO_Port GPIOA
  76. #define UART_TX_Pin GPIO_PIN_6
  77. #define UART_TX_GPIO_Port GPIOB
  78. #define UART_RX_Pin GPIO_PIN_7
  79. #define UART_RX_GPIO_Port GPIOB
  80. /* USER CODE BEGIN Private defines */
  81. /* USER CODE END Private defines */
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85. #endif /* __MAIN_H */
  86. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/