Files

88 lines
2.7 KiB
C

/**
******************************************************************************
* @file main.h
* @author MCU Application Team
* @brief Header for main.c file.
* This file contains the common defines of the application.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co.
* All rights reserved.</center></h2>
*
* This software component is licensed by Puya under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "log.h"
#include "py32f040xx_Start_Kit.h"
#include "py32f0xx_hal.h"
#include "jb_uart.h"
#include "jb_timer.h"
#include "jb_product.h"
#include "jb_protocol.h"
#include <stdbool.h>
#include <stdint.h>
/* Private includes ----------------------------------------------------------*/
/* Private defines -----------------------------------------------------------*/
/* Exported variables prototypes ---------------------------------------------*/
/* Exported functions prototypes ---------------------------------------------*/
typedef enum
{
STATUS_SUCCESS,
STATUS_ERROR,
STATUS_OVERFLOW,
STATUS_WAIT,
STATUS_TIMEOUT,
// 可以继续添加其他状态
} User_StatusTypeDef;
/* Exported functions prototypes ---------------------------------------------*/
/**
* @brief 错误处理函数
* @param *file:文件名,line:行号
* @return None
*/
void Error_Handler(uint8_t *file, uint32_t line);
/**
* @brief 计算时间差
* @param meiosis:需要比较的时间戳,用于计算时间差
* @retval 时间差
*/
uint32_t HAL_GetTickDiff(uint32_t meiosis);
#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */
/************************ (C) COPYRIGHT Puya *****END OF FILE******************/