-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemodulatorextend.h
1326 lines (1178 loc) · 33.4 KB
/
demodulatorextend.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef __DEMODULATOREXTEND_H__
#define __DEMODULATOREXTEND_H__
//#include <stdio.h>
//#include <math.h>
#include "type.h"
#include "user.h"
#include "register.h"
#include "error.h"
#include "cmd.h"
/*
#include "i2cimpl.h"
#include "spiimpl.h"
#include "sdioimpl.h"
*/
#include "usb2impl.h"
#include "demodulator.h"
#define Tuner_Panasonic_ENV77H11D5 0x01
#define Tuner_Microtune_MT2060 0x02
#define Tuner_Maxlinear_MXL5003 0x03
#define Tuner_Philip_TD1316AFIHP 0x04
#define Tuner_Freescale_FS803A 0x05
#define Tuner_Quantek_QT1010 0x06
#define Tuner_Panasonic_ENV75H10D8 0x07
#define Tuner_Lg_TDTMG252D 0x08
#define Tuner_Himax_HTXR03A 0x09
#define Tuner_Alps_TDQ44M 0x0A
#define Tuner_Infineon_TUA6045 0x0B
#define Tuner_Infineon_TUA6034 0x0C
#define Tuner_Maxlinear_MXL5005 0x0D
#define Tuner_Thomson_664X 0x0E
#define Tuner_Thomson_6630 0x0F
#define Tuner_Samsung_DTOS403 0x10
#define Tuner_Samsung_DTOS446 0x11
#define Tuner_Freescale_FS803A_DLNA 0x12
#define Tuner_Microtune_MT2060_7SAW 0x13
#define Tuner_Alps_TDQ03 0x14
#define Tuner_Thomson_759X 0x15
#define Tuner_Empire_DTN317 0x16
#define Tuner_Partsnic_PDHTF05D 0x17
#define Tuner_Panasonic_ENG37A30GF 0x18
#define Tuner_Philips_FQD1216ME_MK5 0x19
#define Tuner_Infineon_TUA6041 0x1A
#define Tuner_Philips_TDA18271 0x1B
#define Tuner_Alps_TDQD1X001A 0x1C
#define Tuner_Maxlinear_MXL5005_RSSI 0x1D
#define Tuner_Thomson_75101 0x1E
#define Tuner_Sharp_5056 0x1F
#define Tuner_Freescale_MC44CD02 0x20
#define Tuner_Microtune_MT2260B0 0x21
#define Tuner_Philips_TDA18291HN 0x22
#define Tuner_Microtune_MT2266 0x23
#define Tuner_Integrant_ITD3020 0x24
#define Tuner_Afatech_PEACOCK 0x25
#define Tuner_Xceive_XC3028L 0x26
#define Tuner_Infineon_TUA9001 0x27
#define Tuner_Fitipower_FC0011 0x28
#define Tuner_Afatech_AF9007 0xFF
#define Tuner_Maxlinear_MXL5007 0xA0
/**
* Define commands for AGC general set function
*/
#define APO_AGC_SET_RF_ACQUIRE 1
#define APO_AGC_SET_RF_TRACK 2
#define APO_AGC_SET_IF_ACQUIRE 3
#define APO_AGC_SET_IF_TRACK 4
#define APO_AGC_SET_ADC_OUT_DESIRED_S 5
#define APO_AGC_SET_RF_TOP_S 6
#define APO_AGC_SET_IF_TOP_S 7
#define APO_AGC_SET_RF_LOCK_TH_ACQUIRE 8
#define APO_AGC_SET_RF_LOCK_TH_TRACK 9
#define APO_AGC_SET_IF_LOCK_TH_ACQUIRE 10
#define APO_AGC_SET_IF_LOCK_TH_TRACK 11
#define APO_AGC_SET_ADC_OUT_DESIRED_M 12
#define APO_AGC_SET_RF_TOP_M 13
#define APO_AGC_SET_IF_TOP_M 14
#define APO_AGC_SET_RF_TOP 15
#define APO_AGC_SET_IF_TOP 16
/**
* Define commands for AGC general set function
*/
#define APO_AGC_GET_RF_ACQUIRE 1
#define APO_AGC_GET_RF_TRACK 2
#define APO_AGC_GET_IF_ACQUIRE 3
#define APO_AGC_GET_IF_TRACK 4
#define APO_AGC_GET_RF_LOCK_TH_ACQUIRE 5
#define APO_AGC_GET_RF_LOCK_TH_TRACK 6
#define APO_AGC_GET_IF_LOCK_TH_ACQUIRE 7
#define APO_AGC_GET_IF_LOCK_TH_TRACK 8
#define APO_AGC_GET_RF_MAX 9
#define APO_AGC_GET_RF_MIN 10
#define APO_AGC_GET_RF_TOP_S 11
#define APO_AGC_GET_RF_TOP_M 17
#define APO_AGC_GET_IF_MAX 12
#define APO_AGC_GET_IF_MIN 13
#define APO_AGC_GET_IF_TOP_S 14
#define APO_AGC_GET_IF_TOP_M 18
#define APO_AGC_GET_RF_TOP 19
#define APO_AGC_GET_IF_TOP 20
#define APO_AGC_GET_ADC_OUT_DESIRED_S 15
#define APO_AGC_GET_ADC_OUT_DESIRED_M 16
/**
* Define Options
*/
#define APO_OPTION_FREQSHIFT 0x00000001
#define APO_OPTION_DYNATOP 0x00000002
#define APO_OPTION_RET_NOW 0x00000004
#define APO_OPTION_REPEAT_RETRAIN 0x00000008
/**
* Define Demodulator_getDouble index
*/
#define APO_GET_FREQ_SHIFT 1
#define APO_GET_ORIG_RF_TOP 2
#define APO_GET_ORIG_IF_TOP 3
#define APO_GET_FINAL_RF_TOP 4
#define APO_GET_FINAL_IF_TOP 5
#define APO_GET_BEST_RF_TOP 6
#define APO_GET_BEST_IF_TOP 7
/**
* Define commands for general CE information function
*/
#define APO_AGC_CLEAR_REGS 1
#define APO_AGC_STALL_OFSM_ACCESS 2
#define APO_AGC_RESTORE_OFSM_ACCESS 3
#define APO_DCA_EN_UPPER 0x01
#define APO_DCA_EN_LOWER 0x02
#define APO_DCA_BOTH 0x00
/** keep for internal api release */
/**
* The type defination of PidTable.
*/
typedef struct {
Word pid[32];
} PidTable;
typedef struct {
PidTable pidtable[2];
Byte pidcount;
Bool pidinit;
} PidInfo;
/** end keep for internal api release */
extern Word DemodulatorExtend_diversityMode;
extern double DemodulatorExtend_crystalFrequency;
extern Word Tdmb_bitRateTable[64];
/**
* Set control bus and tuner.
*
* @param demodulator the handle of demodulator.
* @param busId The ID of bus.
* @param tunerId The ID of tuner.
* @return Error_NO_ERROR: successful, non-zero error code otherwise.
* @example <pre>
* Dword error = Error_NO_ERROR;
* Ganymede ganymede;
*
* // Set I2C as the control bus.
* error = Demodulator_setBusTuner ((Demodulator*) &ganymede, Bus_I2C, Tuner_MICROTUNE_MT2060);
* if (error)
* printf ("Error Code = %X", error);
* else
* printf ("Success");
* </pre>
*/
Dword Demodulator_setBusTuner (
IN Demodulator* demodulator,
IN Word busId,
IN Word tunerId
);
/**
* Set firmware and script.
*
* @param demodulator the handle of demodulator.
* @param crystalFrequency The value of crystal frequency on board (KHz).
* @param adcFrequency The value of desire internal ADC frequency (Hz).
* @return Error_NO_ERROR: successful, non-zero error code otherwise.
* @example <pre>
* Dword error = Error_NO_ERROR;
* Ganymede ganymede;
*
* // Set frequencies.
* error = Demodulator_setCrystalAdcFrequency ((Demodulator*) &ganymede, 30000, 20156250);
* if (error)
* printf ("Error Code = %X", error);
* else
* printf ("Success");
* </pre>
*/
Dword Demodulator_setCrystalAdcFrequency (
IN Demodulator* demodulator,
IN Dword crystalFrequency,
IN Dword adcFrequency
);
/**
* Set firmware and script.
*
* @param demodulator the handle of demodulator.
* @param firmwareCodes The byte array of firmware code.
* @param firmwareSegments The segments of firmwares.
* @param firmwarePartitions The partitions of firmwares.
* @param scriptSets The sets of script.
* @param scripts The byte array of script.
* @param tunerScriptSets The sets of tunerScript.
* @param tunerScripts The byte array of tunerScript.
* @return Error_NO_ERROR: successful, non-zero error code otherwise.
* @example <pre>
* Dword error = Error_NO_ERROR;
* Byte firmware[65535];
* ValueSet script[256];
* ValueSet tunerScript[256];
* Ganymede ganymede;
*
* // Set I2C as the control bus.
* error = Demodulator_setFirmwareScript ((Demodulator*) &ganymede, firmware, 65535, script, 256, tunerScript, 256);
* if (error)
* printf ("Error Code = %X", error);
* else
* printf ("Success");
* </pre>
*/
Dword Demodulator_setFirmwareScript (
IN Demodulator* demodulator,
IN Byte* firmwareCodes,
IN Segment* firmwareSegments,
IN Byte* firmwarePartitions,
IN Word* scriptSets,
IN ValueSet* scripts,
IN Word* tunerScriptSets,
IN ValueSet* tunerScripts
);
/**
* Get the statistic values of demodulator, it includes Pre-Viterbi BER,
* Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag,
* Signal Quality, Signal Strength, Delta-T for DVB-H time slicing.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param statistic the structure that store all statistic values.
* @return Error_NO_ERROR: successful, non-zero error code otherwise.
* @example <pre>
* Dword error = Error_NO_ERROR;
* ChannelStatistic channelStatistic;
* double preBer;
* double postBer;
* Ganymede ganymede;
*
* // Set statistic range.
* error = Demodulator_getChannelStatistic ((Demodulator*) &ganymede, 0, &channelStatistic);
* if (error)
* printf ("Error Code = %X", error);
* else
* printf ("Success");
* preBer = (double) channelStatistic.preVitErrorCount / (double) channelStatistic.preVitBitCount;
* printf ("Pre-Viterbi BER = %f\n", preBer);
* postBer = (double) channelStatistic.postVitErrorCount / (double) channelStatistic.postVitBitCount;
* printf ("Post-Viterbi BER = %f\n", postBer);
* printf ("Abort Count = %d\n", channelStatistic.abortCount);
* </pre>
*/
Dword Demodulator_getChannelStatistic (
IN Demodulator* demodulator,
IN Byte chip,
OUT ChannelStatistic* channelStatistic
);
/**
* Set the counting range for Pre-Viterbi and Post-Viterbi.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7. NOTE: When the architecture is set to Architecture_DCA
* this parameter is regard as don't care.
* @param preErrorCount the number of super frame for Pre-Viterbi.
* @param preBitCount the number of packet unit for Post-Viterbi.
* @param snr the signal to noise ratio.
* @return Error_NO_ERROR: successful, non-zero error code otherwise.
*/
Dword Demodulator_getPreVitBer (
IN Demodulator* demodulator,
IN Byte chip,
OUT Dword* preErrorCount,
OUT Dword* preBitCount,
OUT double* snr
);
/**
* Set the counting range for Pre-Viterbi and Post-Viterbi.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7. NOTE: When the architecture is set to Architecture_DCA
* this parameter is regard as don't care.
* @param preErrorCount the number of super frame for Pre-Viterbi.
* @param preBitCount the number of packet unit for Post-Viterbi.
* @param snr the signal to noise ratio.
* @return Error_NO_ERROR: successful, non-zero error code otherwise.
*/
Dword Demodulator_getSoftBer (
IN Demodulator* demodulator,
IN Byte chip,
OUT Dword* preErrorCount,
OUT Dword* preBitCount,
OUT double* snr
);
/**
* This function is used to get signal quality indicator.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param sqi signal quality indicator.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* Byte sqi;
*
* Demodulator_getSqi (0x38, 0, &sqi);
* </pre>
*/
Dword Demodulator_getSqi (
IN Demodulator* demodulator,
IN Byte chip,
OUT Byte* sqi
);
/**
* Get IF agc voltage.
*
* @param demodulator the handle of demodulator.
* @param doPullUpVolt The pull up voltage of tunre.
* @param dopVolt IF AGC voltage to be returned.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getIfAgcVoltage (
IN Demodulator* demodulator,
IN double doPullUpVolt,
OUT double* dopVolt
);
/**
* Set maximum RF agc.
*
* @param demodulator the handle of demodulator.
* @param doMaxRfAgc The maximum value of RF AGC.
* @param doVolt RF AGC voltage to be set.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_setMaxRfAgc (
IN Demodulator* demodulator,
IN double doMaxRfAgc,
IN double doVolt
);
/**
* Set minimum rf agc.
*
* @param demodulator the handle of demodulator.
* @param doMinRfAgc The minimum value of RF AGC.
* @param doVolt RF AGC voltage to be set.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_setMinRfAgc (
IN Demodulator* demodulator,
IN double doMinRfAgc,
IN double doVolt
);
/**
* Set max if agc.
*
* @param demodulator the handle of demodulator.
* @param doMaxIfAgc The maximum value of IF AGC.
* @param doVolt IF AGC voltage to be set.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_setMaxIfAgc (
IN Demodulator* demodulator,
IN double doMaxIfAgc,
IN double doVolt
);
/**
* Set min if agc.
*
* @param demodulator the handle of demodulator.
* @param doMinIfAgc The minimum value of IF AGC.
* @param doVolt IF AGC voltage to be set.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_setMinIfAgc (
IN Demodulator* demodulator,
IN double doMinIfAgc,
IN double doVolt
);
/**
* General agc set function.
*
* @param demodulator the handle of demodulator.
* @param ucCmd .
* @param vpParams .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_setAgc (
IN Demodulator* demodulator,
IN Byte ucCmd,
IN Word* vpParams
);
/**
* General agc get function.
*
* @param demodulator the handle of demodulator.
* @param ucCmd .
* @param vpParams .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getAgc (
IN Demodulator* demodulator,
IN Byte ucCmd,
IN void* vpParams
);
/**
* Check if INR detected.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param count INR count.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getInrCount (
IN Demodulator* demodulator,
IN Byte chip,
OUT Word* count
);
/**
* Check if CCI happens.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param cci0 1: CCI happen, 0: CCI doesn't happen.
* @param cci1 1: CCI happen, 0: CCI doesn't happen.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_isCci (
IN Demodulator* demodulator,
IN Byte chip,
OUT Bool* cci0,
OUT Bool* cci1
);
/**
* Check if ACI happens
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param aci0 1: ACI happen, 0: ACI doesn't happen.
* @param aci1 1: ACI happen, 0: ACI doesn't happen.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_isAci (
IN Demodulator* demodulator,
IN Byte chip,
OUT Bool* aci0,
OUT Bool* aci1
);
/**
* Get frequency offset.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param doTs Sampling period.
* @param lpNormOffset Normalized frequency offset (carrier spacing).
* @param lpOffset Frequency offset (22 bits) (Hz).
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getFrequencyOffset (
IN Demodulator* demodulator,
IN Byte chip,
IN double elementaryPeriod,
OUT Long* normalizedOffset,
OUT Long* offset
);
/**
* Get sampling clock offset in second
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param adcFrequency ADC frequency.
* @param elementaryPeriod Sampling period.
* @param offset ADC sampling clock offset in sec.
* @param offsetPpm ADC sampling clock offset in PPM.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getTimeOffset (
IN Demodulator* demodulator,
IN Byte chip,
IN double adcFrequency,
IN double elementaryPeriod,
OUT double* offset,
OUT double* offsetPpm
);
/**
* Set IF1 frequency of MT2060.
*
* @param demodulator the handle of demodulator.
* @param dwIf1 The IF1 frequency (KHz).
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_setMT2060If1 (
IN Demodulator* demodulator,
IN Dword dwIf1
);
/**
* Clear FFT window position valid bit.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_resetFftWinPos (
IN Demodulator* demodulator,
IN Byte chip
);
/**
* Clear FFT window position valid bit.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param delta Delta value for FFT window position.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getFftWinPos (
IN Demodulator* demodulator,
IN Byte chip,
IN Long* delta
);
/**
* Get crystal frequency (KHz).
*
* @param demodulator the handle of demodulator.
* @param fpFreq Crystal frequency.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getXtalFreq (
IN Demodulator* demodulator,
IN float* fpFreq
);
/**
* Test register.
*
* @param demodulator the handle of demodulator.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_testRegister (
IN Demodulator* demodulator
);
/**
* Dump register.
*
* @param demodulator the handle of demodulator.
* @param cpFileName The name of file to be write.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_dumpRegister (
IN Demodulator* demodulator,
IN char* cpFileName
);
/**
* Get frequency response from hardware.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param tone Sub-Carrier Index ( Real Index = 200*wIndex).
* @param realPart Real part of Constellation value.
* @param imaginaryPart Imaginary part of Constellation value.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getFrequencyResponse (
IN Demodulator* demodulator,
IN Byte chip,
OUT Word* tone,
OUT Long* realPart,
OUT Long* imaginaryPart
);
/**
* Get constellation value.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param tone Sub-Carrier Index ( Real Index = 200*wIndex).
* @param realPart Real part of Constellation value.
* @param imaginaryPart Imaginary part of Constellation value.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getConstellation (
IN Demodulator* demodulator,
IN Byte chip,
IN Word tone,
OUT float* realPart,
OUT float* imaginaryPart
);
/**
* Capture constellation value (2).
*
* @param demodulator the handle of demodulator.
* @param wIndex Sub-Carrier Index ( Real Index = 200*wIndex).
* @param wpReal real part of constellation value.
* @param wpImag imaginary part of constellation value.
* @param wpH2 H2 value.
* @param wpRealH real part of H.
* @param wpImagH imaginary part of H.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_capConstellation2 (
IN Demodulator* demodulator,
IN Word wIndex,
OUT Byte* ucpSymCnt,
OUT Byte* ucpReal,
OUT Byte* ucpImag,
OUT Word* wpRealH,
OUT Word* wpImagH
);
/**
* Get status.
*
* @param demodulator the handle of demodulator.
* @param dwpStatus Pointer to system information.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getStatus (
IN Demodulator* demodulator,
OUT Dword* dwpStatus
);
/**
* Get frequency shift.
*
* @param demodulator the handle of demodulator.
* @param index .
* @param dopShift .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getDouble (
IN Demodulator* demodulator,
IN Byte index,
IN double* dopValue
);
/**
* Get IR byte.
*
* @param demodulator the handle of demodulator.
* @param ucpIRByte IR packet buffer.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getIr (
IN Demodulator* demodulator,
OUT Byte* ucpIRByte
);
/**
* Dump EEPROM.
*
* @param demodulator the handle of demodulator.
* @param dwDelay .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_dumpEeprom (
IN Demodulator* demodulator,
IN Dword dwDelay
);
/**
* Load file to EEPROM.
*
* @param fileName File name to load to EEPROM.
* @param dwDelay .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_loadEeprom (
IN Demodulator* demodulator,
IN char* fileName,
IN Dword dwDelay
);
/**
*
* @param demodulator the handle of demodulator.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_isFecMonEnabled (
IN Demodulator* demodulator,
OUT Bool* enabled
);
/**
* Generate ce information.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param command .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_genCeInfoFunc (
IN Demodulator* demodulator,
IN Byte chip,
IN Byte command
);
/**
* Get ce information.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param spCentroid .
* @param spBias .
* @param dwpRh0 .
* @param wpM2 .
* @param dwpEh2 .
* @param ucpM2q .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getCeInfo (
IN Demodulator* demodulator,
IN Byte chip,
OUT Short* spCentroid,
OUT Short* spBias,
OUT Dword* dwpRh0,
OUT Word* wpM2,
OUT Dword* dwpEh2,
OUT Byte* ucpM2q
);
/**
* Enable/disable retrain.
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param enable .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_setRetrain (
IN Demodulator* demodulator,
IN Byte chip,
IN Byte enable
);
/**
* Enable/disable CCIR.
*
* @param demodulator the handle of demodulator.
* @param ucEnable .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_setCcir (
IN Demodulator* demodulator,
IN Byte ucEnable
);
/**
* Handle CCIF
*
* @param demodulator the handle of demodulator.
* @param ccifId .
* @param ctrl .
* @param ucBw .
* @param wFreq .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_handleCcif (
IN Demodulator* demodulator,
IN Byte ccifId,
IN Byte ctrl,
IN Byte ucBw,
IN Word wFreq
);
/**
*
* @param demodulator the handle of demodulator.
* @param chip The index of demodulator. The possible values are
* 0~7.
* @param level .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getAdcDesiredLevel (
IN Demodulator* demodulator,
IN Byte chip,
OUT Word* level
);
/**
* Set tuner type
*
* @param demodulator the handle of demodulator.
* @param ucTuner .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_setTunerType (
IN Demodulator* demodulator,
IN Byte ucTuner
);
/**
* Set board id
*
* @param demodulator the handle of demodulator.
* @param ucBoard .
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_setBoardId (
IN Demodulator* demodulator,
IN Byte ucBoard
);
/**
* Get signal strength in Dbm
*
* @param demodulator the handle of demodulator.
* @param ucTunerType tuner type.
* @param ucBoardId Board ids.
* @param dopStrength signal strength.
* @return Error_NO_ERROR: successful, other non-zero error code otherwise.
* @example <pre>
* </pre>
*/
Dword Demodulator_getSignalStrengthDBm (
IN Demodulator* demodulator,
IN Byte ucTunerType,
IN Byte ucBoardId,
OUT double* dopStrength
);
/**
* Program CFOE 2.
*
* @param demodulator the handle of demodulator.