亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? xsac97ctrl.c

?? 嵌入式系統關于串口傳輸、觸摸屏、定時器、控制器、中斷處理、音頻控制等實驗代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
        
        if (status != ERR_NONE)    
        {  
        	PrintfUartDef("!!!!Error Cold reset AC97\r\n");
			status = ERR_T_SW_INTERNAL;
        }
        else 
        	PrintfUartDef("AC97 Cold reset OK ....\r\n");

        // Note: this system has only one codec.  For systems with a primary and 
        //  secondary device, the identity of a device that did not properly
        //  reset could be ascertained at this point.
    }
   
    //must delay, to let controller settle
    Util_DelayMs(500);
    
    if (status)
    {
        if ((ERR_T_NOBITSET != status) && (ERR_T_TIMEOUT != status))
        {
            // Other errors indicate a bad parameter, failure to clear any
            //    existing handler by the interrupt controller driver, or 
            //    violation of the assumption that the AC'97 is unused by a 
            //    debugger.  All are essentially software errors.
            // The error log, as filled in by the subroutines, should leave a 
            //    trace of exactly what the problem was.

            status = ERR_T_SW_INTERNAL;
        }
//        LOGERROR (XsAc97CtrlContext.loggedError, ERR_L_XSAC97CTRL, 
//            ERR_S_XSAC97CTRL_HWSETUP, status, 0, 0, 0)
    }

    return (status);

} // End XsAc97CtrlHWSetup ()    



/*
*******************************************************************************
*
* FUNCTION:         XsAc97CtrlGetStatus 
*
* DESCRIPTION:      Reports the value of the specified status indicator, as
*                   obtained from the ACUNIT's GSR register.  Clears the
*                   status indicator, if possible, after reading it.
*
*                   Should not be used for status types that are currently in 
*                   use as interrupt triggers.
*
* INPUT PARAMETERS: XsAc97CtrlStatusIdT statusId: ID of status indicator to get
*
* RETURNS:    Status indicator masked and normalized to bit 0. 
*             Invalid ID: 0 (There is no direct reporting of invalid ID error).
*
* GLOBAL EFFECTS:   1) Because the status indicator is cleared, it will not be 
*                       available to trigger an interrupt.
*                   2) If the specified status ID is invalid, an error is 
*                       logged in the error log and the context structure.
*
* ASSUMPTIONS:      We don't have to double-check the hardware by making sure
*                   that a clearable status actually cleared.
*
* CALLS:            
*
* CALLED BY:        
*
* PROTOTYPE:        UINT32 XsAc97CtrlGetStatus (XsAc97CtrlStatusIdT);
*
*******************************************************************************
*/

UINT32 XsAc97CtrlGetStatus (XsAc97CtrlStatusIdT statusId)
{
    UINT32                  statusIndication = 0;  // Assume bad ID
    UINT32                  rangeCheckResult;
    XsAc97CtrlStatusEntryT* statusTableEntryP;


    rangeCheckResult = XsAc97CtrlRangeCheckStatusId (statusId);

    if (rangeCheckResult)
    {
//        LOGERROR ( XsAc97CtrlContext.loggedError, 
//            ERR_L_XSAC97CTRL,
 //           ERR_S_XSAC97CTRL_GET_STATUS,
  //          rangeCheckResult, 0, 0, 0)
    }
    else
    {
        statusTableEntryP = XsAc97CtrlStatusTable + statusId;

        // Get the indication, normalize it, then isolate it.
        statusIndication   = XsAc97CtrlRegsP->GSR;
        statusIndication >>= statusTableEntryP->reportBitShiftGsr;
        statusIndication  &= statusTableEntryP->reportBitMaskGsr;

        // Clear the indication if it exists and can be cleared.  
        //  Don't use the clearing subroutine, there's so much extra overhead.
        // Don't clear without finding it, to avoid race condition.
        // NULL clear register means it can't be cleared.
        if (statusIndication && statusTableEntryP->clearRegisterP)
        {   
            //  Write a shifted "1" to clear the status.  Don't "OR" it in.
            *statusTableEntryP->clearRegisterP = 
                1u << statusTableEntryP->clearBitShift;
        }
    }  // else (rangeCheckResult)

    return (statusIndication);

} // XsAc97CtrlGetStatus()


