main.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 "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> // 引入标准库,包含 malloc �?? free 的声�??
  34. #include <math.h>
  35. #include "MLX90640_I2C_Driver.h"
  36. #include <MLX90640_API.h>
  37. #include "FLASH.h"
  38. /* USER CODE END Includes */
  39. /* Exported types ------------------------------------------------------------*/
  40. /* USER CODE BEGIN ET */
  41. uint16_t CalculateCRC(uint8_t *data, uint16_t length) ;
  42. void SendDataFrame(uint16_t blockNumber,float *mlx90640To) ;
  43. void uart_init(void);
  44. HAL_StatusTypeDef CAN_FilterInit(void);
  45. void CubicInterpolation1D(float *input, float *output, int inputSize, int outputSize);
  46. void CubicInterpolation2D(float *input, float *output, int width, int height);
  47. void BilinearInterpolation(float *input, float *output, int inputWidth, int inputHeight, int outputWidth, int outputHeight);
  48. /* USER CODE END ET */
  49. /* Exported constants --------------------------------------------------------*/
  50. /* USER CODE BEGIN EC */
  51. void Read_NODE_ID_From_Flash(void);
  52. void Read_parameter_From_Flash(void);
  53. /* USER CODE END EC */
  54. /* Exported macro ------------------------------------------------------------*/
  55. /* USER CODE BEGIN EM */
  56. void SystemClock_Config(void);
  57. /* USER CODE END EM */
  58. /* Exported functions prototypes ---------------------------------------------*/
  59. void Error_Handler(void);
  60. /* USER CODE BEGIN EFP */
  61. typedef struct {
  62. uint8_t first_threshold; // 一级阈值
  63. uint8_t second_threshold; // 二级阈值
  64. uint8_t delay_receivedValue; // 延迟值
  65. uint8_t Emissivity; // 发射率
  66. } FlashData;
  67. extern FlashData flash_data;
  68. /* USER CODE END EFP */
  69. /* Private defines -----------------------------------------------------------*/
  70. #define mlx_power_Pin GPIO_PIN_0
  71. #define mlx_power_GPIO_Port GPIOB
  72. #define CAN_SHDT_Pin GPIO_PIN_15
  73. #define CAN_SHDT_GPIO_Port GPIOB
  74. #define CAN_RS_Pin GPIO_PIN_8
  75. #define CAN_RS_GPIO_Port GPIOA
  76. #define LED1_Pin GPIO_PIN_4
  77. #define LED1_GPIO_Port GPIOB
  78. /* USER CODE BEGIN Private defines */
  79. #define DEBUG_MLX90640 1 // 1=enable debug print, 0=disable
  80. #if DEBUG_MLX90640
  81. #define DEBUG_PRINTF(...) printf(__VA_ARGS__)
  82. #else
  83. #define DEBUG_PRINTF(...)
  84. #endif
  85. /* USER CODE END Private defines */
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89. #endif /* __MAIN_H */