Fix typo
[rfmod.git] / api.h
blobdff292960e988c7ba26747e43a892f69f8dff113
1 /**
2 * Copyright (c) 2016 ITE Technologies, Inc. All rights reserved.
3 *
4 * Date:
5 * 2016/11/17
7 * Module Name:
8 * api.h
10 * Abstract:
11 * ITE Linux API header file.
15 #ifndef _MOD_DTVAPI_
16 #define _MOD_DTVAPI_
18 #define _GNU_SOURCE
19 #include <sys/types.h>
20 #include <sys/stat.h>
21 #include <sys/ioctl.h>
23 #include <sys/time.h>
24 #include <sys/times.h>
25 #include <unistd.h>
26 #include <stdlib.h>
27 #include <stdint.h>
28 #include <string.h>
29 #include <stdio.h>
30 #include <fcntl.h>
31 #include <ctype.h>
32 #include <errno.h>
33 #include <dirent.h>
34 #include <termios.h>
36 #include <linux/dvb/frontend.h>
37 #include <linux/dvb/dmx.h>
39 #include "type.h"
40 #include "iocontrol.h"
41 #include "error.h"
44 #define DTVEXPORT
45 #define __DTVAPI_VERSION__ "1.0.0.0"
46 #define INVALID_HANDLE_VALUE 0
47 #define TRANSMITTER_BLOCK_SIZE 188*174
49 * The type defination of StreamType.
51 typedef enum {
52 DTVStreamType_NONE = 0, // Invalid (Null) StreamType
53 DTVStreamType_DVBH_DATAGRAM,
54 DTVStreamType_DVBH_DATABURST,
55 DTVStreamType_DVBT_DATAGRAM,
56 DTVStreamType_DVBT_PARALLEL,
57 DTVStreamType_DVBT_SERIAL,
58 DTVStreamType_TDMB_DATAGRAM,
59 DTVStreamType_FM_DATAGRAM,
60 DTVStreamType_FM_I2S
61 } DTVStreamType;
64 * Chip Type Information.
66 typedef struct {
67 Word UsbMode;
68 Word VendorID;
69 Word ProductID;
70 } CHIPTYPE_INFO, *PCHIPTYPE_INFO;
73 * Device information.
75 typedef struct {
76 Byte DriverVerion[16]; /** XX.XX.XX.XX Ex., 1.2.3.4 */
77 Byte APIVerion[32]; /** XX.XX.XXXXXXXX.XX Ex., 1.2.3.4 */
78 Byte FWVerionLink[16]; /** XX.XX.XX.XX Ex., 1.2.3.4 */
79 Byte FWVerionOFDM[16]; /** XX.XX.XX.XX Ex., 1.2.3.4 */
80 Byte DateTime[24]; /** Ex.,"2004-12-20 18:30:00" or "DEC 20 2004 10:22:10" with compiler __DATE__ and __TIME__ definitions */
81 Byte Company[8]; /** Ex.,"ITEtech" */
82 Byte SupportHWInfo[32]; /** Ex.," DVBT/ISDBT" */
83 Word ProductID;
84 } DEVICE_INFO, *PDEVICE_INFO;
87 * Driver and API information.
89 typedef struct {
90 Byte DriverVerion[16]; // XX.XX.XX.XX Ex., 1.2.3.4.
91 Byte APIVerion[32]; // XX.XX.XXXXXXXX.XX Ex., 1.2.3.4.
92 Byte FWVerionLink[16]; // XX.XX.XX.XX Ex., 1.2.3.4.
93 Byte FWVerionOFDM[16]; // XX.XX.XX.XX Ex., 1.2.3.4.
94 Byte DateTime[24]; // Ex.,"2004-12-20 18:30:00" or "DEC 20 2004 10:22:10" with compiler __DATE__ and __TIME__ definitions.
95 Byte Company[8]; // Ex.,"Afatech".
96 Byte SupportHWInfo[32]; // Ex.,"Jupiter DVBT/DVBH".
97 Dword error;
98 Byte reserved[128];
99 } DTVDriverInfo, *PDTVDriverInfo;
102 * The type defination of Priority.
104 typedef enum {
105 DTVPriority_HIGH = 0, // DVB-T and DVB-H - identifies high-priority stream.
106 DTVPriority_LOW // DVB-T and DVB-H - identifies low-priority stream.
107 } DTVPriority;
110 * The type defination of IpVersion.
112 typedef enum {
113 DTVIpVersion_IPV4 = 0, // The IP version if IPv4.
114 DTVIpVersion_IPV6 = 1 // The IP version if IPv6.
115 } DTVIpVersion;
119 * The type defination of Ip.
121 typedef struct {
122 DTVIpVersion version; // The version of IP. See the defination of IpVersion.
123 DTVPriority priority; // The priority of IP. See the defination of Priority.
124 Bool cache; // True: IP datagram will be cached in device's buffer. Fasle: IP datagram will be transfer to host.
125 Byte address[16]; // The byte array to store IP address.
126 } DTVIp, *PDTVIp;
129 * The type defination of Platform.
130 * Mostly used is in DVB-H standard
132 typedef struct {
133 Dword platformId; // The ID of platform.
134 char iso639LanguageCode[3]; // The ISO 639 language code for platform name.
135 Byte platformNameLength; // The length of platform name.
136 char platformName[32]; // The char array to store platform name.
137 Word bandwidth; // The operating channel bandwith of this platform.
138 Dword frequency; // The operating channel frequency of this platform.
139 Byte information[4096]; // The extra information about this platform.
140 Word informationLength; // The length of information.
141 Bool hasInformation; // The flag to indicate if there exist extra information.
142 DTVIpVersion ipVersion; // The IP version of this platform.
143 } DTVPlatform, *PDTVPlatform;
146 * The type defination of Target.
148 typedef enum {
149 DTVSectionType_MPE = 0, // Stands for MPE data.
150 DTVSectionType_SIPSI, // Stands for SI/PSI table, but don't have to specify table ID.
151 DTVSectionType_TABLE // Stands for SI/PSI table.
152 } DTVSectionType;
155 * The type defination of FrameRow.
157 typedef enum {
158 DTVFrameRow_256 = 0, // There should be 256 rows for each column in MPE-FEC frame.
159 DTVFrameRow_512, // There should be 512 rows for each column in MPE-FEC frame.
160 DTVFrameRow_768, // There should be 768 rows for each column in MPE-FEC frame.
161 DTVFrameRow_1024 // There should be 1024 rows for each column in MPE-FEC frame.
162 } DTVFrameRow;
165 * The type defination of Pid.
166 * as sectionType = SectionType_SIPSI: only value is valid.
167 * as sectionType = SectionType_TABLE: both value and table is valid.
168 * as sectionType = SectionType_MPE: except table all other fields is valid.
170 typedef struct {
171 Byte table; // The table ID. Which is used to filter specific SI/PSI table.
172 Byte duration; // The maximum burst duration. It can be specify to 0xFF if user don't know the exact value.
173 DTVFrameRow frameRow; // The frame row of MPE-FEC. It means the exact number of rows for each column in MPE-FEC frame.
174 DTVSectionType sectionType; // The section type of pid. See the defination of SectionType.
175 DTVPriority priority; // The priority of MPE data. Only valid when sectionType is set to SectionType_MPE.
176 DTVIpVersion version; // The IP version of MPE data. Only valid when sectionType is set to SectionType_MPE.
177 Bool cache; // True: MPE data will be cached in device's buffer. Fasle: MPE will be transfer to host.
178 Word value; // The 13 bits Packet ID.
179 } DTVPid, *PDTVPid;
182 * The type defination of statistic
184 typedef struct {
185 Dword postVitErrorCount; // ErrorBitCount.
186 Dword postVitBitCount; // TotalBitCount.
187 Word abortCount; // Number of abort RSD packet.
188 Word signalQuality; // Signal quality (0 - 100).
189 Word signalStrength; // Signal strength (0 - 100).
190 Bool signalPresented; // TPS lock.
191 Bool signalLocked; // MPEG lock.
192 Byte frameErrorCount; // Frame Error Ratio (error ratio before MPE-FEC) = frameErrorRate / 128.
193 Byte mpefecFrameErrorCount; // MPE-FEC Frame Error Ratio (error ratio after MPE-FEC) = mpefecFrameErrorCount / 128.
194 } DTVStatistic, *PDTVStatistic;
197 * The type defination of TransmissionMode.
199 typedef enum {
200 DTVTransmissionMode_2K = 0, // OFDM frame consists of 2048 different carriers (2K FFT mode).
201 DTVTransmissionMode_8K = 1, // OFDM frame consists of 8192 different carriers (8K FFT mode).
202 DTVTransmissionMode_4K = 2 // OFDM frame consists of 4096 different carriers (4K FFT mode).
203 } DTVTransmissionMode;
206 * The type defination of Constellation.
208 typedef enum {
209 DTVConstellation_QPSK = 0, // Signal uses QPSK constellation.
210 DTVConstellation_16QAM, // Signal uses 16QAM constellation.
211 DTVConstellation_64QAM // Signal uses 64QAM constellation.
212 } DTVConstellation;
215 * The type defination of Interval.
217 typedef enum {
218 DTVInterval_1_OVER_32 = 0, // Guard interval is 1/32 of symbol length.
219 DTVInterval_1_OVER_16, // Guard interval is 1/16 of symbol length.
220 DTVInterval_1_OVER_8, // Guard interval is 1/8 of symbol length.
221 DTVInterval_1_OVER_4 // Guard interval is 1/4 of symbol length.
222 } DTVInterval;
225 * The type defination of CodeRate.
227 typedef enum {
228 DTVCodeRate_1_OVER_2 = 0, // Signal uses FEC coding ratio of 1/2.
229 DTVCodeRate_2_OVER_3, // Signal uses FEC coding ratio of 2/3.
230 DTVCodeRate_3_OVER_4, // Signal uses FEC coding ratio of 3/4.
231 DTVCodeRate_5_OVER_6, // Signal uses FEC coding ratio of 5/6.
232 DTVCodeRate_7_OVER_8, // Signal uses FEC coding ratio of 7/8.
233 DTVCodeRate_NONE // None, NXT doesn't have this one.
234 } DTVCodeRate;
237 * TPS Hierarchy and Alpha value.
239 typedef enum {
240 DTVHierarchy_NONE = 0, // Signal is non-hierarchical.
241 DTVHierarchy_ALPHA_1, // Signalling format uses alpha of 1.
242 DTVHierarchy_ALPHA_2, // Signalling format uses alpha of 2.
243 DTVHierarchy_ALPHA_4 // Signalling format uses alpha of 4.
244 } DTVHierarchy;
247 * The type defination of Bandwidth.
249 typedef enum {
250 DTVBandwidth_6M = 0, // Signal bandwidth is 6MHz.
251 DTVBandwidth_7M, // Signal bandwidth is 7MHz.
252 DTVBandwidth_8M, // Signal bandwidth is 8MHz.
253 DTVBandwidth_5M // Signal bandwidth is 5MHz.
254 } DTVBandwidth;
257 * The defination of ChannelInformation.
259 typedef struct {
260 Dword frequency; // Channel frequency in KHz.
261 DTVTransmissionMode transmissionMode; // Number of carriers used for OFDM signal.
262 DTVConstellation constellation; // Constellation scheme (FFT mode) in use.
263 DTVInterval interval; // Fraction of symbol length used as guard (Guard Interval).
264 DTVPriority priority; // The priority of stream.
265 DTVCodeRate highCodeRate; // FEC coding ratio of high-priority stream.
266 DTVCodeRate lowCodeRate; // FEC coding ratio of low-priority stream.
267 DTVHierarchy hierarchy; // Hierarchy levels of OFDM signal.
268 DTVBandwidth bandwidth;
269 } DTVChannelTPSInfo, *PDTVChannelTPSInfo;
272 * Temp data structure of Gemini.
274 typedef struct
276 Byte charSet;
277 Word charFlag;
278 Byte string[16];
279 } DTVLabel, *PDTVLabel;
282 * Temp data structure of Gemini.
284 typedef struct
286 Word ensembleId;
287 DTVLabel ensembleLabel;
288 Byte totalServices;
289 } DTVEnsemble, *PDTVEnsemble;
292 * The type defination of Service.
293 * Mostly used is in T-DMB standard
295 typedef struct {
296 Byte serviceType; // Service Type(P/D): 0x00: Program, 0x80: Data.
297 Dword serviceId;
298 Dword frequency;
299 DTVLabel serviceLabel;
300 Byte totalComponents;
301 } DTVService, *PDTVService;
304 * The type defination of Service Component.
306 typedef struct {
307 Byte serviceType; // Service Type(P/D): 0x00: Program, 0x80: Data.
308 Dword serviceId; // Service ID.
309 Word componentId; // Stream audio/data is subchid, packet mode is SCId.
310 Byte componentIdService; // Component ID within Service.
311 DTVLabel componentLabel; // The label of component. See the defination of Label.
312 Byte language; // Language code.
313 Byte primary; // Primary/Secondary.
314 Byte conditionalAccess; // Conditional Access flag.
315 Byte componentType; // Component Type (A/D).
316 Byte transmissionId; // Transmission Mechanism ID.
317 } DTVComponent, *PDTVComponent;
319 typedef struct _MODULATION_PARAM{
320 Dword IOCTLCode;
321 Byte highCodeRate;
322 Byte transmissionMode;
323 Byte constellation;
324 Byte interval;
325 } MODULATION_PARAM, *PMODULATION_PARAM;
328 * The type defination of handle type.
330 typedef enum {
331 EAGLEI = 0,
332 EAGLEII,
333 } HandleType;
335 /*******************************************************************************
336 * PURPOSE:
337 * Open handle, Power On and Check device information.
339 * PARAMETERS:
340 * handleType: typedef enum HandleType.
341 * DevNo: device number for multi deivce.
343 * RETURNS:
344 * 0 if no error, non-zero value otherwise.
345 ******************************************************************************/
346 DTVEXPORT Dword g_ITEAPI_TxDeviceInit(IN HandleType handleType, IN IN Byte DevNo);
348 /*******************************************************************************
349 * PURPOSE:
350 * Clean up & Power off device.
352 * PARAMETERS:
353 * None.
355 * RETURNS:
356 * 0 if no error, non-zero value otherwise.
357 *******************************************************************************/
358 DTVEXPORT Dword g_ITEAPI_TxDeviceExit(IN Byte DevNo);
360 /*******************************************************************************
361 * PURPOSE:
362 * Set Channel Modulation to Tx.
364 * PARAMETERS:
365 * struct MODULATION_PARAM.
367 * RETURNS:
368 * 0 if no error, non-zero value otherwise.
369 *******************************************************************************/
370 DTVEXPORT Dword g_ITEAPI_TxSetChannelModulation( IN MODULATION_PARAM ChannelModulation_Setting, IN Byte DevNo);
372 /*******************************************************************************
373 * PURPOSE:
374 * Set Channel frequency and bandwidth to Tx.
376 * PARAMETERS:
377 * bfrequency
378 * bbandwidth
380 * RETURNS:
381 * 0 if no error, non-zero value otherwise.
382 *******************************************************************************/
383 DTVEXPORT Dword g_ITEAPI_TxSetChannel(IN Dword bfrequency, IN Word bbandwidth, IN Byte DevNo);
385 /*******************************************************************************
386 * PURPOSE:
387 * Set Channel frequency and bandwidth to Dual Tx.
389 * PARAMETERS:
390 * bfrequency1
391 * bfrequency2
392 * bbandwidth
394 * RETURNS:
395 * 0 if no error, non-zero value otherwise.
396 *******************************************************************************/
397 DTVEXPORT Dword g_ITEAPI_TxSetChannelDual(IN Dword bfrequency1, IN Dword bfrequency2, IN Word bbandwidth, IN Byte DevNo);
399 /*******************************************************************************
400 * PURPOSE:
401 * Set Mode Enable.
403 * PARAMETERS:
404 * OnOff
406 * RETURNS:
407 * 0 if no error, non-zero value otherwise.
408 *******************************************************************************/
409 DTVEXPORT Dword g_ITEAPI_TxSetModeEnable(IN Byte OnOff, IN Byte DevNo);
411 /*******************************************************************************
412 * PURPOSE:
413 * Set Device Type.
415 * PARAMETERS:
416 * DeviceType
418 * RETURNS:
419 * 0 if no error, non-zero value otherwise.
420 *******************************************************************************/
421 DTVEXPORT Dword g_ITEAPI_TxSetDeviceType(IN Byte DeviceType, IN Byte DevNo);
423 /*******************************************************************************
424 * PURPOSE:
425 * Get Device Type.
427 * PARAMETERS:
428 * DeviceType
430 * RETURNS:
431 * 0: no error. Return current device type.
432 * non-zero: Using Default devicetype. return default type
433 * and return error message.
434 *******************************************************************************/
435 DTVEXPORT Dword g_ITEAPI_TxGetDeviceType(OUT Byte *DeviceType, IN Byte DevNo);
437 /*******************************************************************************
438 * PURPOSE:
439 * Adjust Output Gain to Tx.
441 * PARAMETERS:
442 * Gain_value
443 * Out_Gain_valu
445 * RETURNS:
446 * 0 if no error, non-zero value otherwise.
447 *******************************************************************************/
448 DTVEXPORT Dword g_ITEAPI_TxAdjustOutputGain(IN int Gain_value, OUT int *Out_Gain_valu, IN Byte DevNo);
450 /*******************************************************************************
451 * PURPOSE:
452 * Add Pid number, for DVB-T mode.
454 * PARAMETERS:
455 * byIndex - 0 ~ 31.
456 * wProgId - pid number.
458 * RETURNS:
459 * 0 if no error, non-zero value otherwise.
460 ******************************************************************************/
461 DTVEXPORT Dword g_ITEAPI_TxAddPID(IN Byte byIndex, IN Word wProgId, IN Byte DevNo);
463 /*******************************************************************************
464 * PURPOSE:
465 * Clear all the PID's set previously by g_ITEAPI_AddPID(),
466 * for DVB-T mode.
467 * PARAMETERS:
468 * None.
470 * RETURNS:
471 * 0 if no error, non-zero value otherwise.
472 ******************************************************************************/
473 DTVEXPORT Dword g_ITEAPI_TxResetPidFilter(IN Byte DevNo);
475 /*******************************************************************************
476 * PURPOSE:
477 * Add Pid number with extension parameters, specifically for DVB-H.
479 * PARAMETERS:
480 * pid - pid structure data (Specify the PID number and relevant attributes in DVB-H mode).
482 * RETURNS:
483 * 0 if no error, non-zero value otherwise.
484 ******************************************************************************/
485 DTVEXPORT Dword g_ITEAPI_TxAddPIDEx(IN DTVPid pid, IN Byte DevNo);
487 /*******************************************************************************
488 * PURPOSE:
489 * Start to Transfer data from device, for DVB-T mode.
490 * The drievr starts to receive TS data and store it in the ring buffer.
492 * PARAMETERS:
493 * None.
495 * RETURNS:
496 * 0 if no error, non-zero value otherwise.
497 ******************************************************************************/
498 Dword g_ITEAPI_StartTransfer(IN Byte DevNo);
500 /*******************************************************************************
501 * PURPOSE:
502 * For DTVCAM. Start to Transfer data from device, for DVB-T mode.
503 * The drievr starts to receive TS data and store it in the ring buffer.
505 * PARAMETERS:
506 * None.
508 * RETURNS:
509 * 0 if no error, non-zero value otherwise.
510 ******************************************************************************/
511 Dword g_ITEAPI_StartTransfer_CMD(IN Byte DevNo);
513 /*******************************************************************************
514 * PURPOSE:
515 * Stop to Transfer data from device, for DVB-T mode.
517 * PARAMETERS:
518 * None.
520 * RETURNS:
521 * 0 if no error, non-zero value otherwise.
522 ******************************************************************************/
523 DTVEXPORT Dword g_ITEAPI_StopTransfer(IN Byte DevNo);
525 /*******************************************************************************
526 * PURPOSE:
527 * For DTVCAM. Stop to Transfer data from device, for DVB-T mode.
529 * PARAMETERS:
530 * None.
532 * RETURNS:
533 * 0 if no error, non-zero value otherwise.
534 ******************************************************************************/
535 DTVEXPORT Dword g_ITEAPI_StopTransfer_CMD(IN Byte DevNo);
537 /*******************************************************************************
538 * PURPOSE:
539 * Control Power Saving. The function can be called by application for power saving while idle mode.
541 * PARAMETERS:
542 * byCtrl - 1: Power Up, 0: Power Down.
543 * Power Up : Resume device to normal state.
544 * Power Down : Suspend device to hibernation state.
546 * RETURNS:
547 * 0 if no error, non-zero value otherwise.
548 ******************************************************************************/
549 DTVEXPORT Dword g_ITEAPI_TxPowerCtl(IN Byte byCtrl, IN Byte DevNo);
551 /*******************************************************************************
552 * PURPOSE:
553 * Get Driver & API Version.
555 * PARAMETERS:
556 * pTxDriverInfo
557 * - Return driver information with PDEVICE_INFO structure.
559 * RETURNS:
560 * 0 if no error, non-zero value otherwise.
561 ******************************************************************************/
562 DTVEXPORT Dword g_ITEAPI_TxGetDrvInfo(
563 OUT PDEVICE_INFO pDeviceInfo,
564 IN Byte DevNo);
566 /*******************************************************************************
567 * PURPOSE:
568 * Read OFDM register.
570 * PARAMETERS:
571 * dwRegAddr - Register address.
572 * pbyData - Register value.
574 * RETURNS:
575 * 0 if no error, non-zero value otherwise.
576 ******************************************************************************/
577 DTVEXPORT Dword g_ITEAPI_TxReadRegOFDM(
578 IN Dword dwRegAddr,
579 OUT Byte* pbyData,
580 IN Byte DevNo);
582 /*******************************************************************************
583 * PURPOSE:
584 * Write OFDM register.
586 * PARAMETERS:
587 * dwRegAddr - Register address.
588 * byData - Register value.
590 * RETURNS:
591 * 0 if no error, non-zero value otherwise.
592 ******************************************************************************/
593 DTVEXPORT Dword g_ITEAPI_TxWriteRegOFDM(
594 IN Dword dwRegAddr,
595 IN Byte byData,
596 IN Byte DevNo);
598 /*******************************************************************************
599 * PURPOSE:
600 * Read LINK register.
602 * PARAMETERS:
603 * dwRegAddr - Register address.
604 * pbyData - Register value.
606 * RETURNS:
607 * 0 if no error, non-zero value otherwise.
608 ******************************************************************************/
609 DTVEXPORT Dword g_ITEAPI_TxReadRegLINK(
610 IN Dword dwRegAddr,
611 OUT Byte* pbyData,
612 IN Byte DevNo);
614 /*******************************************************************************
615 * PURPOSE:
616 * Write LINK register.
618 * PARAMETERS:
619 * dwRegAddr - Register address.
620 * byData - Register value.
622 * RETURNS:
623 * 0 if no error, non-zero value otherwise.
624 ******************************************************************************/
625 DTVEXPORT Dword g_ITEAPI_TxWriteRegLINK(
626 IN Dword dwRegAddr,
627 IN Byte byData,
628 IN Byte DevNo);
630 /*******************************************************************************
631 * PURPOSE:
632 * Write EEPROM data.
634 * PARAMETERS:
635 * wRegAddr - Register address.
636 * pbyData - Register value.
638 * RETURNS:
639 * 0 if no error, non-zero value otherwise.
640 ******************************************************************************/
641 DTVEXPORT Dword g_ITEAPI_TxWriteEEPROM(
642 IN Word wRegAddr,
643 OUT Byte byData,
644 IN Byte DevNo);
646 /*******************************************************************************
647 * PURPOSE:
648 * Read EEPROM data.
650 * PARAMETERS:
651 * wRegAddr - Register address.
652 * pbyData - Register value.
654 * RETURNS:
655 * 0 if no error, non-zero value otherwise.
656 ******************************************************************************/
657 DTVEXPORT Dword g_ITEAPI_TxReadEEPROM(
658 IN Word wRegAddr,
659 OUT Byte* pbyData,
660 IN Byte DevNo);
662 /*******************************************************************************
663 * PURPOSE:
664 * Get Gain Range.
666 * PARAMETERS:
667 * frequency, bandwidth, MaxGain, MinGain
669 * RETURNS:
670 * 0 if no error, non-zero value otherwise.
671 ******************************************************************************/
672 DTVEXPORT Dword g_ITEAPI_TxGetGainRange(
673 IN Dword frequency,
674 IN Word bandwidth,
675 OUT int *MaxGain,
676 OUT int *MinGain,
677 IN Byte DevNo);
679 /*******************************************************************************
680 * PURPOSE:
681 * Get TPS.
683 * PARAMETERS:
684 * TPS structure
686 * RETURNS:
687 * 0 if no error, non-zero value otherwise.
688 ******************************************************************************/
689 DTVEXPORT Dword g_ITEAPI_TxGetTPS(
690 OUT TPS *tps,
691 IN Byte DevNo);
693 /*******************************************************************************
694 * PURPOSE:
695 * Set TPS.
697 * PARAMETERS:
698 * TPS structure
700 * RETURNS:
701 * 0 if no error, non-zero value otherwise.
702 ******************************************************************************/
703 DTVEXPORT Dword g_ITEAPI_TxSetTPS(
704 IN TPS tps,
705 IN Byte DevNo);
707 /*******************************************************************************
708 * PURPOSE:
709 * Get Output Gain.
711 * PARAMETERS:
712 * gain
714 * RETURNS:
715 * 0 if no error, non-zero value otherwise.
716 ******************************************************************************/
717 DTVEXPORT Dword g_ITEAPI_TxGetOutputGain(
718 OUT int *gain,
719 IN Byte DevNo);
721 /*******************************************************************************
722 * PURPOSE:
723 * Get Number of Device.
725 * PARAMETERS:
726 * NumOfDev - Number of Device.
728 * RETURNS:
729 * 0 if no error, non-zero value otherwise.
730 ******************************************************************************/
731 DTVEXPORT Dword g_ITEAPI_TxGetNumOfDevice(
732 OUT Byte *NumOfDev,
733 IN Byte DevNo);
735 /*******************************************************************************
736 * PURPOSE:
737 * g_ITEAPI_TxSendHwPSITable: Send Hardware PSI Table.
739 * PARAMETERS:
740 * bufferSize - size of TableBuffer.
741 * TableBuffer
743 * RETURNS:
744 * 0 if no error, non-zero value otherwise.
745 ******************************************************************************/
746 DTVEXPORT Dword g_ITEAPI_TxSendCustomPacketOnce(
747 IN int bufferSize,
748 IN Byte *TableBuffer,
749 IN Byte DevNo);
751 /*******************************************************************************
752 * PURPOSE:
753 * g_ITEAPI_TxAccessFwPSITable: Send Hardware PSI Table.
755 * PARAMETERS:
756 * bufferSize - size of TableBuffer.
757 * TableBuffer
758 * index - PSI Table Index.
760 * RETURNS:
761 * 0 if no error, non-zero value otherwise.
762 ******************************************************************************/
763 DTVEXPORT Dword g_ITEAPI_TxSetPeridicCustomPacket(
764 IN int bufferSize,
765 IN Byte *TableBuffer,
766 IN Byte index,
767 IN Byte DevNo);
769 /*******************************************************************************
770 * PURPOSE:
771 * g_ITEAPI_TxSetFwPSITableTimer: Send Hardware PSI Table.
773 * PARAMETERS:
774 * index - PSI Table Index.
775 * timer_interval- timer.
777 * RETURNS:
778 * 0 if no error, non-zero value otherwise.
779 ******************************************************************************/
780 DTVEXPORT Dword g_ITEAPI_TxSetPeridicCustomPacketTimer(
781 IN Byte index,
782 IN Word timer_interval,
783 IN Byte DevNo);
785 /*******************************************************************************
786 * PURPOSE:
787 * Write Data.
789 * PARAMETERS:
790 * pBuffer.
791 * pdwBufferLength.
793 * RETURNS:
794 * 0: no error. write sucess.
795 * non-zero: write fail. buffer overflow or other error. maybe write again.
796 ******************************************************************************/
797 DTVEXPORT Dword g_ITEAPI_TxSendTSData(
798 OUT Byte* pBuffer,
799 IN OUT Dword pdwBufferLength,
800 IN Byte DevNo);
802 /*******************************************************************************
803 * PURPOSE:
804 * Set IQ Table From File.
806 * PARAMETERS:
807 * ptrIQtable - file content load from binary file.
808 * IQtableSize - file size.
810 * RETURNS:
811 * 0 if no error, non-zero value otherwise.
812 ******************************************************************************/
813 DTVEXPORT Dword g_ITEAPI_TxSetIQTable(
814 IN Byte* ptrIQtable,
815 IN Word IQtableSize,
816 IN Byte DevNo);
818 /*******************************************************************************
819 * PURPOSE:
820 * Get Chip Version ID.
822 * PARAMETERS:
823 * ChipType
825 * RETURNS:
826 * 0 if no error, non-zero value otherwise.
827 ******************************************************************************/
828 DTVEXPORT Dword g_ITEAPI_TxGetChipType(
829 OUT Word* chipType,
830 IN Byte DevNo);
832 /*******************************************************************************
833 * PURPOSE:
834 * Control Pid Filter.
836 * PARAMETERS:
837 * Byte control.
838 * Byte enable.
839 * Byte DevNo.
841 * RETURNS:
842 * 0 if no error, non-zero value otherwise.
843 ******************************************************************************/
844 Dword g_ITEAPI_TxControlPidFilter(
845 IN Byte control,
846 IN Byte enable,
847 IN Byte DevNo);
849 /*******************************************************************************
850 * PURPOSE:
851 * Set DC Calibration Value.
853 * PARAMETERS:
854 * dc_i
855 * dc_q
857 * RETURNS:
858 * 0 if no error, non-zero value otherwise.
859 ******************************************************************************/
860 DTVEXPORT Dword g_ITEAPI_TxSetDCCalibrationValue(
861 IN int dc_i,
862 IN int dc_q,
863 IN Byte DevNo);
865 /*******************************************************************************
866 * PURPOSE:
867 * Write Low Bit Rate Data.
869 * PARAMETERS:
870 * isUseLowBrate
872 * RETURNS:
873 * 0 if no error, non-zero value otherwise.
874 ******************************************************************************/
875 DTVEXPORT Dword g_ITEAPI_TxWriteLowBitRateData(
876 IN Byte* pBuffer,
877 IN Dword BufferLength,
878 IN Byte DevNo);
880 /*******************************************************************************
881 * PURPOSE:
882 * Write command.
884 * PARAMETERS:
885 * isUseLowBrate
887 * RETURNS:
888 * 0 if no error, non-zero value otherwise.
889 ******************************************************************************/
890 Dword g_ITEAPI_TxWriteCmd(
891 IN Word len,
892 IN Byte* cmd,
893 IN Byte DevNo);
895 /*******************************************************************************
896 * PURPOSE:
897 * Set ISDB-T Channel Modulation.
899 * PARAMETERS:
900 * ISDBTModulation isdbtModulation.
902 * RETURNS:
903 * 0 if no error, non-zero value otherwise.
904 ******************************************************************************/
905 DTVEXPORT Dword g_ITEAPI_TxSetISDBTChannelModulation(
906 IN ISDBTModulation isdbtModulation,
907 IN Byte DevNo);
909 /*******************************************************************************
910 * PURPOSE:
911 * Set TMCC Information.
913 * PARAMETERS:
914 * TMCCINFO TmccInfo.
915 * Bool actualInfo.
917 * RETURNS:
918 * 0 if no error, non-zero value otherwise.
919 ******************************************************************************/
920 DTVEXPORT Dword g_ITEAPI_TxSetTMCCInfo(
921 IN TMCCINFO TmccInfo,
922 IN Byte DevNo);
924 /*******************************************************************************
925 * PURPOSE:
926 * Get TMCC Information.
928 * PARAMETERS:
929 * pTMCCINFO pTmccInfo.
931 * RETURNS:
932 * 0 if no error, non-zero value otherwise.
933 ******************************************************************************/
934 DTVEXPORT Dword g_ITEAPI_TxGetTMCCInfo(
935 OUT pTMCCINFO pTmccInfo,
936 IN Byte DevNo);
938 /*******************************************************************************
939 * PURPOSE:
940 * Get TMCC Information.
942 * PARAMETERS:
943 * Word* BitRate_Kbps.
945 * RETURNS:
946 * 0 if no error, non-zero value otherwise.
947 ******************************************************************************/
948 DTVEXPORT Dword g_ITEAPI_TxGetTSinputBitRate(
949 OUT Word* BitRate_Kbps,
950 IN Byte DevNo);
952 /*******************************************************************************
953 * PURPOSE:
954 * Add Pid To ISDB-T Pid Filter.
956 * PARAMETERS:
957 * Word* BitRate_Kbps.
959 * RETURNS:
960 * 0 if no error, non-zero value otherwise.
961 ******************************************************************************/
962 DTVEXPORT Dword g_ITEAPI_TxAddPidToISDBTPidFilter(
963 IN Byte index,
964 IN Pid pid,
965 IN TransportLayer layer,
966 IN Byte DevNo);
968 /*******************************************************************************
969 * PURPOSE:
970 * Set PCR Mode.
972 * PARAMETERS:
973 * PcrMode mode.
975 * RETURNS:
976 * 0 if no error, non-zero value otherwise.
977 ******************************************************************************/
978 DTVEXPORT Dword g_ITEAPI_TxSetPCRMode(
979 IN PcrMode mode,
980 IN Byte DevNo);
982 /*******************************************************************************
983 * PURPOSE:
984 * Set DC Table.
986 * PARAMETERS:
987 * DCInfo.
989 * RETURNS:
990 * 0 if no error, non-zero value otherwise.
991 ******************************************************************************/
992 DTVEXPORT Dword g_ITEAPI_TxSetDCTable(
993 IN DCtable* pDCtable,
994 IN DCtable* pOFStable,
995 IN Word tableGroups,
996 IN Byte DevNo);
998 /*******************************************************************************
999 * PURPOSE:
1000 * Get Frequency Index.
1002 * PARAMETERS:
1003 * frequencyindex.
1005 * RETURNS:
1006 * 0 if no error, non-zero value otherwise.
1007 ******************************************************************************/
1008 DTVEXPORT Dword g_ITEAPI_TxGetFrequencyIndex(
1009 IN Byte* frequencyindex,
1010 IN Byte DevNo);
1012 /*******************************************************************************
1013 * PURPOSE:
1014 * Get DTV Mode.
1016 * PARAMETERS:
1017 * DTVMode.
1019 * RETURNS:
1020 * 0 if no error, non-zero value otherwise.
1021 ******************************************************************************/
1022 DTVEXPORT Dword g_ITEAPI_TxGetDTVMode(
1023 OUT Byte* DTVMode,
1024 IN Byte DevNo);
1026 /*******************************************************************************
1027 * PURPOSE:
1028 * Enable TPS Encryption.
1030 * PARAMETERS:
1031 * Encryption key.
1033 * RETURNS:
1034 * 0 if no error, non-zero value otherwise.
1035 ******************************************************************************/
1036 DTVEXPORT Dword g_ITEAPI_TxEnableTPSEncryption(
1037 IN Dword key,
1038 IN Byte DevNo);
1040 /*******************************************************************************
1041 * PURPOSE:
1042 * Disable TPS Encryption.
1044 * PARAMETERS:
1045 * None.
1047 * RETURNS:
1048 * 0 if no error, non-zero value otherwise.
1049 ******************************************************************************/
1050 DTVEXPORT Dword g_ITEAPI_TxDisableTPSEncryption(
1051 IN Byte DevNo);
1053 /*******************************************************************************
1054 * PURPOSE:
1055 * Get IT9560 Firmware info.
1057 * PARAMETERS:
1058 * None.
1060 * RETURNS:
1061 * 0 if no error, non-zero value otherwise.
1062 ******************************************************************************/
1063 Dword g_ITEAPI_IT9560GetStatistic(
1064 OUT Byte *FwVersion,
1065 IN Byte DevNo);
1067 /*******************************************************************************
1068 * PURPOSE:
1069 * Write IT9560 EEPROM.
1071 * PARAMETERS:
1072 * None.
1074 * RETURNS:
1075 * 0 if no error, non-zero value otherwise.
1076 ******************************************************************************/
1077 Dword g_ITEAPI_IT9560WriteEEPROM(
1078 IN Word slaveAddress,
1079 IN Word startAddressOffset,
1080 IN Byte *buffer,
1081 IN Word writeSize,
1082 IN Byte DevNo);
1084 /*******************************************************************************
1085 * PURPOSE:
1086 * Read IT9560 EEPROM.
1088 * PARAMETERS:
1089 * None.
1091 * RETURNS:
1092 * 0 if no error, non-zero value otherwise.
1093 ******************************************************************************/
1094 Dword g_ITEAPI_IT9560ReadEEPROM(
1095 IN Word slaveAddress,
1096 IN Word startAddressOffset,
1097 OUT Byte *buffer,
1098 IN Word readSize,
1099 IN Byte DevNo);
1101 /*******************************************************************************
1102 * PURPOSE:
1103 * Write IT9560 Registers.
1105 * PARAMETERS:
1106 * None.
1108 * RETURNS:
1109 * 0 if no error, non-zero value otherwise.
1110 ******************************************************************************/
1111 Dword g_ITEAPI_IT9560WriteRegisters(
1112 IN Dword dwRegAddr,
1113 IN Processor processor,
1114 IN Byte bufferLength,
1115 IN Byte *buffer,
1116 IN Byte DevNo);
1118 /*******************************************************************************
1119 * PURPOSE:
1120 * Read IT9560 Registers.
1122 * PARAMETERS:
1123 * None.
1125 * RETURNS:
1126 * 0 if no error, non-zero value otherwise.
1127 ******************************************************************************/
1128 Dword g_ITEAPI_IT9560ReadRegisters(
1129 IN Dword dwRegAddr,
1130 IN Processor processor,
1131 IN Byte bufferLength,
1132 OUT Byte *buffer,
1133 IN Byte DevNo);
1135 #endif