/*
*******************************************************************************
*
* FUNCTION:         XsAc97CtrlWriteCodecReg
*
* DESCRIPTION:      Write a value to a specific mixer register in a specific 
*                   AC'97 codec or modem, using the AC Link.
*
* INPUT PARAMETERS: 
*
* RETURNS:          
*       Success:    0 (ERR_NONE)
*       Failure:    ERR_T_NOT_AVAIL: AC Link was not available within the 
*                           timeout interval.
*                   ERR_T_ILLPARAM:  One of the ID parameters was illegal.
*                           Which one is recorded in the first parameter of
*                           the logged error.  Software error.
*
* GLOBAL EFFECTS:   Disables interrupts briefly, possibly sub-microsecond.
*                     Theoretical maximum is about 130 - 200 uSec.
*                   On termination, AC Link remains locked until the codec I/0
*                     cycle initiated by the local write completes.  That 
*                     should take from 21 to 42 uSec.  Next codec I/O will not
*                     be able to start during that time.
*
* ASSUMPTIONS:      
*
* CALLS:            
*
* CALLED BY:        
*
* PROTOTYPE:        UINT32 XsAc97CtrlWriteCodecReg (XsAc97CtrlCodecModemIdT, 
*                                                  AC97MixerRegisterIdT,
*                                                  UINT32);
*
*******************************************************************************
*
* DESIGN:
*
*  1.  Disable interrupts, saving pre-existing state.
*  2.  Read the CAR until it is verified that no Codec I/O accesses are 
*        currently in progress.  This also claims the next codec I/O transaction
*        for this operation.
*  3.  Clear any status and error indications that can result from a Codec 
*        write operation (CDONE).
*  4.  Write the specified data to the processor memory location that is mapped
*        to the target Codec's target register.
*  5.  Restore previous interrupt state.
*
*  Note that this operation does not wait for the transmission to complete.  
*    Any remaining wait is done in the beginning of the next access.
* 
*******************************************************************************
*/

UINT32 XsAc97CtrlWriteCodecReg   (XsAc97CtrlCodecModemIdT  ac97DeviceId, 
                                 AC97MixerRegisterIdT     targetRegister,
                                 UINT32                   newValue)
{
    UINT32    status ;
    INT       badParamNum  = 0 ; // Which param had error.  Assume no errors.
    BOOL      gotLink;
    UINT32    irqIntState;
    INT       timeRemaining;
    VUINT32*  mixerRegsAccessP;
    VUINT     finishedStatus;

    status = Ac97CheckRegId (targetRegister);
    if (status)
    {
        badParamNum = 2;
    }
    else    // register ID OK, set register access pointer to codec access base
    {
        switch (ac97DeviceId)
        {
            case XS_AC97CTRL_CM_ID_PRI_CODEC:
                mixerRegsAccessP  = &XsAc97CtrlRegsP->
                XsAC97CtrlMixerRegsPrimaryAud[0];
                break;
            default:
                status      = ERR_T_ILLPARAM;
                badParamNum = 1;
                break;
        }
    } // else (register ID OK)

    if (!status)
    {
        // Point to specified register within area mapped to target codec regs
        mixerRegsAccessP += (targetRegister / XS_AC97CTRL_MIXER_REGS_PER_WORD);

        irqIntState = XsIcDisableInterruptsIrq();

        // Lock the ACLINK
        timeRemaining = XS_AC97CTRL_CAIP_TIMEOUT_1USECS;
        do
        {
            gotLink = XsAc97CtrlLockAcLink();
            if (!gotLink)    // 1 usec is a long time.  Skip delay if possible.
            {
                DM_WaitUs(1);
            }
        }
        // Wait while time remaining and ACLINK not available
        while ( timeRemaining-- && !gotLink );

        if (!gotLink) // Didn't get the ACLINK
        {
            status = ERR_T_NOT_AVAIL;      
        }
        else  // We got the link.  Perform the write operation and don't wait.
        {
            // First, clear old write status indications.
            // Ignore return code; if the ID is invalid, it won't compile.
            (void) XsAc97CtrlClearStatus (XS_AC97CTRL_STAT_CDONE); 

            *mixerRegsAccessP = newValue;       // Now the write!

            // Wait until write cycle is complete.  There should be a way
            //  to do this speculatively at the beginning of the procedure.
            //  Need to discover it.  Too inefficient to always wait.

            // Use more forgiving read timeout
            timeRemaining = XS_AC97CTRL_READ_TIMEOUT_1USECS;
            do
            {
                DM_WaitUs(1);
                finishedStatus = 
                    XsAc97CtrlGetStatus (XS_AC97CTRL_STAT_CDONE);
            }
            // Wait while time remaining and command I/O still incomplete
            // CDONE bit is high when done.
            while (   (timeRemaining--) && !finishedStatus);

        }  // Got AC link

        XsIcRestoreInterruptsIrq (irqIntState);

    }  // if (!status): No problem with params.  Sent command if link available.

    if (status)
    {
//        LOGERROR (XsAc97CtrlContext.loggedError, ERR_L_XSAC97CTRL, 
 //           ERR_S_XSAC97CTRL_CODEC_WRITE, status, badParamNum, 0, targetRegister)
    }

    return(status);

} // XsAc97CtrlCodecWrite()   


/*
*******************************************************************************
*
* FUNCTION:         XsAc97CtrlReadCodecReg
*
* DESCRIPTION:      Read the value of a specific mixer register in a specified 
*                   AC'97 codec or modem, using the AC Link.
*
* INPUT PARAMETERS: 
*       XsAc97CtrlCodecModemIdT ac97DeviceId: ID of modem or codec to read.
*       AC97MixerRegisterIdT  targetRegister: ID of register on codec.
*       UINT32*               mixerRegValueP: Address of variable in which to 
*                                             put the value from the codec reg.
*
* OUTPUT: UINT32* mixerRegValueP: Receives the value reported for the 
*                                   specified mixer register in the specified
*                                   codec.  Valid only if return code is zero.
*
* RETURNS:          
*       Success:    0 (ERR_NONE); value in *mixerRegValueP is valid.
*       Failure:    ERR_T_NOT_AVAIL: AC Link was not available within the 
*                           initial timeout interval.
*                   ERR_T_ILLPARAM:  One of the ID parameters was illegal.
*                           Which one is recorded in the first parameter of
*                           the logged error.  Software error.
*                   ERR_T_TIMEOUT:   A timeout occurred after initial 
*                           acquisition of the AC Link.  The point in the 
*                           routine where the timeout occurred is recorded
*                           in the second parameter of the logged error.
*
* GLOBAL EFFECTS:   Disables interrupts for at least 42 uSec.  Theoretical 
*                     maximum is about 250 uSec.
*                   On termination, AC Link remains locked until the codec I/0
*                     cycle initiated by the second local read completes.  That
*                     could take from 42 to 84+ uSec.  Next codec I/O will not
*                     be able to start during that time.
*                   Errors recorded in context structure and system error log.
*
* ASSUMPTIONS:      
*
* CALLS:            
*
* CALLED BY:        
*
* PROTOTYPE:        UINT32 XsAc97CtrlReadCodecReg (XsAc97CtrlCodecModemIdT, 
*                                                  AC97MixerRegisterIdT, 
*                                                  UINT32*);
*
*******************************************************************************
*
* DESIGN:
* 
*  1.  Disable interrupts, saving pre-existing state.
*  2.  Read the CAR until it is verified that no codec I/O accesses are 
*      currently in progress.  This also claims the next codec I/O transaction 
*      for this operation.
*  3.  Clear any status and error indications that can result from a codec read
*      operation (SDONE, Read Completion Status).

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
有码一区二区三区| 久久久亚洲国产美女国产盗摄| 91在线视频网址| 91小宝寻花一区二区三区| 欧美性受xxxx| 国产喷白浆一区二区三区| 亚洲乱码国产乱码精品精的特点| 亚洲成av人影院| 国产成人精品一区二 | 日本道在线观看一区二区| 欧美精品v国产精品v日韩精品| 日韩免费观看2025年上映的电影| 国产女人18毛片水真多成人如厕| 一区二区三区在线免费| 国产精品99久久久久久久vr| 欧美伊人久久大香线蕉综合69| 欧美电影免费观看高清完整版| 亚洲图片激情小说| 韩国av一区二区| 欧美疯狂做受xxxx富婆| 国产精品美女久久久久久| 日韩成人免费看| 色综合 综合色| 亚洲精品国产无天堂网2021| 丁香婷婷综合激情五月色| 欧美另类高清zo欧美| 亚洲靠逼com| 色综合网色综合| 亚洲欧美色一区| 日本韩国欧美一区二区三区| 国产精品久久久久久久久免费桃花| 国模冰冰炮一区二区| 久久女同互慰一区二区三区| 久久精品久久精品| 国产欧美日韩在线| 99精品久久只有精品| 亚洲卡通欧美制服中文| 欧美日韩一区二区电影| 热久久免费视频| 欧美第一区第二区| 国产成人综合在线观看| 国产女人aaa级久久久级| 成人免费看片app下载| 亚洲欧美精品午睡沙发| 欧美日韩在线播放| 麻豆极品一区二区三区| 中文欧美字幕免费| 欧美性猛片xxxx免费看久爱| 日本亚洲欧美天堂免费| 国产日产亚洲精品系列| 色综合天天在线| 精品亚洲国产成人av制服丝袜| 欧美国产精品中文字幕| 欧美无人高清视频在线观看| 久久精品国产99国产精品| 中文字幕在线不卡一区| 91精品国产综合久久久久久久| 成人午夜电影网站| 日本美女视频一区二区| 国产精品久久久久久久蜜臀| 欧美视频在线一区| 91蜜桃网址入口| 国产一区二区三区免费看 | 一本久久综合亚洲鲁鲁五月天| 亚洲成人av资源| 亚洲黄色小视频| 国产精品美女久久久久久久久| 91精品国产免费久久综合| 色欧美88888久久久久久影院| 激情丁香综合五月| 美日韩黄色大片| 日日夜夜一区二区| 日韩综合小视频| 视频在线观看91| 日韩精品一级二级| 午夜精品久久一牛影视| 亚洲成在人线在线播放| 午夜久久久久久电影| 亚洲成人av一区二区三区| 亚洲一区二区三区免费视频| 一区二区三区精品在线| 亚洲一二三专区| 免费观看日韩电影| 麻豆精品一区二区三区| 国产一区在线观看视频| 成人美女在线观看| 色综合咪咪久久| 欧美美女喷水视频| 日韩精品一区二区三区老鸭窝| 欧美日韩成人在线一区| 精品免费国产二区三区| 日本一区二区三区在线不卡| 中文字幕在线免费不卡| 夜夜亚洲天天久久| 精品在线一区二区| 97se亚洲国产综合自在线不卡| 一本色道**综合亚洲精品蜜桃冫 | 亚洲一区二区在线观看视频| 午夜激情久久久| 成人一二三区视频| 日韩一区二区三区三四区视频在线观看| 欧美精品一区二区久久婷婷| 国产精品国产三级国产aⅴ原创| 午夜国产精品影院在线观看| av不卡免费电影| 国产亚洲一区二区三区在线观看| 亚洲小说欧美激情另类| 成人一区二区三区视频| 精品国产麻豆免费人成网站| 一区二区三区在线看| 国产99精品在线观看| 日韩久久久精品| 日韩国产欧美在线观看| 色综合天天综合狠狠| 国产精品久久久久天堂| 国产麻豆精品一区二区| 日韩视频免费观看高清完整版 | 日韩专区欧美专区| 欧美少妇性性性| 一个色在线综合| 欧美日韩国产影片| 亚洲mv在线观看| 在线不卡免费欧美| 免费成人美女在线观看| 欧美日韩色一区| 日本美女视频一区二区| 欧美一区二区三区视频免费| 免费的国产精品| 久久新电视剧免费观看| 国产乱子伦视频一区二区三区| 欧美videos中文字幕| 黄网站免费久久| 国产日韩欧美综合在线| 高清久久久久久| 亚洲一区二区中文在线| 精品国产人成亚洲区| 国产精品888| 一区二区三区高清| 欧美一级欧美一级在线播放| 国产大陆亚洲精品国产| 亚洲视频在线一区观看| 欧美一区二区三区不卡| 成人午夜视频在线观看| 五月激情六月综合| 国产亚洲人成网站| 欧美丝袜自拍制服另类| 看电影不卡的网站| 一区二区三区在线视频观看58 | 亚洲午夜精品一区二区三区他趣| 欧美二区三区的天堂| 国产成人免费在线观看不卡| 亚洲成人激情综合网| 国产三级一区二区三区| 欧美日韩国产首页| 9色porny自拍视频一区二区| 日韩国产成人精品| 亚洲一区在线电影| 亚洲区小说区图片区qvod| 国产婷婷色一区二区三区四区| 欧美日韩精品系列| 欧美亚洲一区二区三区四区| 高清国产午夜精品久久久久久| 日韩精品成人一区二区在线| 亚洲精品国久久99热| 亚洲美女在线国产| 亚洲欧美一区二区三区国产精品 | av在线这里只有精品| 国产一区二区免费看| 日韩精品免费专区| 青青草成人在线观看| 麻豆国产欧美一区二区三区| 青青青爽久久午夜综合久久午夜| 首页国产丝袜综合| 久久国产精品一区二区| 久久99热狠狠色一区二区| 麻豆精品国产91久久久久久| 男女男精品视频| 国产激情视频一区二区三区欧美| 美女视频第一区二区三区免费观看网站| 性欧美大战久久久久久久久| 亚洲gay无套男同| 国内一区二区在线| 91伊人久久大香线蕉| 在线观看区一区二| 日韩欧美高清一区| 国产三级精品三级在线专区| 亚洲欧美在线观看| 日韩av网站在线观看| 成人性视频免费网站| 欧美特级限制片免费在线观看| 精品国产乱码久久久久久久久| 国产欧美日韩在线看| 五月婷婷久久综合| 国产精品911| 欧美一区二区视频网站| 最新久久zyz资源站| 久久精品国产秦先生| 欧美专区日韩专区| 中文字幕国产精品一区二区| 天堂成人国产精品一区|