csl_ocpt2aux.h

来自「dsp在音频处理中的运用」· C头文件 代码 · 共 201 行

H
201
字号
/** ============================================================================
 *   @file  csl_ocpt2Aux.h
 *
 *   @path  $(CSLPATH)\arm\ocpt2\src
 *
 *   @desc  Auxilliary API header file for the OCP T2 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_OCPT2AUX_H_
#define _CSL_OCPT2AUX_H_

#include <csl_ocpt2.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 *	Status query functions of the OCP T2 port
 */

/** ============================================================================
 *   @n@b CSL_ocpt2AbortAddrGet
 *
 *   @b Description
 *   @n Gets the address that caused the abort.
 *
 *   @b Arguments
 *   @verbatim
        hOcpt2        Handle to the OCP T2 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_Ocpt2Handle      hOcpt2;
        Uint32               abortAddr;

        ...
        abortAddr = CSL_ocpt2AbortAddrGet (hOcpt2);
        ...
     @endverbatim
 * ===========================================================================
 */

static inline
Uint32 CSL_ocpt2AbortAddrGet (
	CSL_Ocpt2Handle hOcpt2
)
{
    Uint32  abortAddr;

    /* Read the address that caused the abort */
    abortAddr = (Uint32) CSL_FEXT (hOcpt2->regs->OCPT2_AADDR,
    										OCPT2_OCPT2_AADDR_ADDRESS);
    return abortAddr;
}

/** ============================================================================
 *   @n@b CSL_ocpt2AbortStatusGet
 *
 *   @b Description
 *   @n Gets the abort status.
 *
 *   @b Arguments
 *   @verbatim
        hOcpt2        Handle to the OCP T2 port instance
	 @endverbatim
 *
 *   <b> Return Value </b>  CSL_Ocpt2AbortStatus
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n Returns the abort status.
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_Ocpt2Handle             hOcpt2;
        CSL_Ocpt2AbortStatus        abortStat;

        ...
        abortStat = CSL_ocpt2AbortStatusGet (hOcpt2);
        ...
     @endverbatim
 * ===========================================================================
 */

static inline
CSL_Ocpt2AbortStatus CSL_ocpt2AbortStatusGet (
	CSL_Ocpt2Handle hOcpt2
)
{
    CSL_Ocpt2AbortStatus  abortStat = CSL_OCPT2_NO_ABORT;

    /* Read the abort flag */
    if (CSL_OCPT2_OCPT2_ATYPER_ABORT_FLAG_ABORT == CSL_FEXT (hOcpt2->regs->OCPT2_ATYPER,
    										OCPT2_OCPT2_ATYPER_ABORT_FLAG)) {
		/* if flag set, check if timeout error */
		if (CSL_OCPT2_OCPT2_ATYPER_TIMEOUT_ERR_ABORT == CSL_FEXT (
							hOcpt2->regs->OCPT2_ATYPER, OCPT2_OCPT2_ATYPER_TIMEOUT_ERR)) {
			abortStat = CSL_OCPT2_TIMEOUT_ERR;
		}

		/* check if bus error */
		else {
			if (CSL_OCPT2_OCPT2_ATYPER_BUS_ERR_ABORT == CSL_FEXT (
							hOcpt2->regs->OCPT2_ATYPER, OCPT2_OCPT2_ATYPER_BUS_ERR)) {
				abortStat = CSL_OCPT2_BUS_ERR;
			}
		}
	}

   return abortStat;
}

/** ============================================================================
 *   @n@b CSL_ocpt2AbortHostIdGet
 *
 *   @b Description
 *   @n Gets the ID of the host that caused the abort.
 *
 *   @b Arguments
 *   @verbatim
        hOcpt2        Handle to the OCP T2 port instance
	 @endverbatim
 *
 *   <b> Return Value </b>  CSL_Ocpt2AbortHostId
 *
 *   <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_Ocpt2Handle             hOcpt2;
        CSL_Ocpt2AbortHostId        abortHostId;

        ...
        abortHostId = CSL_ocpt2AbortHostIdGet (hOcpt2);
        ...
     @endverbatim
 * ===========================================================================
 */

static inline
CSL_Ocpt2AbortHostId CSL_ocpt2AbortHostIdGet (
	CSL_Ocpt2Handle hOcpt2
)
{
    CSL_Ocpt2AbortHostId  abortHostId;

    /* Read the ID of the host that caused the abort */
    abortHostId = (CSL_Ocpt2AbortHostId) CSL_FEXT (hOcpt2->regs->OCPT2_ATYPER,
    										OCPT2_OCPT2_ATYPER_HOST_ID);
    return abortHostId;
}

#ifdef __cplusplus
}
#endif

#endif /* _CSL_OCPT2AUX_H_ */

⌨️ 快捷键说明

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