/* 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) 2021 STMicroelectronics.
* All rights reserved.
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
//#define DEBUG
#ifdef DEBUG
#define WatchDogOn 0 //是否打开看门狗
#else
#define WatchDogOn 1 //是否打开看门狗
#endif
//0----关闭看门狗SP706 1----打开看门狗SP706--------------必须配置的参数1/3
//#define WatchDogOn 1 //是否打开看门狗
//#define WatchDogOn 0 //是否打开看门狗
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
//李伟修改 20210610 远程标定命令结构体
/*
总长度为64字节;后期自己研发终端可以扩大,预计1k字节可以实现。
帧头2字节0x 3901
地址码 4字节,比如0x95510001
功能码2字节 只能是0x0003、0x0006或者0x0010
寄存器起始地址2字节:合法范围为0x0000~0xffff
数据个数2字节:最多读取0xffff字节;实际取决于终端限制,目前为256字节
保留字4字节
有效载荷44字节
保留字2字节
校验2字节
*/
typedef struct _T2C_RemoteCaliData
{
uint16_t FrameHead; //帧头 0-1
uint32_t AddrExtModule; //4字节扩展地址 2--5
uint16_t FunctionCode; //功能码2字节 只能是0x0003、0x0006或者0x0010 6--7
uint16_t AddrRegStart; //寄存器起始地址2字节:合法范围为0x0000~0xffff 8--9
uint16_t NumberOfRegs; //数据个数2字节:最多读取0xffff字节;实际取决于终端限制,目前为256字节 10--11
uint32_t ReserveData001; //保留字4字节 12--15
uint8_t PayLoadData[44+32+32]; //有效载荷具体有三种:44,或者76字节,或者108字节;字节 16--59
uint16_t ReserveData002; //保留字2字节 60--61
uint16_t CheckSum; //校验2字节 62--63
}sT2C_RemoteCaliDat;
/* USER CODE END ET */
/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
/* USER CODE END EC */
/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
/* USER CODE END EM */
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
/* USER CODE BEGIN EFP */
void delay_sys_us(uint32_t Delay);
/* USER CODE END EFP */
/* Private defines -----------------------------------------------------------*/
#define LED1_Pin GPIO_PIN_0
#define LED1_GPIO_Port GPIOA
#define LED2_Pin GPIO_PIN_1
#define LED2_GPIO_Port GPIOA
#define con03_uart2_kongzhiqi_Pin GPIO_PIN_4
#define con03_uart2_kongzhiqi_GPIO_Port GPIOA
#define con02_uart3_xieyoufa_Pin GPIO_PIN_12
#define con02_uart3_xieyoufa_GPIO_Port GPIOB
#define Con01_uart1_rankonggai_Pin GPIO_PIN_13
#define Con01_uart1_rankonggai_GPIO_Port GPIOB
#define IN01_Pin GPIO_PIN_14
#define IN01_GPIO_Port GPIOB
#define WDI_sp706_kanmemgou_Pin GPIO_PIN_10
#define WDI_sp706_kanmemgou_GPIO_Port GPIOC
/* USER CODE BEGIN Private defines */
typedef union{
float flo;
char array_u8[4];
uint32_t u32Dat;
} uni_float;//uni_temper001;//4字节浮点数表示
/* USER CODE END Private defines */
#ifdef __cplusplus
}
#endif
extern uint32_t Version_Soft[8];
#endif /* __MAIN_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/