⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gentype.h

📁 CRC采用比特型算法
💻 H
字号:
/*****************************************************************************
*  Copyright 2006 by TCB_TJU Software Development Group.All rights reserved. *
*                                                                            *
*  This program  is  a  confidential  and  valuable  property  of  TCB_TJU   *
*  Software  Development  Group  that  is  protected  under  international   *
*  and  Chinese copyright laws.   All use,  reproduction and/or disclosure   *
*  in whole or in any part  of this  program is strictly prohibited unless   *
*  expressly  authorized  in writing by TCB_TJU Software development group.  *
*****************************************************************************/
/*****************************************************************************
*    File Name : GENTYPE.H                                                   *
*    Description : This is a general header file for new type define         *
******************************************************************************/
/*****************************************************************************
*    Modification History :                                                  *
*    2006, May 26    drafted   by Wenxiong Xiao                              *
*                                                                            *                    
******************************************************************************/

#ifndef _GENTYPE_H
#define _GENTYPE_H

#ifndef FALSE
#define FALSE                 (0)
#endif
#ifndef TRUE
#define TRUE                  (1)
#endif

/*-- Global type definition for bit sensitive data ------------*/
typedef unsigned char         UCHAR;  /* Unsigned 8 bit data   */
typedef signed char           SCHAR;  /* Signed 8 bit data     */
typedef char           	      CHAR;   /* 8 bit char		*/

typedef unsigned short int    USINT;  /* Unsigned 16 bit data  */
typedef signed short int      SINT;  /* Signed 16 bit data    */

typedef unsigned long         ULINT; /* Unsigned 32 bit data  */
typedef signed long           SLINT; /* Signed 32 bit data    */

/*---------- DSP data type definition in fixed point ----------*/
typedef SINT                  QSINT;
typedef SLINT                 QSLINT;
/*------------------- End of DSP data type definition ---------*/

typedef QSINT				Q15;

#define q15_MAX				(32767)
#define q15_MIN				(-32768)

#define Q_MAX				(32767)
#define Q_MIN				(-32767)     

#define QD_MAX				(QSLINT)(0x3FFFFFFF)	/* 1073741823 */
#define QD_MIN				(QSLINT)(-1073741823)	/* 0xC000 0000 */

// saturate a Q in QD form
#define Q_SAT(x)			{ if      ((x)>Q_MAX)   (x)=Q_MAX;   else if ((x)<Q_MIN)   (x)=Q_MIN;  }

// saturate a QD 
#define QD_SAT(d)			{ if      ((d)>QD_MAX)  (d)=QD_MAX;  else if ((d)<QD_MIN)    (d)=QD_MIN; }

#define QROUND_SAT(d)		{ (d) = ((d)+0x4000)>>15; if      ((d)>Q_MAX) (d)=Q_MAX; else if ((d)<Q_MIN) (d)=Q_MIN;  }
#define QROUNDT(d)			{ (d) = ((d)+0x4000)>>15; }

#define Q_ABS(x)			(((x)<0)?(-(x)):(x))

#define CONST				const


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -