Copied sources from OpenWRT project
[hides-driver.git] / src / IT9510Type.h
blobd05cbec071ddceb015d7120956a56215334d729a
1 #ifndef __IT9510_TYPE_H__
2 #define __IT9510_TYPE_H__
4 #include "modulatorType.h"
5 #include "ADRF6755.h"
6 #include <linux/kthread.h>
8 #define IT9510User_INTERNAL 1
9 #define IT9133Rx 1
11 #define IT9517Cmd_buildCommand(command, processor) (command + (Word) (processor << 12))
12 #define IT9510_MAX_BIT
14 typedef enum {
15 filter = 0,
16 LayerB = 1,
17 LayerA = 2,
18 LayerAB = 3
19 } TransportLayer;
22 /**
23 * The type defination of Constellation.
25 typedef enum {
26 DownSampleRate_21_OVER_1 = 0, /** Signal uses FEC coding ratio of 21/1 */
27 DownSampleRate_21_OVER_2, /** Signal uses FEC coding ratio of 21/2 */
28 DownSampleRate_21_OVER_3, /** Signal uses FEC coding ratio of 21/3 */
29 DownSampleRate_21_OVER_4, /** Signal uses FEC coding ratio of 21/4 */
30 DownSampleRate_21_OVER_5, /** Signal uses FEC coding ratio of 21/5 */
31 DownSampleRate_21_OVER_6, /** Signal uses FEC coding ratio of 21/6 */
32 } DownSampleRate;
34 typedef enum {
35 DVBT = 1,
36 ISDBT
37 } OutputMode;
39 typedef enum {
40 NullPacketModeDisable = 0,
41 SequentialMode = 1,
42 NormalMode
43 } NullPacketMode;
45 typedef enum {
46 PcrModeDisable = 0,
47 PcrMode1 = 1,
48 PcrMode2,
49 PcrMode3
50 } PcrMode;
52 typedef enum {
53 ARIB_STD_B31 = 0, /** System based on this specification */
54 ISDB_TSB /** System for ISDB-TSB */
55 } SystemIdentification;
58 typedef struct {
59 Constellation constellation; /** Constellation scheme (FFT mode) in use */
60 CodeRate codeRate; /** FEC coding ratio of high-priority stream */
61 } TMCC;
63 typedef struct {
64 Dword frequency; /** Channel frequency in KHz. */
65 Bandwidth bandwidth;
66 TransmissionModes transmissionMode; /** Number of carriers used for OFDM signal */
67 Interval interval; /** Fraction of symbol length used as guard (Guard Interval) */
68 TMCC layerA;
69 TMCC layerB;
70 Bool isPartialReception;
71 } ISDBTModulation;
73 typedef struct _TMCCINFO{
74 TMCC layerA;
75 TMCC layerB;
76 Bool isPartialReception;
77 SystemIdentification systemIdentification;
78 } TMCCINFO, *pTMCCINFO;
81 typedef struct {
82 PcrMode pcrMode;
83 Word bandwidth;
84 ChannelModulation channelModulation;
85 ISDBTModulation isdbtModulation;
86 OutputMode outputMode; //0:un 1:DVB 2:isdbt;
87 Dword packetTimeJitter_ps;
88 Dword pcrExtJitter;
89 int positive; //-1:- / 1:+
90 } PCRCALINFO;
92 /**
93 * The data structure of IT9510
95 typedef struct {
96 /** Basic structure */
97 Handle userData;
98 Byte busId;
99 Byte i2cAddr;
100 Byte* firmwareCodes;
101 Segment* firmwareSegments;
102 Word* firmwarePartitions;
103 Word* scriptSets;
104 ValueSet* scripts;
105 TsInterface tsInterfaceType;
106 Word bandwidth;
107 Dword frequency;
108 Bool booted;
109 Byte slaveIICAddr;
110 ChannelModulation channelModulation;
111 CalibrationInfo calibrationInfo;
112 DCInfo dcInfo;
113 #if IT9510User_INTERNAL
114 SystemConfig systemConfig;
115 #endif
116 ISDBTModulation isdbtModulation;
117 OutputMode outputMode; //0:un 1:DVB 2:isdbt;
118 NullPacketMode nullPacketMode;
119 PcrMode pcrMode;
120 Bool isExtLo;
121 #if IT9510User_INTERNAL
122 Byte deviceType;
123 #endif
124 PCRCALINFO pcrCalInfo;
125 RFGainInfo rfGainInfo;
127 // Fix shared memery for DC table at multi-device issue. By JK.
128 DCtable dc_table[7];
129 DCtable ofs_table[7];
130 RFGainTable rfGain_table[50];
132 #ifdef __ADRF6755_H__
133 ADRF6755INFO ADRF6755;
134 #endif
136 #ifdef __RFFC2072_H__
137 RFFC2072INFO RFFC2072;
138 #endif
140 // for RFFC2072 board issue. Add by JK.
141 #if RF_RELOCK_MONITOR
142 struct task_struct *relock_thread; // for RFFC2072 board.
143 Byte start_detect_relock_status;
144 #endif
145 // check whether device is disconnect. Add by JK.
146 Bool dev_disconnect;
147 } IT9510INFO;
150 extern const Byte IT9510_bitMask[8];
151 #define IT9510_REG_MASK(pos, len) (IT9510_bitMask[len-1] << pos)
152 #define IT9510_REG_CLEAR(temp, pos, len) (temp & (~IT9510_REG_MASK(pos, len)))
153 #define IT9510_REG_CREATE(val, temp, pos, len) ((val << pos) | (IT9510_REG_CLEAR(temp, pos, len)))
154 #define IT9510_REG_GET(value, pos, len) ((value & IT9510_REG_MASK(pos, len)) >> pos)
156 #endif