main.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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 "stm32f7xx_hal.h"
  59. #include "cmsis_os.h"
  60. #ifndef IR_ROM1
  61. #define IR_ROM1 0x8000000 //APP1
  62. //#define IR_ROM1 0x8080000 //APP2
  63. #endif
  64. extern uint32_t sd000,sd001;//浮点数转换为实时显示的参数,4字节
  65. extern uint16_t uart4RxCounter; //串口4接收数据计数器
  66. /* Private includes ----------------------------------------------------------*/
  67. /* USER CODE BEGIN Includes */
  68. #define False 0
  69. #define True !False
  70. /* USER CODE END Includes */
  71. /* Exported types ------------------------------------------------------------*/
  72. /* USER CODE BEGIN ET */
  73. /* USER CODE END ET */
  74. /* Exported constants --------------------------------------------------------*/
  75. /* USER CODE BEGIN EC */
  76. /* USER CODE END EC */
  77. /* Exported macro ------------------------------------------------------------*/
  78. /* USER CODE BEGIN EM */
  79. /* USER CODE END EM */
  80. /* Exported functions prototypes ---------------------------------------------*/
  81. void Error_Handler(void);
  82. /* USER CODE BEGIN EFP */
  83. /* USER CODE END EFP */
  84. /* Private defines -----------------------------------------------------------*/
  85. #define BEEP_Pin GPIO_PIN_4
  86. #define BEEP_GPIO_Port GPIOE
  87. #define LED1_Pin GPIO_PIN_5
  88. #define LED1_GPIO_Port GPIOE
  89. #define DWI_Pin GPIO_PIN_2
  90. #define DWI_GPIO_Port GPIOC
  91. #define EN_USART2_Pin GPIO_PIN_1
  92. #define EN_USART2_GPIO_Port GPIOA
  93. #define Collect_TX_Pin GPIO_PIN_2
  94. #define Collect_TX_GPIO_Port GPIOA
  95. #define Collect_RX_Pin GPIO_PIN_3
  96. #define Collect_RX_GPIO_Port GPIOA
  97. #define Feeler_Lever_Pin GPIO_PIN_0
  98. #define Feeler_Lever_GPIO_Port GPIOB
  99. #define Feeler_Lever_EXTI_IRQn EXTI0_IRQn
  100. #define LED2_Pin GPIO_PIN_7
  101. #define LED2_GPIO_Port GPIOE
  102. #define LED3_Pin GPIO_PIN_8
  103. #define LED3_GPIO_Port GPIOE
  104. #define LED4_Pin GPIO_PIN_9
  105. #define LED4_GPIO_Port GPIOE
  106. #define LED5_Pin GPIO_PIN_10
  107. #define LED5_GPIO_Port GPIOE
  108. #define SPI4_FM25_NSS_Pin GPIO_PIN_11
  109. #define SPI4_FM25_NSS_GPIO_Port GPIOE
  110. #define SPI4_FM25_SCK_Pin GPIO_PIN_12
  111. #define SPI4_FM25_SCK_GPIO_Port GPIOE
  112. #define SPI4_FM25_MISO_Pin GPIO_PIN_13
  113. #define SPI4_FM25_MISO_GPIO_Port GPIOE
  114. #define SPI4_FM25_MOSI_Pin GPIO_PIN_14
  115. #define SPI4_FM25_MOSI_GPIO_Port GPIOE
  116. #define EN_USART3_Pin GPIO_PIN_15
  117. #define EN_USART3_GPIO_Port GPIOE
  118. #define Screen_TX_Pin GPIO_PIN_10
  119. #define Screen_TX_GPIO_Port GPIOB
  120. #define Screen_RX_Pin GPIO_PIN_11
  121. #define Screen_RX_GPIO_Port GPIOB
  122. #define Key10_Pin GPIO_PIN_10
  123. #define Key10_GPIO_Port GPIOD
  124. #define Key10_EXTI_IRQn EXTI15_10_IRQn
  125. #define Key11_Pin GPIO_PIN_11
  126. #define Key11_GPIO_Port GPIOD
  127. #define Key11_EXTI_IRQn EXTI15_10_IRQn
  128. #define Key12_Pin GPIO_PIN_12
  129. #define Key12_GPIO_Port GPIOD
  130. #define Key12_EXTI_IRQn EXTI15_10_IRQn
  131. #define Key13_Pin GPIO_PIN_13
  132. #define Key13_GPIO_Port GPIOD
  133. #define Key13_EXTI_IRQn EXTI15_10_IRQn
  134. #define EN_USART1_Pin GPIO_PIN_8
  135. #define EN_USART1_GPIO_Port GPIOC
  136. #define Terminal_TX_Pin GPIO_PIN_9
  137. #define Terminal_TX_GPIO_Port GPIOA
  138. #define Terminal_RX_Pin GPIO_PIN_10
  139. #define Terminal_RX_GPIO_Port GPIOA
  140. #define Key_TX_Pin GPIO_PIN_10
  141. #define Key_TX_GPIO_Port GPIOC
  142. #define Key_RX_Pin GPIO_PIN_11
  143. #define Key_RX_GPIO_Port GPIOC
  144. #define EN_USART4_Pin GPIO_PIN_0
  145. #define EN_USART4_GPIO_Port GPIOD
  146. /* USER CODE BEGIN Private defines */
  147. extern uint8_t StoreNumber,all_Store;
  148. /* USER CODE END Private defines */
  149. #ifdef __cplusplus
  150. }
  151. #endif
  152. #endif /* __MAIN_H */
  153. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/