main.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. * Copyright (c) 2025 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. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __MAIN_H
  22. #define __MAIN_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "stm32l4xx_hal.h"
  28. /* Private includes ----------------------------------------------------------*/
  29. /* USER CODE BEGIN Includes */
  30. #include <string.h> // memset
  31. #include <stdio.h> // printf
  32. #include <stdbool.h> // bool
  33. #include <stdlib.h> // abs
  34. #include <stdint.h>
  35. #include "Printf.h"
  36. #include "MT6813CT.h"
  37. #include "DRV8837D.h"
  38. #include "led.h"
  39. #include "YHPID.h"
  40. #include "Modbussimple.h"
  41. #include "uType.h"
  42. #include "Callback.h"
  43. #include "FLASH.h"
  44. #include "tiny_md5.h"
  45. #include "iap_upgrade.h"
  46. /* USER CODE END Includes */
  47. /* Exported types ------------------------------------------------------------*/
  48. /* USER CODE BEGIN ET */
  49. void uart_enable(void);
  50. void Restart_UART1_DMA(void);
  51. /* USER CODE END ET */
  52. /* Exported constants --------------------------------------------------------*/
  53. /* USER CODE BEGIN EC */
  54. /* USER CODE END EC */
  55. /* Exported macro ------------------------------------------------------------*/
  56. /* USER CODE BEGIN EM */
  57. /* USER CODE END EM */
  58. /* Exported functions prototypes ---------------------------------------------*/
  59. void Error_Handler(void);
  60. /* USER CODE BEGIN EFP */
  61. /* USER CODE END EFP */
  62. /* Private defines -----------------------------------------------------------*/
  63. #define MOTOR_EN_Pin GPIO_PIN_2
  64. #define MOTOR_EN_GPIO_Port GPIOB
  65. #define SPI2_CS_Pin GPIO_PIN_12
  66. #define SPI2_CS_GPIO_Port GPIOB
  67. #define IBUTTON_LED_GREEN_Pin GPIO_PIN_11
  68. #define IBUTTON_LED_GREEN_GPIO_Port GPIOA
  69. #define IBUTTON_LED_RED_Pin GPIO_PIN_12
  70. #define IBUTTON_LED_RED_GPIO_Port GPIOA
  71. #define RS485_RE_Pin GPIO_PIN_5
  72. #define RS485_RE_GPIO_Port GPIOB
  73. #define LED_GREEN_Pin GPIO_PIN_6
  74. #define LED_GREEN_GPIO_Port GPIOB
  75. #define LED_RED_Pin GPIO_PIN_7
  76. #define LED_RED_GPIO_Port GPIOB
  77. /* USER CODE BEGIN Private defines */
  78. /* USER CODE END Private defines */
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif /* __MAIN_H */