65 lines
1.8 KiB
C
65 lines
1.8 KiB
C
/*
|
|
******************************************************************************
|
|
*
|
|
* @file user.h
|
|
* @brief user module
|
|
* @ic sy8835
|
|
*
|
|
* @version 1.0
|
|
* @date 2024/11/01 09:59:40
|
|
* @author Alex Xu
|
|
*
|
|
* Copyright (c) 2013-2099,Tkplusemi Technology Co.,Ltd.
|
|
* All Rights Reserved
|
|
*
|
|
* History:
|
|
* Revision Date Author Desc
|
|
* 1.0.0 2024/11/01 Alex Xu build this file
|
|
******************************************************************************
|
|
*/
|
|
#ifndef __USER_H__
|
|
#define __USER_H__
|
|
|
|
/*_____ I N C L U D E S ____________________________________________________*/
|
|
|
|
//#include "i2c_simu.h"
|
|
#include "define.h"
|
|
|
|
/******************************************************************************\
|
|
Macro definitions
|
|
\******************************************************************************/
|
|
#define QUEUE_SIZE 8 //队列长度
|
|
/******************************************************************************\
|
|
Variables definitions
|
|
\******************************************************************************/
|
|
typedef struct
|
|
{
|
|
char qFront; //队列
|
|
|
|
char qRear; //队尾
|
|
|
|
int BasicArr[QUEUE_SIZE]; //队列数组
|
|
|
|
}SeqQueue;
|
|
|
|
extern idata SeqQueue Queue;
|
|
|
|
/******************************************************************************\
|
|
Functions definitions
|
|
\******************************************************************************/
|
|
|
|
extern void ExtSfr_Write(u8 reg_addr,u8 _dat);
|
|
|
|
extern u8 ExtSfr_Read(u8 reg_addr);
|
|
|
|
extern void InitQueue(SeqQueue *queue);
|
|
|
|
extern char PushQueue(SeqQueue *queue, int value);
|
|
|
|
extern char PopQueue(SeqQueue *queue);
|
|
|
|
extern int AddQueue(SeqQueue *queue);
|
|
|
|
#endif
|
|
|