DVBCore  22.3.0
Open Source DVB Engine
stbhwtun.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
24 // pre-processor mechanism so multiple inclusions don't cause compilation error
25 
26 #ifndef _STBHWTUN_H
27 
28 #define _STBHWTUN_H
29 
30 //---#includes for this file---------------------------------------------------
31 #include "techtype.h"
32 #include "stbhwc.h"
33 
34 //---Constant and macro definitions for public use-----------------------------
35 #define SYMBOL_RATE_AUTO 0
36 
37 //---Enumerations for public use-----------------------------------------------
38 typedef enum e_stb_tune_system_type
39 {
40  TUNE_SYSTEM_TYPE_UNKNOWN = 0,
41  TUNE_SYSTEM_TYPE_DVBT = 1,
42  TUNE_SYSTEM_TYPE_DVBT2 = 2,
43  TUNE_SYSTEM_TYPE_DVBS = 3,
44  TUNE_SYSTEM_TYPE_DVBS2 = 4,
45  TUNE_SYSTEM_TYPE_DVBC = 5
46 } E_STB_TUNE_SYSTEM_TYPE;
47 
48 
49 typedef enum e_stb_tune_signal_type
50 {
51  TUNE_SIGNAL_NONE = 0,
52  TUNE_SIGNAL_QPSK = 1,
53  TUNE_SIGNAL_COFDM = 2,
54  TUNE_SIGNAL_QAM = 4,
55  TUNE_SIGNAL_ANALOG = 8
56 } E_STB_TUNE_SIGNAL_TYPE;
57 
58 /* Terrestrial */
59 typedef enum e_stb_tune_tmode
60 {
61  TUNE_MODE_COFDM_1K = 0,
62  TUNE_MODE_COFDM_2K = 1,
63  TUNE_MODE_COFDM_4K = 2,
64  TUNE_MODE_COFDM_8K = 3,
65  TUNE_MODE_COFDM_16K = 4,
66  TUNE_MODE_COFDM_32K = 5,
67  TUNE_MODE_COFDM_UNDEFINED = 255
68 } E_STB_TUNE_TMODE;
69 
70 typedef enum e_stb_tune_tbwidth
71 {
72  TUNE_TBWIDTH_8MHZ = 0,
73  TUNE_TBWIDTH_7MHZ = 1,
74  TUNE_TBWIDTH_6MHZ = 2,
75  TUNE_TBWIDTH_5MHZ = 3
76 } E_STB_TUNE_TBWIDTH;
77 
78 typedef enum e_stb_tune_tconst
79 {
80  TUNE_TCONST_QPSK = 0,
81  TUNE_TCONST_QAM16 = 1,
82  TUNE_TCONST_QAM64 = 2,
83  TUNE_TCONST_QAM128 = 3,
84  TUNE_TCONST_QAM256 = 4,
85  TUNE_TCONST_UNDEFINED = 255
86 } E_STB_TUNE_TCONST;
87 
88 typedef enum E_STB_TUNE_THIERARCHY
89 {
90  TUNE_THIERARCHY_NONE = 0,
91  TUNE_THIERARCHY_1 = 1,
92  TUNE_THIERARCHY_2 = 2,
93  TUNE_THIERARCHY_4 = 4,
94  TUNE_THIERARCHY_8 = 8,
95  TUNE_THIERARCHY_16 = 16,
96  TUNE_THIERARCHY_32 = 32,
97  TUNE_THIERARCHY_64 = 64,
98  TUNE_THIERARCHY_128 = 128,
99  TUNE_THIERARCHY_UNDEFINED = 255
100 } E_STB_TUNE_THIERARCHY;
101 
102 typedef enum e_stb_tune_tcoderate
103 {
104  TUNE_TCODERATE_1_2 = 0,
105  TUNE_TCODERATE_2_3 = 1,
106  TUNE_TCODERATE_3_4 = 2,
107  TUNE_TCODERATE_5_6 = 3,
108  TUNE_TCODERATE_7_8 = 4,
109  TUNE_TCODERATE_UNDEFINED = 255
110 } E_STB_TUNE_TCODERATE;
111 
112 typedef enum e_stb_tune_tguardint
113 {
114  TUNE_TGUARDINT_1_32 = 0,
115  TUNE_TGUARDINT_1_16 = 1,
116  TUNE_TGUARDINT_1_8 = 2,
117  TUNE_TGUARDINT_1_4 = 3,
118  TUNE_TGUARDINT_1_128 = 4,
119  TUNE_TGUARDINT_19_128 = 5,
120  TUNE_TGUARDINT_19_256 = 6,
121  TUNE_TGUARDINT_UNDEFINED = 255
122 } E_STB_TUNE_TGUARDINT;
123 
124 /* Cable */
125 typedef enum e_stb_tune_cmode
126 {
127  TUNE_MODE_QAM_4 = 0,
128  TUNE_MODE_QAM_8 = 1,
129  TUNE_MODE_QAM_16 = 2,
130  TUNE_MODE_QAM_32 = 3,
131  TUNE_MODE_QAM_64 = 4,
132  TUNE_MODE_QAM_128 = 5,
133  TUNE_MODE_QAM_256 = 6,
134  TUNE_MODE_QAM_UNDEFINED = 255
135 } E_STB_TUNE_CMODE;
136 
137 
138 /* Satellite */
139 typedef enum
140 {
141  TUNE_MOD_AUTO,
142  TUNE_MOD_QPSK, /* quartenary phase shift key */
143  TUNE_MOD_8PSK, /* octenary phase shift key */
144  TUNE_MOD_16QAM /* Not valid for DVB-S2 */
145 } E_STB_TUNE_MODULATION;
146 
147 typedef enum e_stb_tune_lnb_voltage
148 {
149  LNB_VOLTAGE_OFF = 0,
150  LNB_VOLTAGE_14V = 1,
151  LNB_VOLTAGE_18V = 2
152 } E_STB_TUNE_LNB_VOLTAGE;
153 
154 typedef enum e_stb_tune_fec
155 {
156  TUNE_FEC_AUTOMATIC = 0,
157  TUNE_FEC_1_2 = 1,
158  TUNE_FEC_2_3 = 2,
159  TUNE_FEC_3_4 = 3,
160  TUNE_FEC_5_6 = 4,
161  TUNE_FEC_7_8 = 5,
162  TUNE_FEC_1_4 = 6,
163  TUNE_FEC_1_3 = 7,
164  TUNE_FEC_2_5 = 8,
165  TUNE_FEC_8_9 = 9,
166  TUNE_FEC_9_10 = 10,
167  TUNE_FEC_3_5 = 11,
168  TUNE_FEC_4_5 = 12
169 } E_STB_TUNE_FEC;
170 
171 
172 /* Analog */
173 typedef enum e_stb_tune_analog_video_type
174 {
175  TUNE_ANLG_VIDEO_PAL_I = 0,
176  TUNE_ANLG_VIDEO_PAL_B = 1,
177  TUNE_ANLG_VIDEO_PAL_G = 2,
178  TUNE_ANLG_VIDEO_PAL_D = 3,
179  TUNE_ANLG_VIDEO_PAL_K = 4,
180  TUNE_ANLG_VIDEO_PAL_L = 5,
181  TUNE_ANLG_VIDEO_PAL_LDASH = 6
182 } E_STB_TUNE_ANALOG_VIDEO_TYPE;
183 
184 
185 //---Global type defs for public use-------------------------------------------
186 
187 //---Global Function prototypes for public use---------------------------------
188 
193 void STB_TuneInitialise(U8BIT paths);
194 
207 void STB_TuneSetSystemType(U8BIT path, E_STB_TUNE_SYSTEM_TYPE type);
208 
215 E_STB_TUNE_SYSTEM_TYPE STB_TuneGetSystemType(U8BIT path);
216 
222 void STB_TuneAutoRelock(U8BIT path, BOOLEAN state);
223 
230 U16BIT STB_TuneGetSignalType(U8BIT path);
231 
240 void STB_TuneSetSignalType(U8BIT path, E_STB_TUNE_SIGNAL_TYPE type);
241 
247 U32BIT STB_TuneGetMinTunerFreqKHz(U8BIT path);
248 
254 U32BIT STB_TuneGetMaxTunerFreqKHz(U8BIT path);
255 
269 void STB_TuneStartTuner(U8BIT path, U32BIT freq, U32BIT srate, E_STB_TUNE_FEC fec,
270  S8BIT freq_off, E_STB_TUNE_TMODE tmode, E_STB_TUNE_TBWIDTH tbwidth,
271  E_STB_TUNE_CMODE cmode, E_STB_TUNE_ANALOG_VIDEO_TYPE anlg_vtype);
272 
277 void STB_TuneRestartTuner(U8BIT path);
278 
283 void STB_TuneStopTuner(U8BIT path);
284 
290 U8BIT STB_TuneGetSignalStrength(U8BIT path);
291 
297 U8BIT STB_TuneGetDataIntegrity(U8BIT path);
298 
304 U32BIT STB_TuneGetActualTerrFrequency(U8BIT path);
305 
311 S8BIT STB_TuneGetActualTerrFreqOffset(U8BIT path);
312 
318 E_STB_TUNE_TMODE STB_TuneGetActualTerrMode(U8BIT path);
319 
325 E_STB_TUNE_TBWIDTH STB_TuneGetActualTerrBwidth(U8BIT path);
326 
332 E_STB_TUNE_TCONST STB_TuneGetActualTerrConstellation(U8BIT path);
333 
339 E_STB_TUNE_THIERARCHY STB_TuneGetActualTerrHierarchy(U8BIT path);
340 
346 E_STB_TUNE_TCODERATE STB_TuneGetActualTerrLpCodeRate(U8BIT path);
347 
353 E_STB_TUNE_TCODERATE STB_TuneGetActualTerrHpCodeRate(U8BIT path);
354 
360 E_STB_TUNE_TGUARDINT STB_TuneGetActualTerrGuardInt(U8BIT path);
361 
367 U16BIT STB_TuneGetActualTerrCellId(U8BIT path);
368 
374 void STB_TuneSetPLP(U8BIT path, U8BIT plp);
375 
381 U8BIT STB_TuneGetPLP(U8BIT path);
382 
388 void STB_TuneActiveAerialPower(U8BIT path, BOOLEAN enabled);
389 
394 void STB_TuneSetLOFrequency(U8BIT tuner, U16BIT lo_freq);
395 
401 void STB_TuneSetModulation(U8BIT path, E_STB_TUNE_MODULATION modulation);
402 
408 void STB_TuneSetLNBVoltage(U8BIT path, E_STB_TUNE_LNB_VOLTAGE voltage);
409 
415 void STB_TuneSet22kState(U8BIT path, BOOLEAN state);
416 
422 void STB_TuneSet12VSwitch(U8BIT path, BOOLEAN state);
423 
431 U8BIT STB_TuneGetDISEQCReply(U8BIT path, U8BIT *data, U32BIT timeout);
432 
439 void STB_TuneSendDISEQCMessage(U8BIT path, U8BIT *data, U8BIT size);
440 
446 void STB_TuneSetPulseLimitEast(U8BIT path, U16BIT count);
447 
453 void STB_TuneSetPulseLimitWest(U8BIT path, U16BIT count);
454 
455 void STB_TuneChangePulsePosition(U8BIT path, U16BIT count);
456 
462 U16BIT STB_TuneGetPulsePosition(U8BIT path);
463 
464 void STB_TuneAtPulsePosition(U8BIT path, U16BIT position);
465 
471 void STB_TuneChangeSkewPosition(U8BIT path, U16BIT count);
472 
479 U8BIT STB_TuneSatGetCarrierStrength(U8BIT path, U32BIT freq);
480 
486 U32BIT STB_TuneGetActualSymbolRate(U8BIT path);
487 
493 E_STB_TUNE_CMODE STB_TuneGetActualCableMode(U8BIT path);
494 
504 E_STB_TUNE_SYSTEM_TYPE STB_TuneGetSupportedSystemType(U8BIT path);
505 
506 #endif // _STBHWTUN_H
507 
void STB_TuneSendDISEQCMessage(U8BIT path, U8BIT *data, U8BIT size)
Sends the DisEqc message.
U16BIT STB_TuneGetSignalType(U8BIT path)
Gets the signal types of the given tuner path. This will be a bitmask of supported types defined by E...
U8BIT STB_TuneGetDataIntegrity(U8BIT path)
Returns the current data integrity.
U8BIT STB_TuneGetDISEQCReply(U8BIT path, U8BIT *data, U32BIT timeout)
Receives a DisEqc reply.
void STB_TuneSetModulation(U8BIT path, E_STB_TUNE_MODULATION modulation)
Sets the type of modulation for the specified tuner.
Function prototypes for HW control.
U16BIT STB_TuneGetActualTerrCellId(U8BIT path)
Returns the cell id the current terrestrial signal.
U8BIT STB_TuneGetPLP(U8BIT path)
Gets the Physical Layer Pipe to be acquired.
U32BIT STB_TuneGetMinTunerFreqKHz(U8BIT path)
Returns the minimum tuner frequency in KHz.
void STB_TuneInitialise(U8BIT paths)
Initialises the tuner component.
E_STB_TUNE_TCODERATE STB_TuneGetActualTerrHpCodeRate(U8BIT path)
Returns the HP code rate of the current terrestrial signal.
U8BIT STB_TuneSatGetCarrierStrength(U8BIT path, U32BIT freq)
Returns the carrier signal strength as a percentage.
E_STB_TUNE_TBWIDTH STB_TuneGetActualTerrBwidth(U8BIT path)
Returns the actual bandwidth of the current terrestrial signal.
void STB_TuneSetPLP(U8BIT path, U8BIT plp)
Sets the Physical Layer Pipe to be acquired.
void STB_TuneSetLNBVoltage(U8BIT path, E_STB_TUNE_LNB_VOLTAGE voltage)
Sets the LNB voltage for the given tuner.
void STB_TuneSetPulseLimitWest(U8BIT path, U16BIT count)
Sets the pulse limit for the west.
E_STB_TUNE_THIERARCHY STB_TuneGetActualTerrHierarchy(U8BIT path)
Returns the heirarchy of the current terrestrial signal.
E_STB_TUNE_SYSTEM_TYPE STB_TuneGetSystemType(U8BIT path)
Returns the signal type as set by STB_TuneSetTerrType or as re-written by the driver.
void STB_TuneAutoRelock(U8BIT path, BOOLEAN state)
Enables or disabled auto tuner relocking.
void STB_TuneRestartTuner(U8BIT path)
Restarts tuner and attempts to lock to signal in StartTuner call.
void STB_TuneSet22kState(U8BIT path, BOOLEAN state)
Turns the 22 kHz tone on or off.
void STB_TuneChangeSkewPosition(U8BIT path, U16BIT count)
Changes the value of skew position count.
E_STB_TUNE_TGUARDINT STB_TuneGetActualTerrGuardInt(U8BIT path)
Returns the guard interval of the current terrestrial signal.
void STB_TuneActiveAerialPower(U8BIT path, BOOLEAN enabled)
Enables/disables aerial power for DVB-T.
void STB_TuneSetPulseLimitEast(U8BIT path, U16BIT count)
Sets the pulse limit for the east.
U8BIT STB_TuneGetSignalStrength(U8BIT path)
Returns the current signal strength.
U16BIT STB_TuneGetPulsePosition(U8BIT path)
Returns the current pulse position.
void STB_TuneStopTuner(U8BIT path)
Stops any locking attempt, or unlocks if locked.
U32BIT STB_TuneGetMaxTunerFreqKHz(U8BIT path)
Returns the maximum tuner frequency in KHz.
void STB_TuneSetSystemType(U8BIT path, E_STB_TUNE_SYSTEM_TYPE type)
Set the demodulator's signal type. This function must be called before each call to STB_TuneStartTune...
System Wide Global Technical Data Type Definitions.
void STB_TuneSetSignalType(U8BIT path, E_STB_TUNE_SIGNAL_TYPE type)
This function is only relevant for tuners that support more than one signal type; for tuners that don...
U32BIT STB_TuneGetActualSymbolRate(U8BIT path)
Returns the actual symbol rate when a tuner has locked.
void STB_TuneSet12VSwitch(U8BIT path, BOOLEAN state)
Sets the 12V switch for the given tuner.
S8BIT STB_TuneGetActualTerrFreqOffset(U8BIT path)
Returns the actual freq offset of the current terrestrial signal.
E_STB_TUNE_CMODE STB_TuneGetActualCableMode(U8BIT path)
Returns the cable mode when the tuner has locked.
E_STB_TUNE_SYSTEM_TYPE STB_TuneGetSupportedSystemType(U8BIT path)
Returns the system type supported by the path. This function differs from STB_TuneGetSystemType which...
U32BIT STB_TuneGetActualTerrFrequency(U8BIT path)
Returns the actual frequency of the current terrestrial signal.
void STB_TuneStartTuner(U8BIT path, U32BIT freq, U32BIT srate, E_STB_TUNE_FEC fec, S8BIT freq_off, E_STB_TUNE_TMODE tmode, E_STB_TUNE_TBWIDTH tbwidth, E_STB_TUNE_CMODE cmode, E_STB_TUNE_ANALOG_VIDEO_TYPE anlg_vtype)
Starts the tuner, it will then attempt to lock specified signal. Unrequired parameters can be passed ...
E_STB_TUNE_TCODERATE STB_TuneGetActualTerrLpCodeRate(U8BIT path)
Returns the LP code rate of the current terrestrial signal.
E_STB_TUNE_TCONST STB_TuneGetActualTerrConstellation(U8BIT path)
Returns the constellation of the current terrestrial signal.
E_STB_TUNE_TMODE STB_TuneGetActualTerrMode(U8BIT path)
Returns the actual mode of the current terrestrial signal.
void STB_TuneSetLOFrequency(U8BIT tuner, U16BIT lo_freq)
Sets the local oscillator frequency used by the LNB.