亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩精品中文字幕在线不卡尤物| 一区二区三区国产精华| 国产精品天天摸av网| 亚洲免费在线观看视频| 蜜桃久久久久久| 91亚洲午夜精品久久久久久| 欧美tickling挠脚心丨vk| 亚洲三级小视频| 国产成人福利片| 欧美大片在线观看一区二区| 一区二区三区日韩在线观看| 国产成人在线电影| 日韩欧美一区在线| 天堂av在线一区| 91国偷自产一区二区开放时间| 国产午夜久久久久| 精品亚洲国产成人av制服丝袜 | 日本高清成人免费播放| 精品国产凹凸成av人网站| 亚洲综合色网站| 91免费看片在线观看| 久久精品亚洲一区二区三区浴池| 婷婷久久综合九色综合伊人色| www.欧美色图| 美女网站色91| 欧美日韩亚洲综合在线 | 国产精品亚洲а∨天堂免在线| 欧美男生操女生| 亚洲资源在线观看| 色婷婷久久久久swag精品| 国产欧美日韩在线看| 国产精品自产自拍| 国产亚洲成av人在线观看导航| 毛片av一区二区| 欧美tickling挠脚心丨vk| 蜜臀av一级做a爰片久久| 欧美日韩国产免费一区二区| 亚洲国产乱码最新视频| 欧美三级三级三级爽爽爽| 亚洲一区免费观看| 欧美日韩高清一区| 日本午夜精品一区二区三区电影| 欧美日韩视频不卡| 蜜桃在线一区二区三区| 精品国一区二区三区| 美国精品在线观看| 国产午夜一区二区三区| 99在线精品免费| 亚洲精品老司机| 欧美精品丝袜久久久中文字幕| 三级在线观看一区二区| 精品久久久久久综合日本欧美| 国内精品嫩模私拍在线| 中文字幕av一区二区三区免费看| 成人黄色小视频在线观看| 亚洲欧美一区二区三区孕妇| 欧美无砖专区一中文字| 日本aⅴ亚洲精品中文乱码| 久久婷婷色综合| k8久久久一区二区三区| 一区二区三区精品| 欧美不卡一二三| 成人99免费视频| 午夜精品久久久久久久99水蜜桃| 欧美成人欧美edvon| 成人精品在线视频观看| 午夜av电影一区| 国产亚洲一二三区| 欧美性做爰猛烈叫床潮| 黄网站免费久久| 亚洲欧美一区二区久久| 日韩久久精品一区| caoporm超碰国产精品| 石原莉奈在线亚洲二区| 中国av一区二区三区| 在线成人av网站| 成人av第一页| 奇米在线7777在线精品| 亚洲人成精品久久久久久| 欧美一二三区在线| 色婷婷综合中文久久一本| 久久91精品久久久久久秒播| 亚洲欧美另类图片小说| 精品福利一区二区三区免费视频| 色呦呦国产精品| 欧美日韩一区视频| 成人激情免费网站| 日韩电影一区二区三区四区| 日韩美女视频一区二区| 欧美成人一区二区三区在线观看| 在线精品视频免费播放| 国产xxx精品视频大全| 免费成人结看片| 亚洲国产日韩综合久久精品| 亚洲国产精品99久久久久久久久| 欧美一区日本一区韩国一区| 91女厕偷拍女厕偷拍高清| 国模娜娜一区二区三区| 日韩精品福利网| 伊人色综合久久天天| 中文字幕一区二区不卡| 久久理论电影网| 日韩欧美国产精品| 日韩欧美一区在线观看| 制服丝袜中文字幕亚洲| 在线免费观看日本一区| av中文字幕在线不卡| 成人中文字幕合集| 国产精品一区二区无线| 国内久久婷婷综合| 麻豆国产一区二区| 免费观看在线综合色| 日韩av一区二区在线影视| 亚洲国产精品久久人人爱蜜臀| 亚洲少妇30p| 亚洲精品免费播放| 亚洲激情六月丁香| 亚洲一区二区三区在线播放| 成人久久18免费网站麻豆| 国产91精品一区二区麻豆亚洲| 国产91精品入口| 成人91在线观看| 99免费精品在线| 91久久奴性调教| 欧美三级中文字| 欧美精品免费视频| 欧美一区二区三区免费视频| 欧美日韩在线免费视频| 欧美美女喷水视频| 日韩亚洲电影在线| 欧美精品一区二区三| 久久精品亚洲乱码伦伦中文| 国产精品麻豆视频| 亚洲免费在线电影| 日韩成人一级片| 精品一区二区三区在线播放| 国产一区二区三区精品欧美日韩一区二区三区 | 久久99精品国产麻豆婷婷洗澡| 免费av成人在线| 成人黄色电影在线| 在线观看不卡一区| 91精品国产综合久久精品图片| 日韩一区二区在线观看视频播放| 欧美哺乳videos| 国产精品久久久久久久久久免费看 | 成人激情av网| 欧美日韩精品久久久| 精品精品国产高清一毛片一天堂| 国产女人18毛片水真多成人如厕| 亚洲免费av观看| 免费在线观看一区二区三区| 国产酒店精品激情| 91福利精品视频| 久久午夜羞羞影院免费观看| 亚洲男女毛片无遮挡| 日本美女视频一区二区| 成人污视频在线观看| 欧美日本乱大交xxxxx| 久久色在线视频| 亚洲精品免费在线观看| 精品夜夜嗨av一区二区三区| 91婷婷韩国欧美一区二区| 日韩视频在线观看一区二区| 国产精品久久久久久久午夜片 | 亚洲免费电影在线| 激情图片小说一区| 91成人看片片| 国产欧美久久久精品影院| 亚洲国产欧美在线人成| 国产乱色国产精品免费视频| 欧美浪妇xxxx高跟鞋交| 国产精品日韩精品欧美在线| 蜜臀av性久久久久蜜臀aⅴ四虎| www..com久久爱| 精品国产乱码久久久久久牛牛 | 在线免费av一区| 国产精品天天摸av网| 精品一区二区三区免费视频| 欧美亚洲一区三区| 国产精品久久久久一区| 激情av综合网| 日韩一区二区三区在线| 亚洲成人先锋电影| 91色.com| 亚洲欧美日本韩国| 91麻豆高清视频| 国产精品灌醉下药二区| 国产九色精品成人porny| 欧美一区二区三区视频| 视频一区二区三区入口| 色狠狠色噜噜噜综合网| 国产精品美女久久久久久2018| 日韩和的一区二区| 在线91免费看| 亚洲国产综合色| 欧美亚洲国产一区二区三区va | 欧美专区亚洲专区| 亚洲男帅同性gay1069| 一本色道久久加勒比精品 | 久久色中文字幕|