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

📄 csl_srioaux.h

📁 Dm6455 driver,magbe useful to you!
💻 H
📖 第 1 页 / 共 4 页
字号:
        CSL_SrioSpErrDetStatClear(hSrio, &arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_SrioSpErrDetStatClear (
    CSL_SrioHandle    hSrio,
    CSL_SrioPortData *arg
)
{
    hSrio->regs->PORT_ERROR[arg->index].SP_ERR_DET = arg->data;
}


/** ============================================================================
 *   @n@b CSL_SrioCntlSymSet
 *
 *   @b Description
 *      Sets up the registers for sending a control symbol
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Pointer to the control symbol structure

     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        CSL_SrioCntlSym arg;
        ...
        CSL_SrioCntlSymSet(hSrio, &arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_SrioCntlSymSet (
    CSL_SrioHandle   hSrio,
    CSL_SrioCntlSym *arg
)
{
    hSrio->regs->PORT_OPTION[arg->portNum].SP_CS_TX = 
                            CSL_FMK(SRIO_SP_CS_TX_STYPE_0, arg->stype0) |
                            CSL_FMK(SRIO_SP_CS_TX_PAR_0, arg->par0) |
                            CSL_FMK(SRIO_SP_CS_TX_PAR_1, arg->par1) |
                            CSL_FMK(SRIO_SP_CS_TX_STYPE_1, arg->stype1) |
                            CSL_FMK(SRIO_SP_CS_TX_CMD, arg->cmd) |
                            CSL_FMK(SRIO_SP_CS_TX_CS_EMB, arg->emb);
}

/** ============================================================================
 *   @n@b CSL_SrioSpCtlIndepErrStatClear
 *
 *   @b Description
 *      Clears port control independent status register bits.
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Pointer to the structure that specify, port number and the 
                     argument
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        CSL_SrioPortData arg;
        
        arg.index = 1;
        arg.data = 0x10040; //clears corresponding error status
        ...
        CSL_SrioSpCtlIndepErrStatClear(hSrio, &arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_SrioSpCtlIndepErrStatClear (
    CSL_SrioHandle   hSrio,
    CSL_SrioPortData *arg
)
{
    hSrio->regs->PORT_OPTION[arg->index].SP_CTL_INDEP = arg->data;
}

/** ============================================================================
 *   @n@b CSL_SrioPerEn
 *
 *   @b Description
 *      Enables/disables the peripheral.
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         value to be configured
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        Bool			arg = 0x0;
        ...
        CSL_SrioPerEn(hSrio, &arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_SrioPerEn (
	CSL_SrioHandle	hSrio, 
	Bool 			arg
)
{
	CSL_FINS(hSrio->regs->PCR, SRIO_PCR_PEREN, arg);
}
/** ============================================================================
 *   @n@b CSL_SrioPllCntlSet
 *
 *   @b Description
 *      Enables/disables the PLL.
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Value to enable/disable the 4 PLL
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        Uint8 arg = CSL_SRIO_PLL1_ENABLE |
                    CSL_SRIO_PLL2_ENABLE |
                    ...
                    CSL_SRIO_PLL4_ENABLE;
        ...
        CSL_SrioPllCntlSet(hSrio, arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_SrioPllCntlSet (
	CSL_SrioHandle	hSrio, 
	Uint8			arg
)
{
	CSL_FINSR(hSrio->regs->PER_SET_CNTL, 3, 0, arg);
}
/** ============================================================================
 *   @n@b CSL_SrioLsuIntrClear
 *
 *   @b Description
 *      Clears LSU interrupt status bits corresponding to the bits set . 
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Mask cotaining the status bits to be cleared
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        Uint32	 arg;

        arg = CSL_SRIO_LSU_INTR0 |
              CSL_SRIO_LSU_INTR1 |
              CSL_SRIO_LSU_INTR2;
        ...
        CSL_SrioLsuIntrClear(hSrio, arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_SrioLsuIntrClear (
	CSL_SrioHandle	hSrio, 
	Uint32 			arg
)
{
	hSrio->regs->LSU_ICCR = arg;
}
/** ============================================================================
 *   @n@b CSL_SrioErrRstIntrClear
 *
 *   @b Description
 *      Clears error interrupt status bits corresponding to the bits set . 
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Mask cotaining the status bits to be cleared
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        Uint32			 arg;

        arg = CSL_SRIO_ERR_DEV_RST_INTR |
              CSL_SRIO_ERR_PORT3_INTR |
              ...
              CSL_SRIO_ERR_LGCL_INTR;
        ...
        CSL_SrioErrRstIntrClear(hSrio, arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_SrioErrRstIntrClear (
	CSL_SrioHandle	hSrio, 
	Uint32 			arg
)
{
	hSrio->regs->ERR_RST_EVNT_ICCR = arg;
}

/** ============================================================================
 *   @n@b CSL_SrioLgclTrnsErrStatClear
 *
 *   @b Description
 *      Clears logical ransport layer error status bits corresponding to 
 *		the bits set . 
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Mask cotaining the status bits to be cleared
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        Uint32			 arg;

        arg = CSL_SRIO_IO_ERR_RSPNS |
              CSL_SRIO_ILL_TRANS_DECODE |
              ...
              CSL_SRIO_UNSOLICITED_RSPNS;
        ...
        CSL_SrioLgclTrnsErrStatClear(hSrio, arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_SrioLgclTrnsErrStatClear (
	CSL_SrioHandle	hSrio, 
	Uint32 			arg
)
{
	hSrio->regs->ERR_DET = arg;  
}


/** ============================================================================
 *   @n@b CSL_SrioSetIntdstRateCntl
 *
 *   @b Description
 *      Sets interrupt rate control counter
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Mask cotaining the status bits to be cleared
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        Uint32			 arg;

        arg = 0x100;
        ...
        CSL_SrioSetIntdstRateCntl(hSrio, arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline 
void CSL_SrioSetIntdstRateCntl (
    CSL_SrioHandle hSrio, 
    Uint32         arg
)
{
    hSrio->regs->INTDST_RATE_CNTL[0] = arg;    
}

/** ============================================================================
 *   @n@b CSL_srioGetPid
 *
 *   @b Description
 *      Quries the peripheral identification details.
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Pointer to the structure to return the peripheral details
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        CSL_SrioPidNumber arg;
        ...
        CSL_srioGetPid(hSrio, &arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void  CSL_srioGetPid (
    CSL_SrioHandle    hSrio,
    CSL_SrioPidNumber *response
)
{
     response->srioType = CSL_FEXT(hSrio->regs->PID, SRIO_PID_TYPE);
     response->srioClass = CSL_FEXT(hSrio->regs->PID, SRIO_PID_CLASS);
     response->srioRevision = CSL_FEXT(hSrio->regs->PID, SRIO_PID_REV);
}



/** ============================================================================
 *   @n@b CSL_srioGetBlkEnStat
 *
 *   @b Description
 *      Quries the enabled blocks of the peripheral.
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Pointer to the structure to return the status of different blocks
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        CSL_SrioBlkEn arg;
        ...
        CSL_srioGetBlkEnStat(hSrio, &arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_srioGetBlkEnStat (
    CSL_SrioHandle hSrio, 
    CSL_SrioBlkEn *response
)
{
    response->block0 = (Bool)hSrio->regs->BLK_ENABLE[0].BLK_EN_STAT;
    response->block1 = (Bool)hSrio->regs->BLK_ENABLE[1].BLK_EN_STAT;
    response->block2 = (Bool)hSrio->regs->BLK_ENABLE[2].BLK_EN_STAT;
    response->block3 = (Bool)hSrio->regs->BLK_ENABLE[3].BLK_EN_STAT;
    response->block4 = (Bool)hSrio->regs->BLK_ENABLE[4].BLK_EN_STAT;
    response->block5 = (Bool)hSrio->regs->BLK_ENABLE[5].BLK_EN_STAT;
    response->block6 = (Bool)hSrio->regs->BLK_ENABLE[6].BLK_EN_STAT;
    response->block7 = (Bool)hSrio->regs->BLK_ENABLE[7].BLK_EN_STAT;
    response->block8 = (Bool)hSrio->regs->BLK_ENABLE[8].BLK_EN_STAT;
}



/** ============================================================================
 *   @n@b CSL_srioGetDoorbellIntrStat
 *
 *   @b Description
 *      Quries the doorbell interrupts status.
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Pointer to the structure that specify, port number and the 
                     argument
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        CSL_SrioPortData arg;
        ...
        CSL_srioGetDoorbellIntrStat(hSrio, &arg);
        ...
     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_srioGetDoorbellIntrStat (
    CSL_SrioHandle   hSrio,
    CSL_SrioPortData *response
)
{
    response->data = hSrio->regs->DOORBELL_INTR[response->index].DOORBELL_ICSR;
}



/** ============================================================================
 *   @n@b CSL_srioLsuCompCodeStat
 *
 *   @b Description
 *      Quries the completion code status of LSU.
 *
 *   @b Arguments
 *   @verbatim
         hSrio       Pointer to the object that holds reference to the 
                     instance of SRIO  

         arg         Pointer to the structure that specify, port number and the 
                     LSU completion code
     @endverbatim
 *
 *   <b> Return Value </b>
 *       None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   None
 *
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_SrioHandle  hSrio;
        CSL_SrioLsuCompStat arg;
        ...

⌨️ 快捷键说明

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