main.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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) 2019 STMicroelectronics International N.V.
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without
  18. * modification, are permitted, provided that the following conditions are met:
  19. *
  20. * 1. Redistribution of source code must retain the above copyright notice,
  21. * this list of conditions and the following disclaimer.
  22. * 2. Redistributions in binary form must reproduce the above copyright notice,
  23. * this list of conditions and the following disclaimer in the documentation
  24. * and/or other materials provided with the distribution.
  25. * 3. Neither the name of STMicroelectronics nor the names of other
  26. * contributors to this software may be used to endorse or promote products
  27. * derived from this software without specific written permission.
  28. * 4. This software, including modifications and/or derivative works of this
  29. * software, must execute solely and exclusively on microcontroller or
  30. * microprocessor devices manufactured by or for STMicroelectronics.
  31. * 5. Redistribution and use of this software other than as permitted under
  32. * this license is void and will automatically terminate your rights under
  33. * this license.
  34. *
  35. * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
  36. * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
  37. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  38. * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
  39. * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
  40. * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  41. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  42. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  43. * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  44. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  45. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  46. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  47. *
  48. ******************************************************************************
  49. */
  50. /* USER CODE END Header */
  51. /* Define to prevent recursive inclusion -------------------------------------*/
  52. #ifndef __MAIN_H
  53. #define __MAIN_H
  54. #ifdef __cplusplus
  55. extern "C" {
  56. #endif
  57. /* Includes ------------------------------------------------------------------*/
  58. #include <string.h>
  59. #include <stdbool.h>
  60. #include <stdlib.h>
  61. #include "stm32f7xx_hal.h"
  62. #define REMOTE_IAP_UPDATA 1 //是否是远程升级 //0--本地运行版本 1---远程升级版本
  63. #define WATCH_DOG_ON 1 //是否打开看门狗 //0--关闭看门狗SP706 1---打开看门狗SP706
  64. #define USE_RAM_RECORD 1 //是否启用RAM数据缓存重发机制
  65. #define USE_QUEUE_RECORD 1 //是否启用队列数据缓存重发机制
  66. #if REMOTE_IAP_UPDATA>0
  67. #define IR_ROM1 0x8080000 //APP2
  68. #else
  69. #define IR_ROM1 0x8000000 //APP1
  70. #endif
  71. #define USE_TIME_FRAM 1 //FRAM中存储时间,保证掉电时间连续
  72. #define USE_SPI_FLASH 1 //SPI FLASH W25QXX功能
  73. #if USE_SPI_FLASH
  74. #define USE_RFS_RECORD 1 //RING FS文件补传功能
  75. #else
  76. #define USE_RFS_RECORD 0 //RING FS文件补传功能
  77. #endif
  78. extern uint32_t sd000,sd001;//浮点数转换为实时显示的参数,4字节
  79. extern uint16_t uart4RxCounter; //串口4接收数据计数器
  80. /* Private includes ----------------------------------------------------------*/
  81. /* USER CODE BEGIN Includes */
  82. #define False 0
  83. #define True !False
  84. /* USER CODE END Includes */
  85. /* Exported types ------------------------------------------------------------*/
  86. /* USER CODE BEGIN ET */
  87. /* USER CODE END ET */
  88. /* Exported constants --------------------------------------------------------*/
  89. /* USER CODE BEGIN EC */
  90. /* USER CODE END EC */
  91. /* Exported macro ------------------------------------------------------------*/
  92. /* USER CODE BEGIN EM */
  93. /* USER CODE END EM */
  94. /* Exported functions prototypes ---------------------------------------------*/
  95. void Error_Handler(void);
  96. /* USER CODE BEGIN EFP */
  97. /* USER CODE END EFP */
  98. /* Private defines -----------------------------------------------------------*/
  99. #define BEEP_Pin GPIO_PIN_4
  100. #define BEEP_GPIO_Port GPIOE
  101. #define LED1_Pin GPIO_PIN_5
  102. #define LED1_GPIO_Port GPIOE
  103. #define DWI_Pin GPIO_PIN_2
  104. #define DWI_GPIO_Port GPIOC
  105. #define EN_USART2_Pin GPIO_PIN_1
  106. #define EN_USART2_GPIO_Port GPIOA
  107. #define Collect_TX_Pin GPIO_PIN_2
  108. #define Collect_TX_GPIO_Port GPIOA
  109. #define Collect_RX_Pin GPIO_PIN_3
  110. #define Collect_RX_GPIO_Port GPIOA
  111. #define Feeler_Lever_Pin GPIO_PIN_0
  112. #define Feeler_Lever_GPIO_Port GPIOB
  113. #define Feeler_Lever_EXTI_IRQn EXTI0_IRQn
  114. #define LED2_Pin GPIO_PIN_7
  115. #define LED2_GPIO_Port GPIOE
  116. #define LED3_Pin GPIO_PIN_8
  117. #define LED3_GPIO_Port GPIOE
  118. #define LED4_Pin GPIO_PIN_9
  119. #define LED4_GPIO_Port GPIOE
  120. #define LED5_Pin GPIO_PIN_10
  121. #define LED5_GPIO_Port GPIOE
  122. #define SPI4_FM25_NSS_Pin GPIO_PIN_11
  123. #define SPI4_FM25_NSS_GPIO_Port GPIOE
  124. #define SPI4_FM25_SCK_Pin GPIO_PIN_12
  125. #define SPI4_FM25_SCK_GPIO_Port GPIOE
  126. #define SPI4_FM25_MISO_Pin GPIO_PIN_13
  127. #define SPI4_FM25_MISO_GPIO_Port GPIOE
  128. #define SPI4_FM25_MOSI_Pin GPIO_PIN_14
  129. #define SPI4_FM25_MOSI_GPIO_Port GPIOE
  130. #define EN_USART3_Pin GPIO_PIN_15
  131. #define EN_USART3_GPIO_Port GPIOE
  132. #define Screen_TX_Pin GPIO_PIN_10
  133. #define Screen_TX_GPIO_Port GPIOB
  134. #define Screen_RX_Pin GPIO_PIN_11
  135. #define Screen_RX_GPIO_Port GPIOB
  136. #define Key10_Pin GPIO_PIN_10
  137. #define Key10_GPIO_Port GPIOD
  138. #define Key10_EXTI_IRQn EXTI15_10_IRQn
  139. #define Key11_Pin GPIO_PIN_11
  140. #define Key11_GPIO_Port GPIOD
  141. #define Key11_EXTI_IRQn EXTI15_10_IRQn
  142. #define Key12_Pin GPIO_PIN_12
  143. #define Key12_GPIO_Port GPIOD
  144. #define Key12_EXTI_IRQn EXTI15_10_IRQn
  145. #define Key13_Pin GPIO_PIN_13
  146. #define Key13_GPIO_Port GPIOD
  147. #define Key13_EXTI_IRQn EXTI15_10_IRQn
  148. #define EN_USART1_Pin GPIO_PIN_8
  149. #define EN_USART1_GPIO_Port GPIOC
  150. #define Terminal_TX_Pin GPIO_PIN_9
  151. #define Terminal_TX_GPIO_Port GPIOA
  152. #define Terminal_RX_Pin GPIO_PIN_10
  153. #define Terminal_RX_GPIO_Port GPIOA
  154. #define Key_TX_Pin GPIO_PIN_10
  155. #define Key_TX_GPIO_Port GPIOC
  156. #define Key_RX_Pin GPIO_PIN_11
  157. #define Key_RX_GPIO_Port GPIOC
  158. #define EN_USART4_Pin GPIO_PIN_0
  159. #define EN_USART4_GPIO_Port GPIOD
  160. /* USER CODE BEGIN Private defines */
  161. extern uint8_t StoreNumber,all_Store;
  162. void MX_FREERTOS_Init(void);
  163. /* USER CODE END Private defines */
  164. #ifdef __cplusplus
  165. }
  166. #endif
  167. #endif /* __MAIN_H */
  168. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/