iekc64_error.h
来自「TI公司的算法标准 Framework5的源代码」· C头文件 代码 · 共 105 行
H
105 行
/*
* Copyright 2002 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/* "@(#) RF5_IEK 2.00.02 12-11-02 (swat-c19)" */
/*! \verbatim
==============================================================================
Copyright (C) 2002 A.T.E.M.E.
All Rights Reserved
------------------------------------------------------------------------------
MODULE NAME... IEKC64_error
FLENAME...... iekc64_error.h
PROJECT....... IEK C64x
------------------------------------------------------------------------------
HISTORY:
V1.0 November 2001 JMC
19/12/2001 HCO
------------------------------------------------------------------------------
\endverbatim <P> \file
\brief Layer interface for the error management on IEK C64x
</P>*//*====================================================================*/
#ifndef _IEKC64_ERROR_H_
#define _IEKC64_ERROR_H_
#ifdef __cplusplus
extern "C" {
#endif
/*--------------------------------------------------------------------------*/
/*! Defines the standard IEKLIB status code.<br>
Positive or nul values represent a successful call to a API funtion.<br>
Negative values represent a failure in the call.<br>
Status code should be build in each module include file using the
IEKC64_ERR_CODE() macro.<br>
Status code returned by API function calls can be tested using the macro
IEKC64_SUCCESS() here below.
*/
typedef Int32 IEKC64_STATUS;
/*--------------------------------------------------------------------------*/
/*! Defines the module identifiers for IEKLIB.<br>
These values are used when defining module's status codes.
*/
enum IEKLIB_MODULE_ID
{
IEKC64_CLK = 1,
IEKC64_EPLD,
IEKC64_FPGA,
IEKC64_I2C,
IEKC64_FLASH,
IEKC64_BT835,
IEKC64_BT864,
IEKC64_AIC23,
IEKC64_LED,
IEKC64_DMA,
IEKC64_EPLDDSP,
IEKC64_EPLDVGA,
IEKC64_AUD,
IEKC64_VIDEO,
IEKC64_INIT,
IEKC64_INTR,
IEKC64_PCI,
IEKC64_PLL,
IEKC64_EEPROM
};
/*--------------------------------------------------------------------------*/
/*! Error code builder.<br>
This macro is used in module's header files to build an
error code. Error codes buils using this macro will make
IEKC64_SUCCESS() return FALSE.
\param module Module identifier, should be one of IEKLIB_MODULE_ID
\param code Error code local to module.
\return An negative error code that makes IEKC64_SUCCESS() returning FALSE
*/
#define IEKC64_ERR_CODE(module,code) (IEKC64_STATUS)(0x80000000 | \
((module) << 16) | \
(code))
/*--------------------------------------------------------------------------*/
/*! Status code tester.<br>
Using this macro to test if an status code represents a success or
a failure makes code more readable.
\param status A IEKC64_STATUS status return by an API call.
\return TRUE if the status represents a successful call or FALSE if the
status represents a failure.
*/
#define IEKC64_SUCCESS(status) (((IEKC64_STATUS)(status)) >= 0)
/*--------------------------------------------------------------------------*/
/*! Default status code for successful function call. */
#define IEKC64_OK (0)
#ifdef __cplusplus
}
#endif
#endif /* ifndef _IEK_ERROR_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?