📄 dsptyp.h
字号:
/*******************************************************************************
* File Name: dsptyp.h
* Description:
PLKD_TYP.h SCH Basic types used throughout DSP kernel and also DSP
clients.
* Copyright:
Copyright (c) 2003 LONICOM, Incorporated and its licensors. All Rights
Reserved. LONICOM Proprietary. Export of this technology or software is
regulated by the P.R.C Government. Diversion contrary to P.R.C law
prohibited.
* Change History:
* Date Author Release Description
2007-08-24 Create
*******************************************************************************/
#if ! defined(DSPTYP_H)
#define DSPTYP_H
/****************************************************************************
* Nested Include Files
****************************************************************************/
/****************************************************************************
* 1. C Types
****************************************************************************/
/*
** The NULL POINTER
*/
#define PNULL ((void *) 0)
/*** Char *********************************************************/
/*
** This type is an 8 bit unsigned integer containing ascii values
*/
typedef unsigned char Char;
/*** Int8 *********************************************************/
/*
** This type is an 8 bit unsigned integer value
*/
typedef unsigned char Int8;
typedef signed char SignedInt8;
/*** Int16 ********************************************************/
/*
** This type MUST always be a 16 bit unsigned value. The following
** pre-processor commands will trap any compiler which does not
** use 16 bits for an unsigned short.
*/
typedef unsigned short Int16;
typedef signed short SignedInt16;
/*** Int32 ********************************************************/
/*
** This type MUST always be a 32 bit unsigned value. The following
** pre-processor commands will trap any compiler which does not
** use 32 bits for an unsigned long.
*/
typedef unsigned int Int32;
typedef signed int SignedInt32;
/*** Boolean ******************************************************/
typedef Int8 Boolean;
#if !defined (FALSE)
#define FALSE (0)
#endif
#if !defined (TRUE)
#define TRUE (1)
#endif
/****************************************************************************
* 2. SHM Types
****************************************************************************/
typedef Int16 ShmInt16;
typedef SignedInt16 SignedShmInt16;
typedef ShmInt16 FrBufHandle;
typedef struct
{
ShmInt16 lo;
ShmInt16 hi;
} McuPtr;
#define ALIGNMENT ShmInt16
/****************************************************************************
* 3. DSP CORE PROCESS Types
****************************************************************************/
#if defined(LOMPS_USE_OPTIMISED_C_FPARITH)
typedef long SignedInt40;
#endif
/* these definitions are in terms of the types from dsptyp.h */
typedef struct
{
Int32 lo;
SignedInt32 hi;
} SignedInt64;
/* unsigned types */
typedef Int16 UnSigned_1b15; /* Sixteen bits, from 2^1 to 2^-15 */
typedef Int16 UnSigned_16b0; /* Sixteen bits, from 2^16 to 2^0 */
typedef Int16 UnSigned_0b16; /* Sixteen bits, from 2^0 to 2^-16 */
typedef Int32 UnSigned_1b31; /* Thirty-two bits, from 2^1 to 2^-31 */
typedef Int32 UnSigned_16b16; /* Thirty-two bits, from 2^16 to 2^-16 */
/* signed <= 16 bit types */
//typedef SignedInt16 Signed_1b5; /* Six bits, from -2^0 to 2^-5. Stored as Signed_1b15 */ jiyp modified for conflict define with sl1def.h
typedef SignedInt16 Signed_n15b31; /* Sixteen bits, from -2^-15 to 2^-31 */
//typedef SignedInt16 Signed_1b15; /* Sixteen bits, from -2^0 to 2^-15 */
typedef SignedInt16 Signed_2b14; /* Sixteen bits, from -2^1 to 2^-14 */
typedef SignedInt16 Signed_5b11; /* Sixteen bits, from -2^4 to 2^-11 */
typedef SignedInt16 Signed_8b8; /* Sixteen bits, from -2^7 to 2^-8 */
typedef SignedInt16 Signed_12b4; /* Sixteen bits, from -2^11 to 2^-4 */
typedef SignedInt16 Signed_16b0; /* Sixteen bits, from -2^15 to 2^0 */
/* signed 32 bit types */
typedef SignedInt32 Signed_1b31; /* Thirty-two bits, from -2^0 to 2^-31 */
typedef SignedInt32 Signed_8b15; /* Twenty-three bits, from -2^7 to 2^-15 */
typedef SignedInt32 Signed_9b15; /* Twenty-four bits, from -2^8 to 2^-15 */
typedef SignedInt32 Signed_16b16; /* Thirty-two bits, from -2^15 to 2^-16 */
typedef SignedInt32 Signed_17b15; /* Thirty-two bits, from -2^16 to 2^-15 */
typedef SignedInt32 Signed_32b0; /* Thirty-two bits, from -2^31 to 2^0 */
#if defined(LOMPS_USE_OPTIMISED_C_FPARITH)
/* signed 40 bit types */
typedef SignedInt40 Signed_9b31; /* Forty bits, from -2^8 to 2^-31 */
typedef SignedInt40 Signed_40b0; /* Forty bits, from -2^39 to 2^0 */
#else
/* signed 40 bit types - these are sign extended to 64 bits */
typedef SignedInt64 Signed_9b31; /* Forty bits, from -2^8 to 2^-31 */
typedef SignedInt64 Signed_40b0; /* Forty bits, from -2^39 to 2^0 */
#endif
/* signed 48 bit types - these are sign extended to 64 bits */
typedef SignedInt64 Signed_33b15; /* Forty-eight bits, from -2^32 to 2^-15 */
/* and the odd flag type */
typedef SignedInt32 Flag;
/* 16 bit complex integer types */
typedef struct ComplexSigned_16b0
{
Signed_16b0 real;
Signed_16b0 imag;
} ComplexSigned_16b0;
/* 16 bit complex fractional types */
/*typedef struct ComplexSigned_1b15
{
Signed_1b15 real;
Signed_1b15 imag;
} ComplexSigned_1b15; jiyp modified for conflict define with sl1def.h*/
/* 32 bit complex fractional types */
typedef struct ComplexSigned_1b31
{
Signed_1b31 real;
Signed_1b31 imag;
} ComplexSigned_1b31;
/* 40 bit complex fractional types */
typedef struct ComplexSigned_9b31
{
Signed_9b31 real;
Signed_9b31 imag;
} ComplexSigned_9b31;
#if 0
/* Complex Floating-point types */
typedef struct ComplexFloat
{
Float real;
Float imag;
} ComplexFloat;
typedef struct ComplexDouble
{
Double real;
Double imag;
} ComplexDouble;
/* Complex integer types */
typedef struct ComplexInt16
{
Int16 real;
Int16 imag;
} ComplexInt16;
#endif
typedef struct ComplexSignedInt16
{
SignedInt16 real;
SignedInt16 imag;
} ComplexSignedInt16;
#if defined(LOMPS_UPGRADE_ENHANCED_ECHO_CONTROL)
/* #if defined(LOMPS_ENABLE_ECHO_CANCELLATION) */
typedef SignedInt16 Signed_3b13;
/* #endif */
#endif /* LOMPS_UPGRADE_ENHANCED_ECHO_CONTROL */
typedef Int16 UnSigned_8b8;
typedef SignedInt32 Signed_9b23;
#if defined(LOMPS_UPGRADE_NOISE_SUPPRESSION)
#if defined(LOMPS_ENABLE_NOISE_SUPPRESSION)
typedef SignedInt16 Signed_6b10;
typedef SignedInt32 Signed_22b10;
#endif /* LOMPS_ENABLE_NOISE_SUPPRESSION */
#endif /* LOMPS_UPGRADE_NOISE_SUPPRESSION */
#ifdef USE_SL1_API_C3_3
typedef SignedInt32 ACC_Type;
#endif
/****************************************************************************
* 4. Global Literals - used by all ***TDS.h file variants.
****************************************************************************/
/* TDS 'status' field usage.
* NOTE : System wide usage is defined here; task-specific error and return
* values are specified within the file defining the Tds.
*
* The bottom byte contains status and error codes. Some are system wide and
* some are task specific. The top byte contains return values. All of these
* are task specific
*/
#define TASK_STATUS 0x00ff /* Mask for status of task */
#define TASK_RETURN_VAL 0xff00 /* Mask for return value of task */
#define TASK_CALLED 0xf55f /* The code a task is called with */
/* Status and error codes */
/* 0x0003 - 0x001f system-wide error codes */
#define TASK_COMPLETED_OK 0x0000
#define TDS_OUT_OF_SYNC 0x0001
#define TDS_BAD_CONFIG 0x0002
/* 0x0020 - 0x003f - task specific error codes */
/* 0x0040 - 0x005d - task specific progress codes */
/* 0x005e - 0x005f - more system-wide status codes */
#define TASK_STARTED 0x005e
#define TASK_NOT_STARTED 0x005f
/* Return codes */
/* There are no system wide return codes */
/* 0x0000 - 0x5F00 task-specific return values
* these are defined at the TDS definition */
/****************************************************************************
* 5. Macros - More obviously document intentional precision reducing casts.
****************************************************************************/
/*
* INT16/SINT16 Mostly for benign warnings resulting from a genuinely
* 16-bit expression being internally promoted by a PC (eg.)
* compiler to a 32 bit int before being assigned to a 16-bit
* result.
*
* NOTE!! DONT use these macros for the cases covered by the SHM_TO_INT16,
* SHM_TO_SINT16 and HDL_TO_INT16 macros, below.
*/
#define INT16(iNTeXPRESSION) ((Int16) (iNTeXPRESSION))
#define SINT16(iNTeXPRESSION) ((SignedInt16) (iNTeXPRESSION))
/*
* SHM_TO_INT16, Document a POTENTIAL storage size change, where a shared
* HDL_TO_INT16, memory variable type of 16 bit precision, either ShmInt16
* SHM_TO_SINT16 or FrBufHandle, is assigned to the NON-shared memory Int16
* type.
*
* If any of these Shm prefixed variables is stored in
* other than 16 bits, these macros document an ACTUAL
* representation change for the variable value.
*/
#define SHM_TO_INT16(iNTeXPRESSION) ((Int16)(iNTeXPRESSION))
#define HDL_TO_INT16(iNTeXPRESSION) ((Int16)(iNTeXPRESSION))
#define SHM_TO_SINT16(iNTeXPRESSION) ((SignedInt16) (iNTeXPRESSION))
#endif
/* END OF FILE */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -