main.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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) 2024 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 "stm32f1xx_hal.h"
  28. /* Private includes ----------------------------------------------------------*/
  29. /* USER CODE BEGIN Includes */
  30. #include "inv_mpu.h"
  31. #include "atk_ms6050.h"
  32. #include "flash.h"
  33. #include "EC800.h"
  34. #include "global.h"
  35. /* USER CODE END Includes */
  36. /* Exported types ------------------------------------------------------------*/
  37. /* USER CODE BEGIN ET */
  38. /* USER CODE END ET */
  39. /* Exported constants --------------------------------------------------------*/
  40. /* USER CODE BEGIN EC */
  41. /* USER CODE END EC */
  42. /* Exported macro ------------------------------------------------------------*/
  43. /* USER CODE BEGIN EM */
  44. /* USER CODE END EM */
  45. /* Exported functions prototypes ---------------------------------------------*/
  46. void Error_Handler(void);
  47. /* USER CODE BEGIN EFP */
  48. /* USER CODE END EFP */
  49. /* Private defines -----------------------------------------------------------*/
  50. #define NORFLASH_CS_GPIO_Pin GPIO_PIN_4
  51. #define NORFLASH_CS_GPIO_GPIO_Port GPIOC
  52. #define EN_4G_Pin GPIO_PIN_14
  53. #define EN_4G_GPIO_Port GPIOE
  54. #define RST_4G_Pin GPIO_PIN_15
  55. #define RST_4G_GPIO_Port GPIOE
  56. #define LED_R_Pin GPIO_PIN_8
  57. #define LED_R_GPIO_Port GPIOD
  58. #define LED_G_Pin GPIO_PIN_9
  59. #define LED_G_GPIO_Port GPIOD
  60. #define LED_Y_Pin GPIO_PIN_10
  61. #define LED_Y_GPIO_Port GPIOD
  62. #define OneWireCommuation_Pin GPIO_PIN_8
  63. #define OneWireCommuation_GPIO_Port GPIOA
  64. #define BEEP_Pin GPIO_PIN_0
  65. #define BEEP_GPIO_Port GPIOD
  66. #define LED_Pin GPIO_PIN_5
  67. #define LED_GPIO_Port GPIOB
  68. /* USER CODE BEGIN Private defines */
  69. #define HARD_VERSION "V1.0" // 硬件版本
  70. #define SOFT_VERSION "V1001" // 软件版本
  71. #define DEV_ID "123456789" // 设备唯一编号
  72. #define PROTOCOL_VERSION "V2.0" // 平台通信协议版本
  73. #define DEV_TYPE 4 // 设备类型
  74. // 位操作
  75. #define BIT_SET(reg, bit) ((reg) |= (1U << (bit)))
  76. #define BIT_CLEAR(reg, bit) ((reg) &= ~(1U << (bit)))
  77. #define BIT_CHECK(reg, bit) ((reg) & (1U << (bit)))
  78. /* USER CODE END Private defines */
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif /* __MAIN_H */