csl_ocpt1aux.h
来自「dsp在音频处理中的运用」· C头文件 代码 · 共 201 行
H
201 行
/** ============================================================================
* @file csl_ocpt1Aux.h
*
* @path $(CSLPATH)\arm\ocpt1\src
*
* @desc Auxilliary API header file for the OCP T1 port CSL
*/
/* ============================================================================
* Copyright (c) Texas Instruments Inc 2002, 2003, 2004
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied.
* ===========================================================================
*/
/* @(#) PSP/CSL 3.00.01.00[5912] (2004-05-15) */
/* =============================================================================
* Revision History
* ===============
* 29-Sep-2004 sd Design review changes.
* 13-Sep-2004 sd File Created.
* =============================================================================
*/
#ifndef _CSL_OCPT1AUX_H_
#define _CSL_OCPT1AUX_H_
#include <csl_ocpt1.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Status query functions of the OCP T1 port
*/
/** ============================================================================
* @n@b CSL_ocpt1AbortAddrGet
*
* @b Description
* @n Gets the address that caused the abort.
*
* @b Arguments
* @verbatim
hOcpt1 Handle to the OCP T1 port instance
@endverbatim
*
* <b> Return Value </b> Uint32
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Returns address that caused the abort.
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_Ocpt1Handle hOcpt1;
Uint32 abortAddr;
...
abortAddr = CSL_ocpt1AbortAddrGet (hOcpt1);
...
@endverbatim
* ===========================================================================
*/
static inline
Uint32 CSL_ocpt1AbortAddrGet (
CSL_Ocpt1Handle hOcpt1
)
{
Uint32 abortAddr;
/* Read the address that caused the abort */
abortAddr = (Uint32) CSL_FEXT (hOcpt1->regs->AADDR,
OCPT1_AADDR_ADDRESS);
return abortAddr;
}
/** ============================================================================
* @n@b CSL_ocpt1AbortStatusGet
*
* @b Description
* @n Gets the abort status.
*
* @b Arguments
* @verbatim
hOcpt1 Handle to the OCP T1 port instance
@endverbatim
*
* <b> Return Value </b> CSL_Ocpt1AbortStatus
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Returns the abort status.
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_Ocpt1Handle hOcpt1;
CSL_Ocpt1AbortStatus abortStat;
...
abortStat = CSL_ocpt1AbortStatusGet (hOcpt1);
...
@endverbatim
* ===========================================================================
*/
static inline
CSL_Ocpt1AbortStatus CSL_ocpt1AbortStatusGet (
CSL_Ocpt1Handle hOcpt1
)
{
CSL_Ocpt1AbortStatus abortStat = CSL_OCPT1_NO_ABORT;
/* Read the abort flag */
if (CSL_OCPT1_ATYPER_ABORT_FLAG_ABORT == CSL_FEXT (hOcpt1->regs->ATYPER,
OCPT1_ATYPER_ABORT_FLAG)) {
/* if flag set, check if timeout error */
if (CSL_OCPT1_ATYPER_TIMEOUT_ERR_ABORT == CSL_FEXT (
hOcpt1->regs->ATYPER, OCPT1_ATYPER_TIMEOUT_ERR)) {
abortStat = CSL_OCPT1_TIMEOUT_ERR;
}
/* check if bus error */
else {
if (CSL_OCPT1_ATYPER_BUS_ERR_ABORT == CSL_FEXT (
hOcpt1->regs->ATYPER, OCPT1_ATYPER_BUS_ERR)) {
abortStat = CSL_OCPT1_BUS_ERR;
}
}
}
return abortStat;
}
/** ============================================================================
* @n@b CSL_ocpt1AbortHostIdGet
*
* @b Description
* @n Gets the ID of the host that caused the abort.
*
* @b Arguments
* @verbatim
hOcpt1 Handle to the OCP T1 port instance
@endverbatim
*
* <b> Return Value </b> CSL_Ocpt1AbortHostId
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Returns the ID of the host that caused the abort.
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_Ocpt1Handle hOcpt1;
CSL_Ocpt1AbortHostId abortHostId;
...
abortHostId = CSL_ocpt1AbortHostIdGet (hOcpt1);
...
@endverbatim
* ===========================================================================
*/
static inline
CSL_Ocpt1AbortHostId CSL_ocpt1AbortHostIdGet (
CSL_Ocpt1Handle hOcpt1
)
{
CSL_Ocpt1AbortHostId abortHostId;
/* Read the ID of the host that caused the abort */
abortHostId = (CSL_Ocpt1AbortHostId) CSL_FEXT (hOcpt1->regs->ATYPER,
OCPT1_ATYPER_HOST_ID);
return abortHostId;
}
#ifdef __cplusplus
}
#endif
#endif /* _CSL_OCPT1AUX_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?