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

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

?? tuner.c

?? 這是DVB tuner驅動部分和其它相關的源碼和一些技術資料文檔.
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*****************************************************************************File Name   : tuner.cDescription : Wrapper API for interfacing with the low-level tuner modules.Copyright (C) 1999 STMicroelectronicsRevision History :    21/01/00    Search algorithm updated to allow direct setting of LNB                tone state in scan params.    24/01/00    FEC rates are now setting during ScanExact() i.e., per                scan list element rather than a global OR of all                FEC rates for all scan list elements.Reference        :ST API Definition "TUNER Driver API" DVD-API-06*****************************************************************************//* Includes --------------------------------------------------------------- */#include <string.h>                     /* C libs */#include <stdio.h>#include <stdlib.h>#include "stlite.h"                     /* Standard includes */#include "sttuner.h"                    /* STAPI includes */#include "sti2c.h"#include "stcommon.h"#include "sttbx.h"#include "demod.h"                      /* DEMOD Device API */#include "tnr.h"                        /* TNR Device API */#include "sat.h"                        /* SAT Device API */#include "tuner.h"                      /* Core Tuner API *//* Private types/constants ------------------------------------------------ *//* Digital bandwidth roll-off */#define DIG_ROLL_OFF_SCALING            100#define SCALED_DIG_ROLL_OFF             135 /* Actual 1.35 *//* Analog carrier bandwidth -- big step speeds up scan process */#define ANALOG_CARRIER_BANDWIDTH_KHZ    29000#define NUMBER_LOST_BEFORE_UNLOCK       3/* Delay required for the scan task */#ifndef STTUNER_SCAN_TASK_DELAY_MS#define STTUNER_SCAN_TASK_DELAY_MS      500  /* Millisecond delay */#endif /* STTUNER_SCAN_TASK_DELAY_MS *//* Device capabilities */#define MAX_AGC                         255#define MAX_SIGNAL_QUALITY              100#define MAX_BER                         200000/* Private variables ------------------------------------------------------ *//* Private macros --------------------------------------------------------- *//* Private function prototypes -------------------------------------------- */static void GetCapability(TUNER_ControlBlock_t *Tuner_p);static void ScanTask(TUNER_ControlBlock_t *Tuner_p);static TUNER_ErrorCode_t ProcessScanExact(TUNER_ControlBlock_t *Tuner_p,                                          STTUNER_EventType_t *Event_p);static TUNER_ErrorCode_t ProcessNextScan(TUNER_ControlBlock_t *Tuner_p,                                         STTUNER_EventType_t *Event_p);static TUNER_ErrorCode_t ProcessTracking(TUNER_ControlBlock_t *Tuner_p,                                         STTUNER_EventType_t *Event_p);static TUNER_ErrorCode_t ProcessThresholds(TUNER_ControlBlock_t *Tuner_p,                                           STTUNER_EventType_t *Event_p);static TUNER_ErrorCode_t GetTunerInfo(TUNER_ControlBlock_t *Tuner_p);static void LNBPowerDown(TUNER_ControlBlock_t *Tuner_p);/* API routines ----------------------------------------------------------- *//*****************************************************************************Name: TUNER_Init()Description:    Initializes each tuner component and then interrogates for each    device's capabilities.  The tuner control block is initialized    with all appropriate settings allowing the STAPI layer to    access this information directly.Parameters:    Tuner_p,    pointer to a tuner control block.Return Value:    TUNER_NO_ERROR,     the operation completed without error.    TUNER_ERROR_LNB_HW, a hardware error in the LNB circuit.See Also:    TUNER_Term()*****************************************************************************/TUNER_ErrorCode_t TUNER_Init(TUNER_ControlBlock_t *Tuner_p,                             STTUNER_InitParams_t *InitParams_p){    TUNER_ErrorCode_t Error = TUNER_NO_ERROR;    TNR_InitParams_t TNRInitParams;    DEMOD_InitParams_t DEMODInitParams;    SAT_InitParams_t SATInitParams;    int rc;    /* Clear out the tuner handle */    Tuner_p->Handle = 0;    /* In order to support the I2C Repeater mode, the demod is first     *  initialized. Then, the tuner is initialized and then, the tuner handle     *  is set in the demod structure via the function DEMOD_InitTunerHandle()     */    DEMODInitParams.DeviceAccess_p = &Tuner_p->I2CDemodHandle; /* I2C handle */    DEMODInitParams.TunerHandle = Tuner_p->TunerHandle; /* Depends on TNR */    DEMODInitParams.ExternalClock = InitParams_p->ExternalClock;    DEMODInitParams.DemodType = InitParams_p->DemodType;    DEMODInitParams.TSOutputMode = InitParams_p->TSOutputMode;    DEMODInitParams.SerialDataMode = InitParams_p->SerialDataMode;    DEMODInitParams.SerialClockSource = InitParams_p->SerialClockSource;    DEMODInitParams.FECMode = InitParams_p->FECMode;    DEMODInitParams.MemoryPartition = InitParams_p->DriverPartition;    Error = DEMOD_Init(&DEMODInitParams,                       &Tuner_p->DemodHandle,                       &Tuner_p->DEMODCapability                      );    if (Error == DEMOD_NO_ERROR)    {        /* Setup the initialization parameters */        TNRInitParams.DeviceAccess_p = &Tuner_p->I2CTunerHandle; /* I2C handle */        TNRInitParams.TunerType = InitParams_p->TunerType;        TNRInitParams.MemoryPartition = InitParams_p->DriverPartition;        /* the Repeater mode concerns only the STV0299 demod */        if(DEMODInitParams.DemodType == DEMOD_DEVICE_STV0299)        {            TNRInitParams.Repeater = InitParams_p -> Repeater;        }        else        {            TNRInitParams.Repeater = FALSE;        }        TNRInitParams.DemodHandle = Tuner_p->DemodHandle;        /* Initialize each tuner component -- the ordering is crucial, as DEMOD         * depends on TNR and SAT depends on DEMOD, in this implementation.         */        Error = TNR_Init(&TNRInitParams, &Tuner_p->TunerHandle);        if (Error == TNR_NO_ERROR)          /* TNR Init succeeded? */        {            /* To support I2C Repeater mode, we need to initialize the tuner             * handle of the DEmod structure.             */            Error = DEMOD_InitTunerHandle(Tuner_p->DemodHandle, Tuner_p->TunerHandle);            if(Error == DEMOD_NO_ERROR)            {                /* Select appropriate SAT driver */                SATInitParams.SatType = InitParams_p->DemodType;                SATInitParams.DeviceAccess_p = &Tuner_p->I2CDemodHandle;                SATInitParams.MemoryPartition = InitParams_p->DriverPartition;                /* needed to initialize the STV0299_ControlBlock_t struct of the                   SAT_ControlBlock_t struct */                SATInitParams.DemodHandle_p = Tuner_p->DemodHandle;                /* Initialize the SAT device */                Error = SAT_Init(&SATInitParams,                                 &Tuner_p->SatHandle,                                 &Tuner_p->SatCapability);                if (Error == SAT_NO_ERROR)                {                    /* Obtain device capabilties */                    GetCapability(Tuner_p);                    /* Allocate memory for various lists used */                    Tuner_p->ScanList.ScanList = memory_allocate(                        (partition_t *)InitParams_p->DriverPartition,                        (InitParams_p->ScanListMax * sizeof(STTUNER_Scan_t)));                    Tuner_p->BandList.BandList = memory_allocate(                        (partition_t *)InitParams_p->DriverPartition,                        (InitParams_p->BandListMax * sizeof(STTUNER_Band_t)));                    Tuner_p->ThresholdList.ThresholdList = memory_allocate(                        (partition_t *)InitParams_p->DriverPartition,                        (InitParams_p->SignalListMax * sizeof(STTUNER_SignalThreshold_t)));                    Tuner_p->ThresholdHits = memory_allocate(                        (partition_t *)InitParams_p->DriverPartition,                        (InitParams_p->SignalListMax * sizeof(U32)));                    if (Tuner_p->ScanList.ScanList != NULL &&                        Tuner_p->BandList.BandList != NULL &&                        Tuner_p->ThresholdList.ThresholdList != NULL &&                        Tuner_p->ThresholdHits != NULL)                    {                        /* Create the scan busy semaphore required to synchronize access to                         * the scan status, etc -- can't fail.                         */                        semaphore_init_fifo(&Tuner_p->ScanTask.GuardSemaphore, 1);                        /* Create the timeout semaphore -- this allows us to periodically                         * wakeup the scan task to perform background processing e.g.,                         * tracking the locked frequency.                         */                        semaphore_init_fifo_timeout(&Tuner_p->ScanTask.TimeoutSemaphore,                                                    0);                        /* Reset the delete flag to ensure that the task doesn't exit                         * prematurely -- can't fail.                         */                        Tuner_p->ScanTask.DeleteTask = FALSE;                        /* Sets the scan task timer delay -- this controls how often the scan                         * task awakes to perform background processing.                         */                        Tuner_p->ScanTask.TimeoutDelayMs = STTUNER_SCAN_TASK_DELAY_MS;                        /* Initialize the scan task status to startup defaults */                        Tuner_p->ScanInfo.Scan_p = NULL;                        Tuner_p->ScanInfo.ScanIndex = 0;                        Tuner_p->ScanInfo.NextFrequency = 0;                        Tuner_p->ScanInfo.LockCount = 0;    /* For monitoring tracking */                        Tuner_p->ScanInfo.PlrMask = 0;      /* Current polarizations */                        /* Assume that the scan status is "unlocked" to begin with */                        Tuner_p->TunerInfo.Status =                            STTUNER_STATUS_UNLOCKED;                        /* Reset all list sizes to zero */                        Tuner_p->ScanList.NumElements = 0;                        Tuner_p->BandList.NumElements = 0;                        Tuner_p->ThresholdList.NumElements = 0;                        /* Create and start the scan task */                        rc = task_init((void(*)(void *))ScanTask,                                       Tuner_p,                                       Tuner_p->ScanTask.ScanTaskStack,                                       SCAN_TASK_STACK_SIZE,                                       &Tuner_p->ScanTask.ScanTask,                                       &Tuner_p->ScanTask.ScanTaskDescriptor,                                       3,                                       "ScanTask",                                       0);                        /* Task creation may fail, so we check the error code */                        if (rc != 0)                        {                            /* Task creation failed */                            Error = TUNER_ERROR_NO_MEMORY;                        }                    }                    else                    {                        /* Free up any allocated resources */                        if (Tuner_p->ScanList.ScanList != NULL)                            memory_deallocate((partition_t *)InitParams_p->DriverPartition,                                              Tuner_p->ScanList.ScanList                                              );                        if (Tuner_p->BandList.BandList != NULL)                            memory_deallocate((partition_t *)InitParams_p->DriverPartition,                                              Tuner_p->BandList.BandList                                              );                        if (Tuner_p->ThresholdList.ThresholdList != NULL)                            memory_deallocate((partition_t *)InitParams_p->DriverPartition,                                              Tuner_p->ThresholdList.ThresholdList                                             );                        if (Tuner_p->ThresholdHits != NULL)                            memory_deallocate((partition_t *)InitParams_p->DriverPartition,                                              Tuner_p->ThresholdHits                                             );                        /* Memory allocate error */                        Error = TUNER_ERROR_NO_MEMORY;                    }                }            }        }    }    return Error;} /* TUNER_Init() *//*****************************************************************************Name: TUNER_Term()Description:    Performs any necessary task in order to cleanly terminate the tuner    device -- each tuner component is terminated appropriately.Parameters:    Tuner_p,        pointer to a tuner control block.    TermParams_p,   additional parameters to guide the termination process.Return Value:    TUNER_NO_ERROR,     the operation completed without error.See Also:    TUNER_Initialize()*****************************************************************************/TUNER_ErrorCode_t TUNER_Term(TUNER_ControlBlock_t *Tuner_p){    TUNER_ErrorCode_t Error;    task_t *Task_p = &Tuner_p->ScanTask.ScanTask;    /* Wakeup the scan task and lock out the scan task whilst     * we modify the delete task flag.     */    semaphore_wait(&Tuner_p->ScanTask.GuardSemaphore);    semaphore_signal(&Tuner_p->ScanTask.TimeoutSemaphore);    /* Flag the timer as waiting to be deleted */    Tuner_p->ScanTask.DeleteTask = TRUE;    semaphore_signal(&Tuner_p->ScanTask.GuardSemaphore);    /* The task should be in the process of returning, but wait for     * it first before deleting it. */    if (task_wait(&Task_p,1,TIMEOUT_INFINITY) == 0)    {        /* Now it should be safe to delete the task */        if (task_delete(&Tuner_p->ScanTask.ScanTask) == 0)        {            /* Delete all semaphores associated with the timer */            semaphore_delete(&Tuner_p->ScanTask.GuardSemaphore);            semaphore_delete(&Tuner_p->ScanTask.TimeoutSemaphore);        }    }    /* Free up any allocated resources */    if (Tuner_p->ScanList.ScanList != NULL)        memory_deallocate((partition_t *)Tuner_p->InitParams.DriverPartition,                          Tuner_p->ScanList.ScanList                         );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av在线一区二区| 黄网站免费久久| 久久人人爽人人爽| 欧美tickling挠脚心丨vk| 91精品国产91久久久久久一区二区| 在线观看亚洲精品视频| 在线影视一区二区三区| 日韩欧美综合一区| 日韩免费在线观看| 26uuu亚洲综合色| 国产欧美一区二区精品婷婷 | 一区二区理论电影在线观看| 国产精品理伦片| 亚洲精品国产一区二区精华液| 亚洲人一二三区| 午夜精品爽啪视频| 毛片av一区二区| 成人永久看片免费视频天堂| 欧美喷潮久久久xxxxx| 日韩一区二区三区在线| 精品久久久久久亚洲综合网| 国产欧美精品国产国产专区 | 欧美一级xxx| 久久久蜜桃精品| 亚洲精品成人悠悠色影视| 亚洲成在线观看| 久久aⅴ国产欧美74aaa| 99在线精品视频| 中文字幕成人av| 亚洲国产视频一区二区| 精品一区二区三区在线播放视频 | 欧美va亚洲va香蕉在线| 国产偷v国产偷v亚洲高清| 亚洲精品国久久99热| 久久精品国产澳门| av不卡在线播放| 欧美一个色资源| 亚洲精品日日夜夜| 91黄视频在线| 精品欧美一区二区久久| 亚洲激情综合网| 国产激情一区二区三区| 欧美日韩黄色影视| 国产精品国产三级国产aⅴ原创| 亚洲电影一区二区| 成人av在线网站| 日韩视频一区二区三区在线播放| 亚洲欧洲精品一区二区三区| 日本午夜一本久久久综合| jlzzjlzz欧美大全| 精品国产第一区二区三区观看体验| 日产欧产美韩系列久久99| 97久久超碰国产精品| 26uuu精品一区二区| 日本不卡视频在线| 欧美色图在线观看| 日韩毛片高清在线播放| 国产美女久久久久| 日韩欧美亚洲国产另类| 五月婷婷激情综合网| 一本一道久久a久久精品| 国产精品入口麻豆九色| 国产呦萝稀缺另类资源| 日韩一区二区在线看片| 亚洲国产aⅴ天堂久久| 日韩精品一区二区三区四区 | 亚洲国产成人tv| 91国偷自产一区二区使用方法| 中文字幕av资源一区| 韩国v欧美v亚洲v日本v| 精品日韩成人av| 久久精品国产精品亚洲精品| 91精品久久久久久久久99蜜臂| 亚洲国产综合在线| 精品视频在线看| 国产夫妻精品视频| 久久久久久久综合色一本| 韩国女主播一区| 久久久另类综合| 成人网男人的天堂| 亚洲欧美日韩中文播放| 在线精品视频免费播放| 天堂一区二区在线| 日韩欧美第一区| 国产一区二区三区久久悠悠色av| 欧美精品一区二区三区蜜桃| 精品一区二区在线观看| 国产欧美日韩亚州综合 | 国产精品一级片在线观看| 精品电影一区二区| 国产91丝袜在线播放0| 国产精品伦理在线| 在线免费观看日韩欧美| 视频在线观看91| 精品成a人在线观看| 国产99久久久国产精品潘金网站| 国产精品久久久久久久岛一牛影视| 94-欧美-setu| 三级欧美在线一区| 久久久99免费| 91热门视频在线观看| 视频一区二区三区在线| 亚洲电影第三页| 精品久久国产老人久久综合| 国产91富婆露脸刺激对白| 一区二区三区欧美| 日韩欧美在线123| av电影在线观看完整版一区二区| 亚洲成国产人片在线观看| 337p粉嫩大胆色噜噜噜噜亚洲| 不卡的av在线| 日本视频免费一区| 最新日韩av在线| 欧美不卡一二三| 色偷偷成人一区二区三区91| 日韩精品一二三区| 国产精品电影一区二区三区| 国产精品美女一区二区三区 | 成人av在线一区二区| 日本va欧美va瓶| 一区二区三区在线视频观看| 精品伦理精品一区| 欧美三级电影在线看| 岛国精品在线观看| 日本美女视频一区二区| 亚洲精品免费一二三区| 久久精品亚洲精品国产欧美| 欧美人与性动xxxx| 99re8在线精品视频免费播放| 美日韩一级片在线观看| 国产一区不卡在线| 青青草视频一区| 亚洲一区在线视频观看| 国产精品久久久久久久第一福利| 精品国产成人系列| 3d动漫精品啪啪一区二区竹菊| 91视频免费播放| 岛国一区二区在线观看| 韩国理伦片一区二区三区在线播放| 亚洲影视在线播放| 一区二区三区在线免费视频| 国产精品理论在线观看| 国产欧美一区二区精品性色 | 久久九九久久九九| 日韩欧美国产wwwww| 欧美绝品在线观看成人午夜影视| 91在线观看免费视频| 不卡av免费在线观看| 丰满放荡岳乱妇91ww| 国产69精品久久久久777| 国产一区二区在线观看免费| 毛片一区二区三区| 久久99国产精品久久| 久久99国产乱子伦精品免费| 麻豆成人久久精品二区三区小说| 日日夜夜精品视频免费| 欧美aaaaa成人免费观看视频| 首页欧美精品中文字幕| 美女脱光内衣内裤视频久久网站| 成年人国产精品| av色综合久久天堂av综合| jiyouzz国产精品久久| www.欧美.com| 欧美在线视频你懂得| 欧美日韩久久一区二区| 日韩美女天天操| 国产亚洲一区二区三区四区| 国产精品女主播av| 亚洲一区二区av电影| 石原莉奈一区二区三区在线观看| 九九九久久久精品| 国产 欧美在线| 色婷婷一区二区三区四区| 欧美色手机在线观看| 精品精品国产高清一毛片一天堂| 久久久久久久久一| 精品在线免费观看| 成人激情午夜影院| 欧美日韩三级在线| 精品处破学生在线二十三| 中文字幕一区二区三| 人禽交欧美网站| 粉嫩一区二区三区在线看| 一本大道综合伊人精品热热| 51午夜精品国产| 国产精品丝袜91| 亚洲18色成人| av激情亚洲男人天堂| 69p69国产精品| 国产精品精品国产色婷婷| 日精品一区二区三区| 国产1区2区3区精品美女| 欧美老年两性高潮| 中文字幕一区二区三区乱码在线| 成人一区二区视频| 欧美日韩国产三级| 国产精品第一页第二页第三页| 日本强好片久久久久久aaa| 成人午夜精品一区二区三区| 91精品久久久久久久久99蜜臂|