/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.h * @brief : Header for main.c file. * This file contains the common defines of the application. ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32l4xx_hal.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include //memset #include //printf #include // bool #include // 引入标准库,包含 malloc �?? free 的声�?? #include #include "MLX90640_I2C_Driver.h" #include #include "FLASH.h" /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ uint16_t CalculateCRC(uint8_t *data, uint16_t length) ; void SendDataFrame(uint16_t blockNumber,float *mlx90640To) ; void uart_init(void); HAL_StatusTypeDef CAN_FilterInit(void); void CubicInterpolation1D(float *input, float *output, int inputSize, int outputSize); void CubicInterpolation2D(float *input, float *output, int width, int height); void BilinearInterpolation(float *input, float *output, int inputWidth, int inputHeight, int outputWidth, int outputHeight); /* USER CODE END ET */ /* Exported constants --------------------------------------------------------*/ /* USER CODE BEGIN EC */ void Read_NODE_ID_From_Flash(void); void Read_parameter_From_Flash(void); /* USER CODE END EC */ /* Exported macro ------------------------------------------------------------*/ /* USER CODE BEGIN EM */ void SystemClock_Config(void); /* USER CODE END EM */ /* Exported functions prototypes ---------------------------------------------*/ void Error_Handler(void); /* USER CODE BEGIN EFP */ typedef struct { uint8_t first_threshold; // 一级阈值 uint8_t second_threshold; // 二级阈值 uint8_t delay_receivedValue; // 延迟值 uint8_t Emissivity; // 发射率 } FlashData; extern FlashData flash_data; /* USER CODE END EFP */ /* Private defines -----------------------------------------------------------*/ #define mlx_power_Pin GPIO_PIN_0 #define mlx_power_GPIO_Port GPIOB #define CAN_SHDT_Pin GPIO_PIN_15 #define CAN_SHDT_GPIO_Port GPIOB #define CAN_RS_Pin GPIO_PIN_8 #define CAN_RS_GPIO_Port GPIOA #define LED1_Pin GPIO_PIN_4 #define LED1_GPIO_Port GPIOB /* USER CODE BEGIN Private defines */ #define DEBUG_MLX90640 1 // 1=enable debug print, 0=disable #if DEBUG_MLX90640 #define DEBUG_PRINTF(...) printf(__VA_ARGS__) #else #define DEBUG_PRINTF(...) #endif /* USER CODE END Private defines */ #ifdef __cplusplus } #endif #endif /* __MAIN_H */