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

📄 dvb_nim.c

📁 DVB软件,基于CT216软件的开发源程序.
💻 C
字号:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "ap_defs.h"
#include "ct_type.h"
#include "ct_os.h"
#include "ct_nim.h"
#include "ct_sys.h"	//Bill 20060801 ADD DUAL CI
#include "ct_decsa.h"
#include "ct_irq.h"
#include "db_defs.h"
#include "dvb_nim.h"
#include "dvb_msg.h"
#include "dvb_sys.h"
#include "task_cfg.h"
#include "dvb_scan.h"
#include "dvb_fp.h"
#include "dev_io.h"
#ifdef CI_ENABLE
#include "dvb_ci.h"
#endif
#ifdef ATA_ENABLE
#include "dvb_ata.h"
#endif /* end ifdef PVR_ENABLE */
#include "ct_demux.h"
/*******************************************************************************************/
//#define DVB_NIM_DBG

#if 1
#define NIM_MSG(p)
#else
#define NIM_MSG(p)			printf p
#endif

#if 1
#define NIM_DBG(p)
#else
#define NIM_DBG(p) 		printf p
#endif


/*******************************************************************************************/
#define DVB_NIM_DELAY_10_MS                             (10/CTOS_MS_PER_TICKS)   // 1 tick = 10 ms
#define DVB_NIM_DELAY_50_MS                             (50/CTOS_MS_PER_TICKS)   // 1 tick = 10 ms
#define DVB_NIM_DELAY_1000_MS                           (1000/CTOS_MS_PER_TICKS)   // 1 tick = 10 ms
                                                        
#define DVB_NIM_INVAILED_CHANNEL_ID                     0xFFFF
                                                        
#define DVB_NIM_SWAP_LOCAL_FREQUENCY_KHZ                    (8000000)  // KHz
/*******************************************************************************************/
#define	DVB_NIM_DISEQC_STANDBY_OFF                      0x03
#define	DVB_NIM_DISEQC_CMD1                             0xE0
#define	DVB_NIM_DISEQC_CMD2                             0x10
#define	DVB_NIM_DISEQC_CMD3                             0x38
                                                        
#define	DVB_NIM_DISEQC_CMD4_SW01                        0xF0
#define	DVB_NIM_DISEQC_CMD4_SW02                        0xF1
#define	DVB_NIM_DISEQC_CMD4_SW03                        0xF2
#define	DVB_NIM_DISEQC_CMD4_SW04                        0xF3
#define	DVB_NIM_DISEQC_CMD4_SW05                        0xF4
#define	DVB_NIM_DISEQC_CMD4_SW06                        0xF5
#define	DVB_NIM_DISEQC_CMD4_SW07                        0xF6
#define	DVB_NIM_DISEQC_CMD4_SW08                        0xF7
#define	DVB_NIM_DISEQC_CMD4_SW09                        0xF8
#define	DVB_NIM_DISEQC_CMD4_SW10                        0xF9
#define	DVB_NIM_DISEQC_CMD4_SW11                        0xFA
#define	DVB_NIM_DISEQC_CMD4_SW12                        0xFB
#define	DVB_NIM_DISEQC_CMD4_SW13                        0xFC
#define	DVB_NIM_DISEQC_CMD4_SW14                        0xFD
#define	DVB_NIM_DISEQC_CMD4_SW15                        0xFE
#define	DVB_NIM_DISEQC_CMD4_SW16                        0xFF
                                                        
#define DVB_NIM_DISEQC_MOTOR_CMD2_ANY_POSITION          0x30
#define DVB_NIM_DISEQC_MOTOR_CMD2_POLAR_POSITION        0x31
#define DVB_NIM_DISEQC_MOTOR_CMD2_ELEVATION_POSITION    0x32
                                                        
#define DVB_NIM_DISEQC_MOTOR_CMD3_HALT                  0x60
#define DVB_NIM_DISEQC_MOTOR_CMD3_LIMITS_OFF            0x63
#define DVB_NIM_DISEQC_MOTOR_CMD3_LIMIT_EAST            0x66
#define DVB_NIM_DISEQC_MOTOR_CMD3_LIMIT_WEST            0x67
                                                        
#define DVB_NIM_DISEQC_MOTOR_CMD3_DRIVE_EAST            0x68
#define DVB_NIM_DISEQC_MOTOR_CMD3_DRIVE_WEST            0x69
                                                        
#define DVB_NIM_DISEQC_MOTOR_CMD3_STORE_NN              0x6A
#define DVB_NIM_DISEQC_MOTOR_CMD3_GOTO                  0x6B
                                                        
#define DVB_NIM_DISEQC_MOTOR_CMD3_GOTO_X                0x6E
/*******************************************************************************************/
/**
* Define AutoScan Scan Polarity Type.
*/
#define DVB_NIM_SCAN_H_POLARITY                         0               /* Only Scan Horizontal Polarity */
#define DVB_NIM_SCAN_V_POLARITY	                        1               /* Only Scan Vertical Polarity */
#define DVB_NIM_SCAN_H_V_POLARITY                       2               /* Scan both Horizontal and Vertical Polarity */
/*******************************************************************************************/
/**
* Define Nim Event
*/
#define DVB_NIM_EVENT_NONE                              0
#define DVB_NIM_EVENT_LOCK                              1
#define DVB_NIM_EVENT_UNLOCK                            2
#define DVB_NIM_EVENT_ABORT                             3
#define DVB_NIM_EVENT_ERROR                             4
/*******************************************************************************************/
/**
* Define Nim control Event
*/
#define DVB_NIM_CONTROL_EVENT_LOCK		   				0x00000001
#define DVB_NIM_CONTROL_EVENT_STRENGTH   				0x00000002
#define DVB_NIM_CONTROL_EVENT_QUALITY   				0x00000004
/*******************************************************************************************/
/**
* Define the satellite or transponder auto scan parameter structure.
*/
typedef struct
{
	u32     u32LocalFrequency ;	                            /**< This is local frequency. The unit is MHz.	The normal value for C band is 5150 and for Ku band is 11300.*/
	u16	    u16DiSEqC ;			                            /**< DiSEqC off or port 1,2, ...The value 0 indicate the DiSEqC is off */
	u16	    u16QuickSearch;		                            /**< Quick Search(TRUE) / Detailed Search(FALSE) */
	u16	    u16FreeMode;		                            /**< Free(TRUE) / Free + CA(FALSE) */
	u16	    u16Tone22K;			                            /**< 22K tone on(TRUE) /off(FALSE) */	
	u16     u16Control12V;		                            /**< 12V on(TRUE) /12V off(FALSE) */	
	u16     u16PolarityType;                                /**<  */	
    u8      u8LNBType;                                      /**< LNB TYPE add by KS 2007/10/29 

⌨️ 快捷键说明

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