亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久蜜桃一区二区| 欧美日韩久久久一区| 久久精品国产澳门| 亚洲成人免费在线观看| 亚洲精品国产视频| 亚洲日穴在线视频| 日本一区二区成人在线| 日韩一区二区三区观看| 欧美日韩亚洲不卡| 91久久精品一区二区| 丁香激情综合国产| 国产精品资源在线观看| 九一久久久久久| 免费精品视频在线| 蜜桃av一区二区在线观看| 午夜精品国产更新| 亚洲成人动漫在线免费观看| 一区二区三区在线免费观看| 日本一区二区久久| 国产精品国产a| 中文字幕亚洲精品在线观看| 国产欧美日韩综合精品一区二区| 久久综合色播五月| www国产精品av| 国产色91在线| 国产精品午夜在线观看| 国产精品理论在线观看| 国产精品午夜免费| 亚洲免费在线电影| 一区二区三区四区高清精品免费观看| 一区二区三区四区亚洲| 一区二区三区欧美亚洲| 亚洲不卡av一区二区三区| 日韩在线一区二区三区| 日韩精品国产精品| 五月综合激情网| 美女视频第一区二区三区免费观看网站| 日韩成人午夜精品| 美女视频黄免费的久久| 国产不卡视频在线播放| 日韩精品中文字幕在线不卡尤物| 日韩欧美一级精品久久| 国产午夜精品福利| 亚洲欧洲精品成人久久奇米网| 日本一区二区三区国色天香| 中文字幕制服丝袜成人av| 一区二区三区四区不卡在线| 日韩激情一区二区| 久草这里只有精品视频| 成人av影视在线观看| 成人一区二区三区在线观看 | 99国产精品视频免费观看| av一二三不卡影片| 欧美午夜片在线看| 精品久久久久av影院| 26uuu久久天堂性欧美| 国产精品欧美精品| 日日骚欧美日韩| 国产成人av电影| 欧美在线高清视频| 精品精品欲导航| 国产精品电影院| 亚洲精品ww久久久久久p站| 一区二区三区中文免费| 美女一区二区视频| 99久久国产免费看| 欧美大黄免费观看| 亚洲黄色免费网站| 蜜乳av一区二区| av不卡免费电影| 日韩欧美在线一区二区三区| 亚洲欧洲精品一区二区三区 | 国产精品视频免费| 亚洲国产成人av网| 国产不卡在线播放| 欧美精三区欧美精三区| 国产精品白丝在线| 日本不卡1234视频| 在线一区二区三区四区| 久久精品人人爽人人爽| 视频一区国产视频| 91在线云播放| 久久久国产一区二区三区四区小说| 亚洲精品日韩专区silk| 蜜桃视频第一区免费观看| 95精品视频在线| 国产亚洲成aⅴ人片在线观看| 亚洲国产一区在线观看| 不卡一区中文字幕| 精品入口麻豆88视频| 首页亚洲欧美制服丝腿| 91浏览器在线视频| 久久精品在这里| 免费在线观看一区| 欧美日韩情趣电影| 日韩一区有码在线| 欧美日韩一二三| 亚洲国产精品高清| 国精产品一区一区三区mba视频| 欧美日韩中文另类| 亚洲色图清纯唯美| 99久久精品国产一区二区三区| 欧美日韩在线观看一区二区| 一区在线观看视频| 波多野结衣精品在线| 久久美女艺术照精彩视频福利播放 | 亚洲免费在线播放| 成人综合婷婷国产精品久久| 精品久久久久久久人人人人传媒| 亚洲成av人片一区二区| 欧美在线视频日韩| 亚洲美女在线一区| 成人黄色777网| 亚洲色图欧洲色图婷婷| 欧美在线不卡视频| 日韩和欧美一区二区三区| 91精品国产91久久久久久一区二区| 日韩国产欧美在线观看| 日韩欧美中文一区二区| 国产麻豆精品theporn| 国产精品婷婷午夜在线观看| 色综合天天做天天爱| 一区二区三区四区视频精品免费 | 卡一卡二国产精品| 久久久一区二区三区捆绑**| 高清在线不卡av| 亚洲男人电影天堂| 91麻豆精品国产91久久久| 蜜臀91精品一区二区三区| 久久久久久久久久久电影| 成人黄色777网| 亚洲成人精品一区| 精品三级av在线| jlzzjlzz国产精品久久| 亚洲午夜av在线| 2019国产精品| 色悠久久久久综合欧美99| 午夜av电影一区| 久久久久久久久久久电影| 色婷婷精品大在线视频| 日韩av电影天堂| 麻豆91免费看| 亚洲国产精品二十页| 欧美三级日韩三级| 国产精一品亚洲二区在线视频| 成人欧美一区二区三区黑人麻豆| 3atv一区二区三区| 国产在线视频一区二区三区| 亚洲日本乱码在线观看| 91精品国产全国免费观看| 丁香六月久久综合狠狠色| 亚洲大片精品永久免费| 国产欧美一区二区精品久导航 | 97se亚洲国产综合自在线不卡| 亚洲国产精品一区二区尤物区| 久久久一区二区| 欧美日韩一区二区三区视频| 国产iv一区二区三区| 天天综合色天天| 亚洲日本va在线观看| 久久久综合九色合综国产精品| 日本高清不卡视频| 高清成人免费视频| 另类综合日韩欧美亚洲| 亚洲综合偷拍欧美一区色| 久久精品一区二区三区不卡| 欧美亚洲国产bt| 不卡的av网站| 久久www免费人成看片高清| 亚洲一区日韩精品中文字幕| 国产视频一区不卡| 日韩欧美国产不卡| 在线视频观看一区| 成年人午夜久久久| 国产乱码精品1区2区3区| 日韩专区欧美专区| 亚洲影视在线观看| ...中文天堂在线一区| 久久久久高清精品| 欧美成va人片在线观看| 欧美四级电影网| 97久久精品人人澡人人爽| 国产精品中文字幕欧美| 久久99热这里只有精品| 日韩专区中文字幕一区二区| 一区二区三区视频在线看| 国产精品久久久久精k8| 国产亚洲一区字幕| 亚洲18女电影在线观看| 亚洲色图色小说| 成人欧美一区二区三区| 国产精品污网站| 国产欧美日韩在线| 精品国产乱码久久久久久老虎| 欧美精品精品一区| 欧美美女网站色| 欧美日韩aaaaaa| 欧美福利一区二区| 91超碰这里只有精品国产| 欧美日韩高清在线播放|