main.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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> // uint8_t
  35. #include "Printf.h"
  36. #include "led.h"
  37. #include "Modbussimple.h"
  38. #include "uType.h"
  39. #include "Callback.h"
  40. #include "FLASH.h"
  41. #include "tiny_md5.h"
  42. #include "iap_upgrade.h"
  43. //#include "lt_fdc2214_iic.h"
  44. #include "lt_fdc2214.h"
  45. #include "Tlt_fdc2214.h"
  46. //#include "ADS1256.h" // 硬件SPI
  47. //#include "ADS1256_soft.h"
  48. #include "ADS1256tb.h"
  49. #include "filter.h"
  50. #include "ntc_temperature.h"
  51. #include "calib_piecewise_linear.h"
  52. #include "kv_flash.h"
  53. #include "task_monitor.h"
  54. /* USER CODE END Includes */
  55. /* Exported types ------------------------------------------------------------*/
  56. /* USER CODE BEGIN ET */
  57. void Restart_UART2_DMA(void);
  58. void Restart_UART1_DMA(void);
  59. /* USER CODE END ET */
  60. /* Exported constants --------------------------------------------------------*/
  61. /* USER CODE BEGIN EC */
  62. /* USER CODE END EC */
  63. /* Exported macro ------------------------------------------------------------*/
  64. /* USER CODE BEGIN EM */
  65. /* USER CODE END EM */
  66. /* Exported functions prototypes ---------------------------------------------*/
  67. void Error_Handler(void);
  68. /* USER CODE BEGIN EFP */
  69. /* USER CODE END EFP */
  70. /* Private defines -----------------------------------------------------------*/
  71. #define ADS_DRDY_Pin GPIO_PIN_0
  72. #define ADS_DRDY_GPIO_Port GPIOA
  73. #define SPI_CS_Pin GPIO_PIN_4
  74. #define SPI_CS_GPIO_Port GPIOA
  75. #define ADS_RST_Pin GPIO_PIN_0
  76. #define ADS_RST_GPIO_Port GPIOB
  77. #define ADS_PDMN_Pin GPIO_PIN_1
  78. #define ADS_PDMN_GPIO_Port GPIOB
  79. #define FDC_SLEEP1_Pin GPIO_PIN_2
  80. #define FDC_SLEEP1_GPIO_Port GPIOB
  81. #define IIC_SCL_Pin GPIO_PIN_10
  82. #define IIC_SCL_GPIO_Port GPIOB
  83. #define IIC_SDA_Pin GPIO_PIN_11
  84. #define IIC_SDA_GPIO_Port GPIOB
  85. #define LED_R_Pin GPIO_PIN_12
  86. #define LED_R_GPIO_Port GPIOB
  87. #define LED_G_Pin GPIO_PIN_13
  88. #define LED_G_GPIO_Port GPIOB
  89. #define RS485_RD_Pin GPIO_PIN_11
  90. #define RS485_RD_GPIO_Port GPIOA
  91. #define BootLED_Pin GPIO_PIN_15
  92. #define BootLED_GPIO_Port GPIOA
  93. #define FDC_SLEEP2_Pin GPIO_PIN_5
  94. #define FDC_SLEEP2_GPIO_Port GPIOB
  95. #define IIC_SCL2_Pin GPIO_PIN_6
  96. #define IIC_SCL2_GPIO_Port GPIOB
  97. #define IIC_SDA2_Pin GPIO_PIN_7
  98. #define IIC_SDA2_GPIO_Port GPIOB
  99. /* USER CODE BEGIN Private defines */
  100. /* USER CODE END Private defines */
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104. #endif /* __MAIN_H */