Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

367 lines
9.9 KiB

  1. //==========================================================================;
  2. //
  3. // VSB.H
  4. //
  5. // Constants and structures for the VSB
  6. //
  7. //==========================================================================;
  8. #ifndef _VSB_H_
  9. #define _VSB_H_
  10. // Register structures
  11. // Status registers
  12. typedef struct
  13. {
  14. UCHAR FrontEndLock;
  15. UCHAR State;
  16. UCHAR EqualizerLock;
  17. UINT Mse;
  18. UCHAR CarrierOffset;
  19. // Not implemented in VSB1
  20. UINT SegmentErrorRate;
  21. } VSB_STATUS_STRUCT, *PVSB_STATUS_STRUCT;
  22. // Equalizer control registers
  23. typedef struct
  24. {
  25. UCHAR Mu1;
  26. UCHAR Mu2;
  27. UCHAR Mu3;
  28. UCHAR Mu4;
  29. UCHAR Mu5;
  30. UCHAR Mu6;
  31. UCHAR Sw1;
  32. UCHAR Sw2;
  33. UCHAR Sw3;
  34. UCHAR RValue;
  35. UINT MseLowerThreshold;
  36. UINT MseUpperThreshold;
  37. }VSB_EQUALIZER_CONTROL, *PVSB_EQUALIZER_CONTROL;
  38. // Carrier Recovery registers
  39. typedef struct
  40. {
  41. UCHAR LoopControl;
  42. UCHAR SecondOrderLoopFilterControl;
  43. UCHAR InvertSpectrum;
  44. UCHAR GainSelect;
  45. UCHAR Gain;
  46. UCHAR NonLinearityDisable;
  47. }VSB_CARRIER_RECOVERY_CONTROL, *PVSB_CARRIER_RECOVERY_CONTROL;
  48. // Timing Recovery registers
  49. typedef struct
  50. {
  51. UCHAR Mode;
  52. UCHAR GainInfo;
  53. UCHAR AccumulatorLength;
  54. UCHAR IIRBandwidth;
  55. UCHAR DACInterfaceMode;
  56. UCHAR PropIntegralParamIndexState1;
  57. UCHAR PropIntegralParamIndexState2;
  58. UCHAR PropIntegralParamIndexState3;
  59. UCHAR TimeInState1NormalMode;
  60. UCHAR TimeInState2NormalMode;
  61. UCHAR TimeInState1and2LongMode;
  62. }VSB_TIMING_RECOVERY_CONTROL, *PVSB_TIMING_RECOVERY_CONTROL;
  63. // Diagnostic control registers
  64. typedef struct
  65. {
  66. UCHAR DiagnosticSelect;
  67. UCHAR TrellisDecoderDiag;
  68. UCHAR SyncRecoveryDiag;
  69. UCHAR CarrierRecoveryDiag;
  70. } VSB_DIAGNOSTIC_CONTROL, *PVSB_DIAGNOSTIC_CONTROL;
  71. // Remote mode registers
  72. typedef struct
  73. {
  74. UCHAR RemoteModeEnable;
  75. UCHAR LockIn;
  76. UCHAR Mse;
  77. UCHAR TRSelect;
  78. }VSB_REMOTE_MODE_CONTROL, *PVSB_REMOTE_MODE_CONTROL;
  79. // AGC registers
  80. typedef struct
  81. {
  82. UCHAR AGCThreshold;
  83. UCHAR RescaleControl;
  84. } VSB_AGC_CONTROL, *PVSB_AGC_CONTROL;
  85. // Constants for resets .
  86. // The various resets that can be applied to VSB
  87. #define EQUALIZER_RESET 0x08
  88. #define BACKEND_RESET 0x04
  89. #define GENERAL_RESET 0x02
  90. #define INITIAL_RESET 0x01
  91. #define SYNC_RECOVERY_RESET 0x100
  92. #define TIMING_RECOVERY_RESET 0x200
  93. #define CARRIER_RECOVERY_RESET 0x400
  94. #define AGC_RESET 0x800
  95. #define HARDWARE_RESET 0x1000
  96. // Constants for Freeze
  97. // The various freeze that can be applied to VSB
  98. #define EQUALIZER_ADAPTATION_FREEZE 0x10
  99. #define RESCALE_AGC_FREEZE 0x1
  100. // Constants for Disables
  101. // The various disables that can be applied to VSB
  102. #define TIMEOUT_DISABLE 0x80
  103. #define FRONTEND_RESET_DISABLE 0x40
  104. #define EQUALIZER_RESET_DISABLE 0x20
  105. #define BIT_ENABLE 0x1
  106. //****** Diagnostic and O/P control
  107. // Selection of which diagnostic data comes out on the Diagnostic and Data
  108. // bus
  109. #define VSB_DIAG_EQOUT_SYMOUT 0x00
  110. #define VSB_DIAG_CRERR_SYMOUT 0x08
  111. #define VSB_DIAG_TRERR_CRERR 0x10
  112. #define VSB_DIAG_SYMOUT_TRERR 0x18
  113. #define VSB_DIAG_TDDIAG_EQOUT 0x20
  114. #define VSB_DIAG_TDDIAG_TDOUT 0x28
  115. #define VSB_DIAG_TDOUT_RSDIAG 0x30
  116. #define VSB_DIAG_RSDIAG_TDDIAG 0x38
  117. #define VSB_DIAG_SELECT_MASK 0x38
  118. //Trellis Decoder Diagnostic Select
  119. #define VSB_DIAG_STATE_0_METRIC 0
  120. #define VSB_DIAG_STATE_1_METRIC 1
  121. #define VSB_DIAG_STATE_2_METRIC 2
  122. #define VSB_DIAG_STATE_3_METRIC 3
  123. #define VSB_DIAG_SURVIVOR_PATH_METRIC 4
  124. #define VSB_DIAG_TD_MASK 7
  125. // Sync recovery & Pilot removal Diagnostic Select
  126. #define VSB_DIAG_SEGSYNC_CONFIDENCE_CNTR 0
  127. #define VSB_DIAG_FLDSYNC_CONFIDENCE_CNTR 0x20
  128. #define VSB_DIAG_PILOT_VALUE 0x40
  129. #define VSB_DIAG_RESCALE_AGC 0x60
  130. #define VSB_DIAG_SP_MASK 0x60
  131. // Carrier Recovery Diagnostic Select
  132. #define VSB_DIAG_LOOP_FILTER_IN 0
  133. #define VSB_DIAG_LOOP_FILTER_OUT 0x80
  134. #define VSB_DIAG_LOOP_FILTER_MASK 0x80
  135. //FIFO Control
  136. #define VSB_FIFO_OUTPUT 0
  137. #define VSB_DESCARMBLER_OUTPUT 0x40
  138. #define VSB_DIAGNOSTIC_OUTPUT 0x80
  139. #define VSB_FIFO_MASK 0xc0
  140. // ***** Carrier Recovery Control
  141. // Carrier Spectrum
  142. #define VSB_CR_CTRL_HIGH_END_PILOT 0
  143. #define VSB_CR_CTRL_LOW_END_PILOT 0x4
  144. #define VSB_CR_CTRL_PILOT_MASK 0x4
  145. // Carrier Gain Selection
  146. #define VSB_CR_CTRL_SR_GAIN 0
  147. #define VSB_CR_CTRL_CR_GAIN 0x10
  148. #define VSB_CR_CTRL_GAINSELECT_MASK 0x10
  149. // Gain values
  150. #define VSB_CR_CTRL_GAIN_1 0
  151. #define VSB_CR_CTRL_GAIN_05 0x20
  152. #define VSB_CR_CTRL_GAIN_025 0x40
  153. #define VSB_CR_CTRL_GAIN_0125 0x60
  154. #define VSB_CR_CTRL_GAIN_MASK 0x60
  155. // ***** Timing Recovery Control
  156. // Moe selection ( Normal/Long )
  157. #define VSB_TR_CTRL_SELECT_NORMAL 0x0
  158. #define VSB_TR_CTRL_SELECT_LONG 0x1
  159. #define VSB_TR_CTRL_SELECT_MASK 0x1
  160. // Gain Info
  161. #define VSB_TR_CTRL_GAININFO_STATE2 0x0
  162. #define VSB_TR_CTRL_GAININFO_STATE3 0x1
  163. #define VSB_TR_CTRL_GAININFO_FIXED 0x2
  164. #define VSB_TR_CTRL_GAININFO_MASK 0x3
  165. // Accumulator length
  166. #define VSB_TR_CTRL_ACC_LEN_32 0
  167. #define VSB_TR_CTRL_ACC_LEN_16 0x04
  168. #define VSB_TR_CTRL_ACC_LEN_MASK 0x04
  169. // IIR Bandwidth
  170. #define VSB_TR_CTRL_BW_6 0
  171. #define VSB_TR_CTRL_BW_7 0x4
  172. #define VSB_TR_CTRL_BW_MASK 0x4
  173. //DAC interface mode
  174. #define VSB_TR_CTRL_MODE0 0
  175. #define VSB_TR_CTRL_MODE1 0x10
  176. #define VSB_TR_CTRL_MODE2 0x20
  177. #define VSB_TR_CTRL_MODE3 0x30
  178. #define VSB_TR_CTRL_MODE_MASK 0x30
  179. //Duration of FSM in state 1 Normal mode
  180. #define VSB_TR_CTRL_N1_30MS 0
  181. #define VSB_TR_CTRL_N1_80MS 0x8
  182. #define VSB_TR_CTRL_N1_100MS 0x10
  183. #define VSB_TR_CTRL_N1_150MS 0x18
  184. #define VSB_TR_CTRL_N1_MASK 0x18
  185. //Duration of FSM in state 2 Normal mode
  186. #define VSB_TR_CTRL_N2_50MS 0
  187. #define VSB_TR_CTRL_N2_100MS 0x20
  188. #define VSB_TR_CTRL_N2_MASK 0x20
  189. //Duration of FSM in state 1 and 2 Long mode
  190. #define VSB_TR_CTRL_L1_200MS_L2_100MS 0x0
  191. #define VSB_TR_CTRL_L1_500MS_L2_100MS 0x40
  192. #define VSB_TR_CTRL_L1_MASK 0x40
  193. // ***** Equalizer Control
  194. // Mu values
  195. #define VSB_EQ_CTRL_MU_NO_UPDT 0
  196. #define VSB_EQ_CTRL_MU_MINUS_22 0x1
  197. #define VSB_EQ_CTRL_MU_MINUS_21 0x2
  198. #define VSB_EQ_CTRL_MU_MINUS_20 0x3
  199. #define VSB_EQ_CTRL_MU_MINUS_19 0x4
  200. #define VSB_EQ_CTRL_MU_MINUS_18 0x5
  201. #define VSB_EQ_CTRL_MU_MINUS_17 0x6
  202. #define VSB_EQ_CTRL_MU_MINUS_16 0x7
  203. #define VSB_EQ_CTRL_MU_MINUS_15 0x8
  204. #define VSB_EQ_CTRL_MU_MINUS_14 0x9
  205. #define VSB_EQ_CTRL_MU_MINUS_13 0xa
  206. #define VSB_EQ_CTRL_MU_MINUS_12 0xb
  207. #define VSB_EQ_CTRL_MU_MINUS_11 0xc
  208. #define VSB_EQ_CTRL_MU_MINUS_10 0xd
  209. #define VSB_EQ_CTRL_MU_MINUS_9 0xe
  210. #define VSB_EQ_CTRL_MU_MINUS_8 0xf
  211. // R values
  212. #define VSB_EQ_CTRL_BLIND_R_5_POINT_20 0
  213. #define VSB_EQ_CTRL_BLIND_R_5_POINT_22 0x1
  214. #define VSB_EQ_CTRL_BLIND_R_5_POINT_25 0x2
  215. #define VSB_EQ_CTRL_BLIND_R_5_POINT_28 0x3
  216. #define VSB_EQ_CTRL_BLIND_R_5_POINT_30 0x4
  217. #define VSB_EQ_CTRL_BLIND_R_5_POINT_33 0x5
  218. #define VSB_EQ_CTRL_BLIND_R_5_POINT_36 0x6
  219. #define VSB_EQ_CTRL_BLIND_R_5_POINT_38 0x7
  220. #define VSB_EQ_CTRL_BLIND_R_5_POINT_41 0x8
  221. #define VSB_EQ_CTRL_BLIND_R_5_POINT_44 0x9
  222. #define VSB_EQ_CTRL_BLIND_R_5_POINT_46 0xa
  223. #define VSB_EQ_CTRL_BLIND_R_5_POINT_49 0xb
  224. #define VSB_EQ_CTRL_BLIND_R_5_POINT_52 0xc
  225. #define VSB_EQ_CTRL_BLIND_R_5_POINT_54 0xd
  226. #define VSB_EQ_CTRL_BLIND_R_5_POINT_57 0xe
  227. #define VSB_EQ_CTRL_BLIND_R_5_POINT_60 0xf
  228. //******* Data Input Format
  229. #define VSB_DATA_INP_2S_COMPLEMENT 0
  230. #define VSB_DATA_INP_BINARY 0x8
  231. #define VSB_DATA_INP_MASK 0x8
  232. //***** AGC Control
  233. // Rescale AGC control
  234. #define VSB_AGC_CTRL_NORMAL 0x0
  235. #define VSB_AGC_CTRL_FREEZE_AFTER_1_SYNC 0x40
  236. #define VSB_AGC_CTRL_CHANGE_IIRBW_AFTER_1_SYNC 0xc0
  237. #define VSB_AGC_CTRL_MASK 0xc0
  238. #define VSB_AGC_THRESH_MASK 0xf
  239. // A set of all VSB register control structures.
  240. typedef struct
  241. {
  242. VSB_EQUALIZER_CONTROL Equalizer;
  243. VSB_TIMING_RECOVERY_CONTROL TimingRecovery;
  244. VSB_CARRIER_RECOVERY_CONTROL CarrierRecovery;
  245. VSB_DIAGNOSTIC_CONTROL Diagnostics;
  246. VSB_REMOTE_MODE_CONTROL RemoteMode;
  247. VSB_AGC_CONTROL AGC;
  248. char DataInput;
  249. char FIFO;
  250. ULONG Reset;
  251. ULONG Freeze;
  252. ULONG Disable;
  253. } VSB_MODULE_SET, *PVSB_MODULE_SET;
  254. #define STATIC_PROPSETID_VSB\
  255. 0xb96e0100L, 0xce52, 0x11d2, 0x8a, 0x11, 0x00, 0x60, 0x94, 0x05, 0x30, 0x6e
  256. DEFINE_GUIDSTRUCT("b96e0100-ce52-11d2-8a11-00609405306e", PROPSETID_VSB);
  257. #define PROPSETID_VSB DEFINE_GUIDNAMED(PROPSETID_VSB)
  258. // The properties defined for VSB
  259. typedef enum {
  260. KSPROPERTY_VSB_STATUS = 0, // R - VSB status
  261. KSPROPERTY_VSB_EQ_CTRL, // RW - Equalizer control
  262. KSPROPERTY_VSB_TR_CTRL, // RW - Timing Recovery Control
  263. KSPROPERTY_VSB_CR_CTRL, // RW - Carrier Recovery Control
  264. KSPROPERTY_VSB_DIAG_CTRL, // RW - Diagnostic Control
  265. KSPROPERTY_VSB_REMOTE_MODE_CTRL, // RW - Remote Mode control
  266. KSPROPERTY_VSB_AGC_CTRL, // RW - Remote Mode control
  267. KSPROPERTY_VSB_DATA_INPUT_CTRL, // RW - Input Control
  268. KSPROPERTY_VSB_FIFO_CTRL, // RW - FIFO control
  269. KSPROPERTY_VSB_RESET_CTRL, // RW - Reset control
  270. KSPROPERTY_VSB_FREEZE_CTRL, // RW - Freeze control
  271. KSPROPERTY_VSB_DISABLE_CTRL // RW - Disable control
  272. } KSPROPERTY_VSB;
  273. // A union of all VSB register control structures.
  274. typedef union
  275. {
  276. VSB_EQUALIZER_CONTROL Equalizer;
  277. VSB_TIMING_RECOVERY_CONTROL TimingRecovery;
  278. VSB_CARRIER_RECOVERY_CONTROL CarrierRecovery;
  279. VSB_DIAGNOSTIC_CONTROL Diagnostics;
  280. VSB_REMOTE_MODE_CONTROL RemoteMode;
  281. VSB_AGC_CONTROL AGC;
  282. char DataInput;
  283. char FIFO;
  284. ULONG Reset;
  285. ULONG Freeze;
  286. ULONG Disable;
  287. } VSB_MODULE_CONTROL_UNION;
  288. // Property structure for status
  289. typedef struct {
  290. KSPROPERTY Property;
  291. VSB_STATUS_STRUCT Status;
  292. } KSPROPERTY_VSB_STATUS_S, *PKSPROPERTY_VSB_STATUS_S;
  293. // property structure for any register access
  294. typedef struct {
  295. KSPROPERTY Property;
  296. VSB_MODULE_CONTROL_UNION ModuleControl;
  297. BOOL ShadowOpn;
  298. } KSPROPERTY_VSB_REGISTER_S, *PKSPROPERTY_VSB_REGISTER_S;
  299. // property structure for any tap/coefficient access
  300. typedef struct {
  301. KSPROPERTY Property;
  302. char *CoeffArray;
  303. ULONG NumCoeff;
  304. BOOL ShadowOpn;
  305. } KSPROPERTY_VSB_COEFF_S, *PKSPROPERTY_VSB_COEFF_S;
  306. #endif // _VSB_H_