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

📄 csl_mcaspaux.h

📁 基于ti tms320c672x下音频开发例子程式
💻 H
📖 第 1 页 / 共 5 页
字号:
                                           MCASP_SRCTL2_SRMOD));
            break;
        case SERIALIZER_4:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL3, 
                                           MCASP_SRCTL3_SRMOD));
            break;
        case SERIALIZER_5:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL4, 
                                           MCASP_SRCTL4_SRMOD));
            break;
        case SERIALIZER_6:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL5, 
                                           MCASP_SRCTL5_SRMOD));
            break;
        case SERIALIZER_7:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL6, 
                                           MCASP_SRCTL6_SRMOD));
            break;
        case SERIALIZER_8:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL7, 
                                           MCASP_SRCTL7_SRMOD));
            break;
        case SERIALIZER_9:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL8, 
                                           MCASP_SRCTL8_SRMOD));
            break;
        case SERIALIZER_10:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL9, 
                                           MCASP_SRCTL9_SRMOD));
            break;
        case SERIALIZER_11:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL10, 
                                           MCASP_SRCTL10_SRMOD));
            break;
        case SERIALIZER_12:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL11, 
                                           MCASP_SRCTL11_SRMOD));
            break;
        case SERIALIZER_13:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL12, 
                                           MCASP_SRCTL12_SRMOD));
            break;
        case SERIALIZER_14:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL13, 
                                           MCASP_SRCTL13_SRMOD));
            break;
        case SERIALIZER_15:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL14, 
                                           MCASP_SRCTL14_SRMOD));
            break;
        case SERIALIZER_16:
            *(CSL_McaspSerMode *)serMode = ((CSL_McaspSerMode)
                                           CSL_FEXT(hMcasp->regs->SRCTL15, 
                                           MCASP_SRCTL15_SRMOD));
            break;
        default:
            st = CSL_ESYS_FAIL;
    }
    return st;
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetXmtStat
 *
 *   @b Description
 *   @n This function returns the value of XSTAT register.
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Uint32
 *   @li                    Value of XSTAT register.
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Value of XSTAT register will be returned.
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
        Uint32 xmtStat;
        
        xmtStat = CSL_mcaspGetXmtStat (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Uint32 CSL_mcaspGetXmtStat (
    CSL_McaspHandle         hMcasp
)
{
    return((Uint32) hMcasp->regs->XSTAT);
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetRcvStat
 *
 *   @b Description
 *   @n This function returns the value of RSTAT register.
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Uint32
 *   @li                    Value of RSTAT register.
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Value of RSTAT register will be returned.
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
        Uint32 rcvStat;
        
        rcvStat = CSL_mcaspGetRcvStat (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Uint32 CSL_mcaspGetRcvStat (
    CSL_McaspHandle         hMcasp
)
{
    return((Uint32) hMcasp->regs->RSTAT);
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetSmFsXmt
 *
 *   @b Description
 *   @n This function returns the XSMRST and XFRST field values of XGBLCTL
 *      register.
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Uint8
 *   @li          0x00 - Both transmit frame generator sync and transmit state
 *                       machine are reset.
 *   @li          0x1  - Only transmit state machine is active.
 *   @li          0x10 - Only transmit frame sync generator is active.
 *   @li          0x11 - Both transmit frame generator sync and transmit state
 *                       machine are active.
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Value of XSMRST and XFRST fields of XGBLCTL register will be returned.
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
        Uint16 smFsXmt;
        
        smFsXmt = CSL_mcaspGetSmFsXmt (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Uint8 CSL_mcaspGetSmFsXmt (
    CSL_McaspHandle         hMcasp
)
{
    Uint8 smFsXmt = 0;

    smFsXmt = ((Uint8) CSL_FEXT (hMcasp->regs->XGBLCTL,
              MCASP_XGBLCTL_XFRST));
    smFsXmt <<= 4;
    smFsXmt |= ((Uint8) CSL_FEXT (hMcasp->regs->XGBLCTL,
               MCASP_XGBLCTL_XSMRST));


    return smFsXmt;
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetSmFsRcv
 *
 *   @b Description
 *   @n This function returns the RSMRST and RFRST field values of RGBLCTL
 *      register.
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Uint8
 *   @li          0x00 - Both receive frame generator sync and receive state
 *                       machine are reset.
 *   @li          0x1  - Only receive state machine is active.
 *   @li          0x10 - Only receive frame sync generator is active.
 *   @li          0x11 - Both receive frame generator sync and receive state
 *                       machine are active.
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Value of RSMRST and RFRST fields of RGBLCTL register will be returned.
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
        Uint16 smFsRcv;
        
        smFsRcv = CSL_mcaspGetSmFsRcv (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Uint8 CSL_mcaspGetSmFsRcv (
    CSL_McaspHandle         hMcasp
)
{
    Uint8 smFsRcv = 0;

    smFsRcv = ((Uint8) CSL_FEXT (hMcasp->regs->RGBLCTL,
              MCASP_RGBLCTL_RFRST));
    smFsRcv <<= 4;
    smFsRcv |= ((Uint8) CSL_FEXT (hMcasp->regs->RGBLCTL,
               MCASP_RGBLCTL_RSMRST));


    return smFsRcv;
}

/** ===========================================================================
 *   @n@b CSL_mcaspGetDitMode
 *
 *   @b Description
 *   @n This function returns the status of DITEN bit in DITCTL register.
 *      register.
 *
 *   @b Arguments
 *   @verbatim
            hMcasp            Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  Bool
 *   @li                    TRUE    DIT Mode is enabled
 *
 *   @li                    FALSE   DIT Mode is not enabled
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Value of DITEN bit in DITCTL register will be returned.
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
        Bool ditMode;
        
        ditMode = CSL_mcaspGetDitMode (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
Bool CSL_mcaspGetDitMode (
    CSL_McaspHandle         hMcasp
)
{
    return((Bool) CSL_FEXT(hMcasp->regs->DITCTL, MCASP_DITCTL_DITEN));
}

/**
 *  Hardware Control Functions of McASP
 */

/** ===========================================================================
 *   @n@b CSL_mcaspSetXmtGbl
 *
 *   @b Description
 *   @n This function configures the transmitter global control register
 *
 *   @b Arguments
 *   @verbatim
            hMcasp          Handle to the McASP instance

            xmtGbl          Value to be loaded into the XGBLCTL register
     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  XGBLCTL register will be loaded with the specified value
 *
 *   @b  Modifies
 *   @n  XGBLCTL register
 *
 *   @b Example
 *   @verbatim
        Uint32 xmtGbl;  
        
        xmtGbl = 0x00000000;
        CSL_mcaspSetXmtGbl (hMcasp, xmtGbl);
        
     @endverbatim
 * ============================================================================
 */
static inline
void CSL_mcaspSetXmtGbl (
    CSL_McaspHandle     hMcasp,
    Uint32              xmtGbl
)
{
    /* Configure XGBLCTL with the value passed */
    hMcasp->regs->XGBLCTL = xmtGbl;
}

/** ===========================================================================
 *   @n@b CSL_mcaspSetRcvGbl
 *
 *   @b Description
 *   @n This function configures the receiver global control register
 *
 *   @b Arguments
 *   @verbatim
            hMcasp      Handle to the McASP instance

            rcvGbl      Value to be loaded into the RGBLCTL register
     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  RGBLCTL register will be loaded with the specified value
 *
 *   @b  Modifies
 *   @n  RGBLCTL register
 *
 *   @b Example
 *   @verbatim
        Uint32  rcvGbl;
        
        rcvGbl = 0x00000000;  
        CSL_mcaspSetRcvGbl (hMcasp, rcvGbl);
        
     @endverbatim
 * ============================================================================
 */
static inline
void CSL_mcaspSetRcvGbl (
    CSL_McaspHandle     hMcasp,
    Uint32              rcvGbl
)
{
    /* Configure RGBLCTL with the value passed */
    hMcasp->regs->RGBLCTL =  rcvGbl;
}

/** ===========================================================================
 *   @n@b CSL_mcaspResetXmtFSRst
 *
 *   @b Description
 *   @n This function resets the transmit frame sync generator reset enable bit
 *      of transmit global control register
 *
 *   @b Arguments
 *   @verbatim
            hMcasp      Handle to the McASP instance
     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  XGBLCTL register will be loaded with the specified value
 *
 *   @b  Modifies
 *   @n  XGBLCTL register
 *
 *   @b Example
 *   @verbatim
        CSL_mcaspResetXmtFSRst (hMcasp);
        
     @endverbatim
 * ============================================================================
 */
static inline
void CSL_mcaspResetXmtFSRst (
    CSL_McaspHandle     hMcasp
)
{
    CSL_FINST (hMcasp->regs->XGBLCTL, MCASP_XGBLCTL_XFRST, RESET);
}

⌨️ 快捷键说明

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