2
* Abilis Systems Single DVB-T Receiver
3
* Copyright (C) 2008 Pierrick Hascoet <pierrick.hascoet@abilis.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2, or (at your option)
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
#ifndef _AS10X_TYPES_H_
20
#define _AS10X_TYPES_H_
22
#include "as10x_handle.h"
24
/*********************************/
25
/* MACRO DEFINITIONS */
26
/*********************************/
28
/* bandwidth constant values */
34
/* hierarchy priority selection values */
35
#define HIER_NO_PRIORITY 0x00
36
#define HIER_LOW_PRIORITY 0x01
37
#define HIER_HIGH_PRIORITY 0x02
39
/* constellation available values */
40
#define CONST_QPSK 0x00
41
#define CONST_QAM16 0x01
42
#define CONST_QAM64 0x02
43
#define CONST_UNKNOWN 0xFF
45
/* hierarchy available values */
46
#define HIER_NONE 0x00
47
#define HIER_ALPHA_1 0x01
48
#define HIER_ALPHA_2 0x02
49
#define HIER_ALPHA_4 0x03
50
#define HIER_UNKNOWN 0xFF
52
/* interleaving available values */
53
#define INTLV_NATIVE 0x00
54
#define INTLV_IN_DEPTH 0x01
55
#define INTLV_UNKNOWN 0xFF
57
/* code rate available values */
58
#define CODE_RATE_1_2 0x00
59
#define CODE_RATE_2_3 0x01
60
#define CODE_RATE_3_4 0x02
61
#define CODE_RATE_5_6 0x03
62
#define CODE_RATE_7_8 0x04
63
#define CODE_RATE_UNKNOWN 0xFF
65
/* guard interval available values */
66
#define GUARD_INT_1_32 0x00
67
#define GUARD_INT_1_16 0x01
68
#define GUARD_INT_1_8 0x02
69
#define GUARD_INT_1_4 0x03
70
#define GUARD_UNKNOWN 0xFF
72
/* transmission mode available values */
73
#define TRANS_MODE_2K 0x00
74
#define TRANS_MODE_8K 0x01
75
#define TRANS_MODE_4K 0x02
76
#define TRANS_MODE_UNKNOWN 0xFF
78
/* DVBH signalling available values */
79
#define TIMESLICING_PRESENT 0x01
80
#define MPE_FEC_PRESENT 0x02
82
/* tune state available */
83
#define TUNE_STATUS_NOT_TUNED 0x00
84
#define TUNE_STATUS_IDLE 0x01
85
#define TUNE_STATUS_LOCKING 0x02
86
#define TUNE_STATUS_SIGNAL_DVB_OK 0x03
87
#define TUNE_STATUS_STREAM_DETECTED 0x04
88
#define TUNE_STATUS_STREAM_TUNED 0x05
89
#define TUNE_STATUS_ERROR 0xFF
91
/* available TS FID filter types */
92
#define TS_PID_TYPE_TS 0
93
#define TS_PID_TYPE_PSI_SI 1
94
#define TS_PID_TYPE_MPE 2
96
/* number of echos available */
100
#define CONTEXT_LNA 1010
101
#define CONTEXT_ELNA_HYSTERESIS 4003
102
#define CONTEXT_ELNA_GAIN 4004
103
#define CONTEXT_MER_THRESHOLD 5005
104
#define CONTEXT_MER_OFFSET 5006
105
#define CONTEXT_IR_STATE 7000
106
#define CONTEXT_TSOUT_MSB_FIRST 7004
107
#define CONTEXT_TSOUT_FALLING_EDGE 7005
109
/* Configuration modes */
110
#define CFG_MODE_ON 0
111
#define CFG_MODE_OFF 1
112
#define CFG_MODE_AUTO 2
116
uint8_t constellation;
118
uint8_t interleaving_mode;
119
uint8_t code_rate_HP;
120
uint8_t code_rate_LP;
121
uint8_t guard_interval;
122
uint8_t transmission_mode;
123
uint8_t DVBH_mask_HP;
124
uint8_t DVBH_mask_LP;
128
struct as10x_tune_args {
133
/* hierarchy selection */
136
uint8_t constellation;
139
/* interleaving mode */
140
uint8_t interleaving_mode;
144
uint8_t guard_interval;
145
/* transmission mode */
146
uint8_t transmission_mode;
149
struct as10x_tune_status {
152
/* signal strength */
153
int16_t signal_strength;
154
/* packet error rate 10^-4 */
156
/* bit error rate 10^-4 */
160
struct as10x_demod_stats {
162
uint32_t frame_count;
163
/* Bad frame counter */
164
uint32_t bad_frame_count;
165
/* Number of wrong bytes fixed by Reed-Solomon */
166
uint32_t bytes_fixed_by_rs;
169
/* statistics calculation state indicator (started or not) */
173
struct as10x_ts_filter {
174
uint16_t pid; /** valid PID value 0x00 : 0x2000 */
175
uint8_t type; /** Red TS_PID_TYPE_<N> values */
176
uint8_t idx; /** index in filtering table */
179
struct as10x_register_value {
182
uint8_t value8; /* 8 bit value */
183
uint16_t value16; /* 16 bit value */
184
uint32_t value32; /* 32 bit value */
190
struct as10x_register_addr {
193
/* register mode access */