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

📄 csl_ataaux.h

📁 TI达芬奇dm644x各硬件模块测试代码
💻 H
📖 第 1 页 / 共 5 页
字号:
/*  ============================================================================ *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005 * *   Use of this software is controlled by the terms and conditions found in the *   license agreement under which this software has been supplied. *   =========================================================================== *//** @file  csl_ataAux.h * *  @brief  API Auxilary header file for ATA CSL. * *  Path: \\(CSLPATH)\\ipmodules\\ata\\src *//* ============================================================================= *  Revision History *  =============== *  08-Nov-2004 kpn Updated according to new cslr_ata.h file, which is *                  generated according to ti-3710shu-1.03 document *  30-Oct-2004 kpn Added code for HWNHLD bits of MISCCTL reg in functions *                  CSL_ataHwSetupOverride & CSL_ataGetHwSetupOverride. *                  The code for these functions is corrected with respect *                  to matching of register names with condition (eg: Primary *                  Slave, then suffix is 1P) *  08-Oct-2004 kpn Initialised the local variables used in functions *                  Updated according to review comments *  27-Sep-2004 kpn File Created. *  ============================================================================ */#ifndef _CSL_ATAAUX_H_#define _CSL_ATAAUX_H_#include <csl_ata.h>#ifdef __cplusplusextern "C" {#endif/* *  Status query functions of ATA *//** ============================================================================ *   @n@b CSL_ataGetIORDYTimeoutStatus * *   @b Description *   @n Gets the IORDY timeout status of the ATA. (enabled/clear) * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance     @endverbatim * *   <b> Return Value </b>  Uint16 * *   <b> Pre Condition </b> *   @n  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_AtaHandle      hAta;        Uint16             response;        response = CSL_ataGetIORDYTimeoutStatus (hAta);     @endverbatim *  ============================================================================ */CSL_IDEF_INLINEUint16 CSL_ataGetIORDYTimeoutStatus (    CSL_AtaHandle                     hAta){    Uint16  response = 0;    if (hAta->ataNum == CSL_ATA_PRIMARY) {        response = CSL_FEXT(hAta->regs->DMAENGINE.BMISP, ATA_BMISP_IORDYINT);    }    else if (hAta->ataNum == CSL_ATA_SECONDARY) {        response = CSL_FEXT(hAta->regs->DMAENGINE.BMISS, ATA_BMISS_IORDYINT);    }    return response;}/** ============================================================================ *   @n@b CSL_ataGetIDEInterruptStatus * *   @b Description *   @n Gets the IDE Interrupt status of the ATA. (active/clear) * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance     @endverbatim * *   <b> Return Value </b>  Uint16 * *   <b> Pre Condition </b> *   @n  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_AtaHandle      hAta;        Uint16             response;        response = CSL_ataGetIDEInterruptStatus (hAta);     @endverbatim *  ============================================================================ */CSL_IDEF_INLINEUint16 CSL_ataGetIDEInterruptStatus (    CSL_AtaHandle                     hAta){    Uint16  response = 0;    if (hAta->ataNum == CSL_ATA_PRIMARY) {        response = CSL_FEXT(hAta->regs->DMAENGINE.BMISP, ATA_BMISP_INTRSTAT);    }    else if (hAta->ataNum == CSL_ATA_SECONDARY) {        response = CSL_FEXT(hAta->regs->DMAENGINE.BMISS, ATA_BMISS_INTRSTAT);    }    return response;}/** ============================================================================ *   @n@b CSL_ataGetDMAErrorStatus * *   @b Description *   @n Gets the DMA Error status of the ATA. (active/ clear) * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance     @endverbatim * *   <b> Return Value </b>  Uint16 * *   <b> Pre Condition </b> *   @n  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_AtaHandle      hAta;        Uint16             response;        response = CSL_ataGetDMAErrorStatus (hAta);     @endverbatim *  ============================================================================ */CSL_IDEF_INLINEUint16 CSL_ataGetDMAErrorStatus (    CSL_AtaHandle                 hAta){    Uint16  response = 0;    if (hAta->ataNum == CSL_ATA_PRIMARY) {        response = CSL_FEXT(hAta->regs->DMAENGINE.BMISP, ATA_BMISP_DMAERROR);    }    else if (hAta->ataNum == CSL_ATA_SECONDARY) {        response = CSL_FEXT(hAta->regs->DMAENGINE.BMISS, ATA_BMISS_DMAERROR);    }    return response;}/** ============================================================================ *   @n@b CSL_ataGetIDEActiveStatus * *   @b Description *   @n Gets the IDE Active status of the ATA. (active/ complete) * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance     @endverbatim * *   <b> Return Value </b>  Uint16 * *   <b> Pre Condition </b> *   @n  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_AtaHandle      hAta;        Uint16             response;        response = CSL_ataGetIDEActiveStatus (hAta);     @endverbatim *  ============================================================================ */CSL_IDEF_INLINEUint16 CSL_ataGetIDEActiveStatus (    CSL_AtaHandle                  hAta){    Uint16  response = 0;    if (hAta->ataNum == CSL_ATA_PRIMARY) {        response = CSL_FEXT(hAta->regs->DMAENGINE.BMISP, ATA_BMISP_IDEACT);    }    else if (hAta->ataNum == CSL_ATA_SECONDARY) {        response = CSL_FEXT(hAta->regs->DMAENGINE.BMISS, ATA_BMISS_IDEACT);    }    return response;}/** ============================================================================ *   @n@b CSL_ataGetRxCount * *   @b Description *   @n Gets the no of bytes received from a device during a PRD transaction * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance     @endverbatim * *   <b> Return Value </b>  Uint32 * *   <b> Pre Condition </b> *   @n  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_AtaHandle      hAta;        Uint32             response;        response = CSL_ataGetRxCount (hAta);     @endverbatim *  ============================================================================ */CSL_IDEF_INLINEUint32 CSL_ataGetRxCount (    CSL_AtaHandle          hAta){    Uint32  response = 0;    response = hAta->regs->DMAENGINE.DMARXCNT;    return response;}/** ============================================================================ *   @n@b CSL_ataGetTxCount * *   @b Description *   @n Gets the no of bytes transmitted to a device during a PRD transaction * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance     @endverbatim * *   <b> Return Value </b>  Uint32 * *   <b> Pre Condition </b> *   @n  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_AtaHandle      hAta;        Uint32             response;        response = CSL_ataGetTxCount (hAta);     @endverbatim *  ============================================================================ */CSL_IDEF_INLINEUint32 CSL_ataGetTxCount (    CSL_AtaHandle          hAta){    Uint32  response = 0;    response = hAta->regs->DMAENGINE.DMATXCNT;    return response;}/** ============================================================================ *   @n@b CSL_ataGetDMARQStatus * *   @b Description *   @n Gets the status of the DMARQ signal * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance     @endverbatim * *   <b> Return Value </b>  Uint16 * *   <b> Pre Condition </b> *   @n  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_AtaHandle      hAta;        Uint16             response;        response = CSL_ataGetDMARQStatus (hAta);     @endverbatim *  ============================================================================ */CSL_IDEF_INLINEUint16 CSL_ataGetDMARQStatus (    CSL_AtaHandle              hAta){    Uint16  response = 0;    response = (Uint16) CSL_FEXT(hAta->regs->CONFIG.IDESTAT, ATA_IDESTAT_DMARQ);    return response;}/** ============================================================================ *   @n@b CSL_ataGetINTRQStatus * *   @b Description *   @n Gets the status of the INTRQ signal * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance     @endverbatim * *   <b> Return Value </b>  Uint16 * *   <b> Pre Condition </b> *   @n  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_AtaHandle      hAta;        Uint16             response;        response = CSL_ataGetINTRQStatus (hAta);     @endverbatim *  ============================================================================ */CSL_IDEF_INLINEUint16 CSL_ataGetINTRQStatus (    CSL_AtaHandle              hAta){    Uint16  response = 0;    response = (Uint16) CSL_FEXT(hAta->regs->CONFIG.IDESTAT, ATA_IDESTAT_INTRQ);    return response;}/** ============================================================================ *   @n@b CSL_ataGetDMACKNStatus * *   @b Description *   @n Gets the status of the DMACKN signal * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance     @endverbatim * *   <b> Return Value </b>  Uint16 * *   <b> Pre Condition </b> *   @n  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_AtaHandle      hAta;        Uint16             response;        response = CSL_ataGetDMACKNStatus (hAta);     @endverbatim *  ============================================================================ */CSL_IDEF_INLINEUint16 CSL_ataGetDMACKNStatus (    CSL_AtaHandle               hAta){    Uint16  response = 0;    response = (Uint16) CSL_FEXT(hAta->regs->CONFIG.IDESTAT,ATA_IDESTAT_DMACKN);    return response;}/** ============================================================================ *   @n@b CSL_ataGetTLECounter * *   @b Description *   @n Gets the counter value used to control the duration of the MISC capture * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance     @endverbatim * *   <b> Return Value </b>  Uint16 * *   <b> Pre Condition </b> *   @n  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_AtaHandle      hAta;        Uint16             response;        response = CSL_ataGetTLECounter (hAta);     @endverbatim *  ============================================================================ */CSL_IDEF_INLINEUint16 CSL_ataGetTLECounter (    CSL_AtaHandle             hAta){    Uint16  response = 0;    response = (Uint16) CSL_FEXT(hAta->regs->IODFTM.TLEC, ATA_TLEC_TLEC);    return response;}/** ============================================================================ *   @n@b CSL_ataGetMISRResult * *   @b Description *   @n Gets the MISR result signature of a given test after the *      download function is executed. * *   @b Arguments *   @verbatim            hAta            Handle to the ATA instance

⌨️ 快捷键说明

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