/* 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 "iic.h" #include "SSCMAN.h" #include //memset #include //printf #include // bool #include // 引入标准库,包含 malloc �?? free 的声�?? #include #include "FLASH.h" /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ struct thermo_save { // uint32_t Thermoelectric_couple; uint32_t thermopile; uint32_t ID; uint32_t SendT; uint32_t change; uint8_t sendflag; uint32_t sendcount; // }; typedef struct thermo_save thermo_struct; // 定义压力结构体 typedef struct { uint16_t second_threshold; // 二级警报阈值 uint8_t delay_receivedValue; // 初始上报频率 uint8_t reserve1; } FlashData; extern FlashData flash_data; /* USER CODE END ET */ /* Exported constants --------------------------------------------------------*/ /* USER CODE BEGIN EC */ extern thermo_struct thermo; #define thermo_SendT (50) /* USER CODE END EC */ /* Exported macro ------------------------------------------------------------*/ /* USER CODE BEGIN EM */ HAL_StatusTypeDef CAN_FilterInit(void); //void CAN_Send_Msg(uint8_t *msg,uint8_t len,uint32_t id); void CAN_Send_Msg(uint8_t *msg,uint8_t len,uint32_t node_id, uint8_t sequence, uint8_t slice_num, uint8_t slice_id); /* USER CODE END EM */ /* Exported functions prototypes ---------------------------------------------*/ void Error_Handler(void); /* USER CODE BEGIN EFP */ void SystemClock_Config(void); /* USER CODE END EFP */ /* Private defines -----------------------------------------------------------*/ #define CAN_SHDN_Pin GPIO_PIN_15 #define CAN_SHDN_GPIO_Port GPIOB #define CAN_RS_Pin GPIO_PIN_8 #define CAN_RS_GPIO_Port GPIOA #define IIC_SCL_Pin GPIO_PIN_9 #define IIC_SCL_GPIO_Port GPIOA #define IIC_SDA_Pin GPIO_PIN_10 #define IIC_SDA_GPIO_Port GPIOA #define LED1_Pin GPIO_PIN_4 #define LED1_GPIO_Port GPIOB /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ #ifdef __cplusplus } #endif #endif /* __MAIN_H */