tm_sband_get_device_conf.lua 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. -- Define the protocol
  2. function tm_sband_get_device_conf(buffer, pinfo, tree, tm_sband_get_device_conf, offset)
  3. -- Define ProtoFields with three arguments
  4. local f_rfe_rx0_on = ProtoField.uint32("tm_sband_get_device_conf.RfeRx0On", "RFE RX0 On", base.DEC)
  5. local f_rfe_tx0_on = ProtoField.uint32("tm_sband_get_device_conf.RfeTx0On", "RFE TX0 On", base.DEC)
  6. local f_rfe_pa0_on = ProtoField.uint32("tm_sband_get_device_conf.RfePa0On", "RFE PA0 On", base.DEC)
  7. local f_rfe_rx_tx0 = ProtoField.uint32("tm_sband_get_device_conf.RfeRxTx0", "RFE RX TX0", base.DEC)
  8. local f_rfe_rx1_on = ProtoField.uint32("tm_sband_get_device_conf.RfeRx1On", "RFE RX1 On", base.DEC)
  9. local f_rfe_tx1_on = ProtoField.uint32("tm_sband_get_device_conf.RfeTx1On", "RFE TX1 On", base.DEC)
  10. local f_rfe_pa1_on = ProtoField.uint32("tm_sband_get_device_conf.RfePa1On", "RFE PA1 On", base.DEC)
  11. local f_rfe_rx_tx1 = ProtoField.uint32("tm_sband_get_device_conf.RfeRxTx1", "RFE RX TX1", base.DEC)
  12. local f_rfe_out_en = ProtoField.uint32("tm_sband_get_device_conf.RfeOutEn", "RFE Out Enable", base.DEC)
  13. local f_rfe_gpio0 = ProtoField.uint32("tm_sband_get_device_conf.RfeGpio0", "RFE GPIO0", base.DEC)
  14. local f_rfe_loop_det = ProtoField.uint32("tm_sband_get_device_conf.RfeLoopDet", "RFE Loop Detect", base.DEC)
  15. local f_rfe_lo_mux = ProtoField.uint32("tm_sband_get_device_conf.RfeLoMux", "RFE LO Mux", base.DEC)
  16. local f_rfe_pow_on = ProtoField.uint32("tm_sband_get_device_conf.RfePowOn", "RFE Power On", base.DEC)
  17. local f_rfe_da = ProtoField.uint32("tm_sband_get_device_conf.RfeDA", "RFE DA", base.DEC)
  18. local f_rfe_cl = ProtoField.uint32("tm_sband_get_device_conf.RfeCL", "RFE CL", base.DEC)
  19. local f_rfe_en_ad5304 = ProtoField.uint32("tm_sband_get_device_conf.RfeEnAD5304", "RFE Enable AD5304", base.DEC)
  20. local f_rfe_en_synth = ProtoField.uint32("tm_sband_get_device_conf.RfeEnSynth", "RFE Enable Synthesizer", base.DEC)
  21. local f_rfe_en3 = ProtoField.uint32("tm_sband_get_device_conf.RfeEn3", "RFE Enable 3", base.DEC)
  22. local f_rfe_en4 = ProtoField.uint32("tm_sband_get_device_conf.RfeEn4", "RFE Enable 4", base.DEC)
  23. local f_rfe_en5 = ProtoField.uint32("tm_sband_get_device_conf.RfeEn5", "RFE Enable 5", base.DEC)
  24. local f_rfe_7v0_en = ProtoField.uint32("tm_sband_get_device_conf.Rfe7V0En", "RFE 7V0 Enable", base.DEC)
  25. local f_rfe_rsv_uint32 = ProtoField.uint32("tm_sband_get_device_conf.RfeRsvuint32", "Reserved Bits", base.DEC)
  26. local f_rxmix_ch0 = ProtoField.int32("tm_sband_get_device_conf.rxmix_ch0", "receive DownConversionFrequency channel 0", base.DEC)
  27. local f_rxmix_ch1 = ProtoField.int32("tm_sband_get_device_conf.rxmix_ch1", "receive DownConversionFrequency channel 1", base.DEC)
  28. local f_txmix_ch0 = ProtoField.int32("tm_sband_get_device_conf.txmix_ch0", "transmit UpConversionFrequency channel 0", base.DEC)
  29. local f_txmix_ch1 = ProtoField.int32("tm_sband_get_device_conf.txmix_ch1", "transmit UpConversionFrequency channel 1", base.DEC)
  30. local f_rxfreq_ch0 = ProtoField.int32("tm_sband_get_device_conf.rxfreq_ch0", "receive Frequency Channel0 :", base.DEC)
  31. local f_rxfreq_ch1 = ProtoField.int32("tm_sband_get_device_conf.rxfreq_ch1", "receive Frequency Channel1 :", base.DEC)
  32. local f_txfreq_ch0 = ProtoField.int32("tm_sband_get_device_conf.txfreq_ch0", "transmit Frequency Channel0 :", base.DEC)
  33. local f_txfreq_ch1 = ProtoField.int32("tm_sband_get_device_conf.txfreq_ch1", "transmit Frequency Channel1 :", base.DEC)
  34. local f_rxlow_ch0 = ProtoField.int32("tm_sband_get_device_conf.rxlow_ch0", "Rcv lowest possible frequency Channel0 : ", base.DEC)
  35. local f_rxlow_ch1 = ProtoField.int32("tm_sband_get_device_conf.rxlow_ch1", "Rcv lowest possible frequency Channel1 :", base.DEC)
  36. local f_rxhigh_ch0 = ProtoField.int32("tm_sband_get_device_conf.rxhigh_ch0", "Rcv highest possible frequency Channel0 : ", base.DEC)
  37. local f_rxhigh_ch1 = ProtoField.int32("tm_sband_get_device_conf.rxhigh_ch1", "Rcv highest possible frequency Channel0 : ", base.DEC)
  38. local f_txlow_ch0 = ProtoField.int32("tm_sband_get_device_conf.txlow_ch0", "Xmt lowest possible frequency Channel0 : ", base.DEC)
  39. local f_txlow_ch1 = ProtoField.int32("tm_sband_get_device_conf.txlow_ch1", "Xmt lowest possible frequency Channel1 : ", base.DEC)
  40. local f_txhigh_ch0 = ProtoField.int32("tm_sband_get_device_conf.txhigh_ch0", "Xmt highest possible frequency Channel0 : ", base.DEC)
  41. local f_txhigh_ch1 = ProtoField.int32("tm_sband_get_device_conf.txhigh_ch1", "Xmt highest possible frequency Channel1 : ", base.DEC)
  42. local f_2rx2tx = ProtoField.uint32("tm_sband_get_device_conf._2rx2tx", "Flag for use 2Rx2Tx mode : ", base.DEC) -- 1 bit
  43. local f_txlevel_0 = ProtoField.uint32("tm_sband_get_device_conf.txlevel_0", "Tx Level for XmtChannel 0 ", base.DEC) -- 11 bits
  44. local f_txlevel_1 = ProtoField.uint32("tm_sband_get_device_conf.txlevel_1", "Tx Level for XmtChannel 1 ", base.DEC) -- 11 bits
  45. local f_refclk = ProtoField.uint32("tm_sband_get_device_conf.refclk", "AD9361 reference clock in MHz : ", base.DEC) -- 8 bits
  46. local f_reserve = ProtoField.uint32("tm_sband_get_device_conf.reserve", "Reserve", base.DEC) -- 1 bit
  47. local f_modulat_0 = ProtoField.uint32("tm_sband_get_device_conf.modulat_0", "Xmt Modulation Channel_0 :", base.DEC) -- 3 bits
  48. local f_mode_0 = ProtoField.uint32("tm_sband_get_device_conf.mode_0", "Xmt Mode Channel_0:", base.DEC) -- 4 bits
  49. local f_fec_0 = ProtoField.uint32("tm_sband_get_device_conf.fec_0", "Fec 0", base.DEC) -- 3 bits
  50. local f_chen_0 = ProtoField.uint32("tm_sband_get_device_conf.chen_0", "ChEn 0", base.DEC) -- 1 bit
  51. local f_prnd_0 = ProtoField.uint32("tm_sband_get_device_conf.prnd_0", "PRnd 0", base.DEC) -- 1 bit
  52. local f_asmstart_0 = ProtoField.uint32("tm_sband_get_device_conf.asmstart_0", "ASMStart 0", base.DEC) -- 1 bit
  53. local f_offsetmod_0 = ProtoField.uint32("tm_sband_get_device_conf.offsetmod_0", "OffsetMod 0", base.DEC) -- 1 bit
  54. local f_ch1_diff_ch2 = ProtoField.uint32("tm_sband_get_device_conf.ch1_diff_ch2", "Ch1_diff_Ch2", base.DEC) -- 1 bit
  55. local f_chswitchon_0 = ProtoField.uint32("tm_sband_get_device_conf.chswitchon_0", "ChSwitchOn 0", base.DEC) -- 1 bit
  56. local f_modulat_1 = ProtoField.uint32("tm_sband_get_device_conf.modulat_1", "Modulat 1", base.DEC) -- 3 bits
  57. local f_mode_1 = ProtoField.uint32("tm_sband_get_device_conf.mode_1", "Mode 1", base.DEC) -- 4 bits
  58. local f_fec_1 = ProtoField.uint32("tm_sband_get_device_conf.fec_1", "Fec 1", base.DEC) -- 3 bits
  59. local f_chen_1 = ProtoField.uint32("tm_sband_get_device_conf.chen_1", "ChEn 1", base.DEC) -- 1 bit
  60. local f_prnd_1 = ProtoField.uint32("tm_sband_get_device_conf.prnd_1", "PRnd 1", base.DEC) -- 1 bit
  61. local f_asmstart_1 = ProtoField.uint32("tm_sband_get_device_conf.asmstart_1", "ASMStart 1", base.DEC) -- 1 bit
  62. local f_offsetmod_1 = ProtoField.uint32("tm_sband_get_device_conf.offsetmod_1", "OffsetMod 1", base.DEC) -- 1 bit
  63. local f_chswitchon_1 = ProtoField.uint32("tm_sband_get_device_conf.chswitchon_1", "ChSwitchOn 1", base.DEC) -- 1 bit
  64. local f_offsetmodnormaly = ProtoField.uint32("tm_sband_get_device_conf.offsetmodnormaly", "OffsetModNormaly", base.DEC) -- 1 bit
  65. local f_atttxgain_0 = ProtoField.uint32("tm_sband_get_device_conf.atttxgain_0", "AttTxGain 0", base.DEC) -- 10 bits
  66. local f_atttxgain_1 = ProtoField.uint32("tm_sband_get_device_conf.atttxgain_1", "AttTxGain 1", base.DEC) -- 10 bits
  67. local f_trfrmsz = ProtoField.uint32("tm_sband_get_device_conf.trfrmsz", "TrFrmSz", base.DEC) -- 12 bits
  68. local f_phioffset16 = ProtoField.int32("tm_sband_get_device_conf.phioffset16", "PhiOffset16", base.DEC) -- 5 bits
  69. local f_y16 = ProtoField.uint32("tm_sband_get_device_conf.y16", "Y16", base.DEC) -- 13 bits
  70. local f_txsampfact = ProtoField.uint32("tm_sband_get_device_conf.txsampfact", "TxSampFact", base.DEC) -- 10 bits
  71. local f_rsmode = ProtoField.uint32("tm_sband_get_device_conf.rsmode", "RsMode", base.DEC) -- 4 bits
  72. local f_rxgainmax = ProtoField.uint32("tm_sband_get_device_conf.rxgainmax", "RxGainMax", base.HEX) -- 8 bits
  73. local f_chen = ProtoField.uint32("tm_sband_get_device_conf.chen", "ChEn", base.HEX) -- 1 bit
  74. local f_modulat = ProtoField.uint32("tm_sband_get_device_conf.modulat", "Modulat", base.HEX) -- 3 bits
  75. local f_msbfirst = ProtoField.uint32("tm_sband_get_device_conf.msbfirst", "MsbFirst", base.HEX) -- 1 bit
  76. local f_fec = ProtoField.uint32("tm_sband_get_device_conf.fec", "Fec", base.HEX) -- 3 bits
  77. local f_prnd = ProtoField.uint32("tm_sband_get_device_conf.prnd", "PRnd", base.HEX) -- 1 bit
  78. local f_bchdec = ProtoField.uint32("tm_sband_get_device_conf.bchdec", "BchDec", base.HEX) -- 1 bit
  79. local f_accbcherr = ProtoField.uint32("tm_sband_get_device_conf.accbcherr", "AccBchErr", base.HEX) -- 1 bit
  80. local f_bchcountmode = ProtoField.uint32("tm_sband_get_device_conf.bchcountmode", "BchCountMode", base.HEX) -- 1 bit
  81. local f_pwroff = ProtoField.uint32("tm_sband_get_device_conf.pwroff", "PwrOff", base.DEC) -- 6 bits
  82. local f_rcvcalib = ProtoField.int32("tm_sband_get_device_conf.rcvcalib", "RcvCalib", base.DEC) -- 6 bits
  83. local f_xmtsymbfreq = ProtoField.uint32("tm_sband_get_device_conf.xmtsymbfreq", "XmtSymbFreq", base.DEC) -- 16 bits
  84. local f_rcvsymbfreq = ProtoField.uint32("tm_sband_get_device_conf.rcvsymbfreq", "RcvSymbFreq", base.DEC) -- 16 bits
  85. local f_rcvmode = ProtoField.uint32("tm_sband_get_device_conf.rcvmode", "RcvMode", base.HEX) -- 4 bits
  86. local f_rcvchannel = ProtoField.uint32("tm_sband_get_device_conf.rcvchannel", "RcvChannel", base.HEX) -- 2 bits
  87. local f_chnswitchon_0 = ProtoField.uint32("tm_sband_get_device_conf.chnswitchon_0", "ChSwitchOn_0", base.HEX) -- 1 bit
  88. local f_chnswitchon_1 = ProtoField.uint32("tm_sband_get_device_conf.chnswitchon_1", "ChSwitchOn_1", base.HEX) -- 1 bit
  89. local f_dropsample = ProtoField.uint32("tm_sband_get_device_conf.dropsample", "DropSample", base.DEC) -- 12 bits
  90. local f_dtminus = ProtoField.uint32("tm_sband_get_device_conf.dtminus", "dT_minus", base.HEX) -- 1 bit
  91. local f_dtplus = ProtoField.uint32("tm_sband_get_device_conf.dtplus", "dT_plus", base.HEX) -- 1 bit
  92. local f_reserve1 = ProtoField.uint32("tm_sband_get_device_conf.reserve1", "Reserve", base.HEX) -- 10 bits
  93. -- Register fields with the protocol
  94. tm_sband_get_device_conf.fields = {
  95. f_rfe_rx0_on, f_rfe_tx0_on, f_rfe_pa0_on, f_rfe_rx1_on, f_rfe_tx1_on, f_rfe_pa1_on,
  96. f_rfe_rx_tx1, f_rfe_out_en, f_rfe_gpio0, f_rfe_loop_det, f_rfe_lo_mux, f_rfe_pow_on,
  97. f_rfe_da, f_rfe_cl, f_rfe_en_ad5304, f_rfe_en_synth, f_rfe_en3, f_rfe_en4, f_rfe_en5,
  98. f_rfe_7v0_en, f_rfe_rsv_uint32, f_rfe_rx_tx0, f_rxmix_ch0, f_rxmix_ch1,f_txmix_ch0,
  99. f_txmix_ch1, f_rxfreq_ch0, f_rxfreq_ch1, f_txfreq_ch0, f_txfreq_ch1, f_rxlow_ch0, f_rxlow_ch1,
  100. f_rxhigh_ch0, f_rxhigh_ch1, f_txlow_ch0, f_txlow_ch1, f_txhigh_ch0, f_txhigh_ch1,
  101. f_2rx2tx, f_txlevel_0, f_txlevel_1, f_refclk, f_reserve, f_modulat_0, f_mode_0, f_fec_0,
  102. f_chen_0, f_prnd_0, f_asmstart_0, f_offsetmod_0, f_ch1_diff_ch2, f_chswitchon_0,
  103. f_modulat_1, f_mode_1, f_fec_1, f_chen_1, f_prnd_1, f_asmstart_1, f_offsetmod_1, f_chswitchon_1,
  104. f_offsetmodnormaly, f_atttxgain_0, f_atttxgain_1, f_trfrmsz, f_phioffset16, f_y16, f_txsampfact, f_rsmode,
  105. f_rxgainmax, f_chen, f_modulat, f_msbfirst, f_fec, f_prnd, f_bchdec, f_accbcherr,
  106. f_bchcountmode, f_pwroff, f_rcvcalib, f_xmtsymbfreq, f_rcvsymbfreq,
  107. f_rcvmode, f_rcvchannel, f_chnswitchon_0, f_chnswitchon_1, f_dropsample, f_dtminus, f_dtplus, f_reserve1
  108. }
  109. -- Create a subtree for the protocol
  110. local subtree = tree:add(tm_sband_get_device_conf, buffer(), "TM SBAND Get Device Configuration")
  111. --offset = offset + 8
  112. -- Parse and add fields to the subtree
  113. local data = buffer(offset, 4):le_uint()
  114. local value = (data & 1)
  115. subtree:add(f_rfe_rx0_on, value)
  116. value = (data >> 1) & 1
  117. subtree:add(f_rfe_tx0_on, value)
  118. value = (data >> 2) & 1
  119. subtree:add(f_rfe_pa0_on, value)
  120. value = (data >> 3) & 1
  121. subtree:add(f_rfe_rx_tx0, value)
  122. value = (data >> 4) & 1
  123. subtree:add(f_rfe_rx1_on, value)
  124. value = (data >> 5) & 1
  125. subtree:add(f_rfe_tx1_on, value)
  126. value = (data >> 6) & 1
  127. subtree:add(f_rfe_pa1_on, value)
  128. value = (data >> 7) & 1
  129. subtree:add(f_rfe_rx_tx1, value)
  130. value = (data >> 8) & 1
  131. subtree:add(f_rfe_out_en, value)
  132. value = (data >> 9) & 1
  133. subtree:add(f_rfe_gpio0, value)
  134. value = (data >> 10) & 1
  135. subtree:add(f_rfe_loop_det, value)
  136. value = (data >> 11) & 1
  137. subtree:add(f_rfe_lo_mux, value)
  138. value = (data >> 12) & 1
  139. subtree:add(f_rfe_pow_on, value)
  140. value = (data >> 13) & 1
  141. subtree:add(f_rfe_da, value)
  142. value = (data >> 14) & 1
  143. subtree:add(f_rfe_cl, value)
  144. value = (data >> 15) & 1
  145. subtree:add(f_rfe_en_ad5304, value)
  146. value = (data >> 16) & 1
  147. subtree:add(f_rfe_en_synth, value)
  148. value = (data >> 17) & 1
  149. subtree:add(f_rfe_en3, value)
  150. value = (data >> 18) & 1
  151. subtree:add(f_rfe_en4, value)
  152. value = (data >> 19) & 1
  153. subtree:add(f_rfe_en5, value)
  154. value = (data >> 20) & 1
  155. subtree:add(f_rfe_7v0_en, value)
  156. value = (data >> 21) & 0xfff3
  157. subtree:add(f_rfe_rsv_uint32, value)
  158. offset = offset + 4
  159. subtree:add(f_rxmix_ch0, buffer(offset, 4):le_uint()) -- First 4 bytes for RxMix Channel 0
  160. offset = offset + 4
  161. subtree:add(f_rxmix_ch1, buffer(offset, 4):le_uint()) -- Next 4 bytes for RxMix Channel 1
  162. offset = offset + 4
  163. subtree:add(f_txmix_ch0, buffer(offset, 4):le_uint()) -- Next 4 bytes for TxMix Channel 0
  164. offset = offset + 4
  165. subtree:add(f_txmix_ch1, buffer(offset, 4):le_uint()) -- Next 4 bytes for TxMix Channel 1
  166. offset = offset + 4
  167. subtree:add(f_rxfreq_ch0, buffer(offset, 4):le_uint()) -- Next 4 bytes for RxFreq Channel 0
  168. offset = offset + 4
  169. subtree:add(f_rxfreq_ch1, buffer(offset, 4):le_uint()) -- Next 4 bytes for RxFreq Channel 1
  170. offset = offset + 4
  171. subtree:add(f_txfreq_ch0, buffer(offset, 4):le_uint()) -- Next 4 bytes for TxFreq Channel 0
  172. offset = offset + 4
  173. subtree:add(f_txfreq_ch1, buffer(offset, 4):le_uint()) -- Next 4 bytes for TxFreq Channel 1
  174. offset = offset + 4
  175. subtree:add(f_rxlow_ch0, buffer(offset, 4):le_uint()) -- First 4 bytes for RxLow Channel 0
  176. offset = offset + 4
  177. subtree:add(f_rxlow_ch1, buffer(offset, 4):le_uint()) -- Next 4 bytes for RxLow Channel 1
  178. offset = offset + 4
  179. subtree:add(f_rxhigh_ch0, buffer(offset, 4):le_uint()) -- Next 4 bytes for RxHigh Channel 0
  180. offset = offset + 4
  181. subtree:add(f_rxhigh_ch1, buffer(offset, 4):le_uint()) -- Next 4 bytes for RxHigh Channel 1
  182. offset = offset + 4
  183. subtree:add(f_txlow_ch0, buffer(offset, 4):le_uint()) -- Next 4 bytes for TxLow Channel 0
  184. offset = offset + 4
  185. subtree:add(f_txlow_ch1, buffer(offset, 4):le_uint()) -- Next 4 bytes for TxLow Channel 1
  186. offset = offset + 4
  187. subtree:add(f_txhigh_ch0, buffer(offset, 4):le_uint()) -- Next 4 bytes for TxHigh Channel 0
  188. offset = offset + 4
  189. subtree:add(f_txhigh_ch1, buffer(offset, 4):le_uint()) -- Next 4 bytes for TxHigh Channel 1
  190. offset = offset + 4
  191. local data = buffer(offset , 4):le_uint()
  192. local value = data & 1
  193. subtree:add(f_2rx2tx, value) -- 2Rx2Tx (bit 31)
  194. value = (data >> 1) & 0xff3
  195. subtree:add(f_txlevel_0, value) -- TxLevel 0 (bits 20-30)
  196. value = (data >> 12) & 0xff3
  197. subtree:add(f_txlevel_1, value) -- TxLevel 1 (bits 10-20)
  198. value = (data >> 23) & 0xff
  199. subtree:add(f_refclk, value) -- RefClk (bits 2-9)
  200. value = (data >> 31) & 1
  201. subtree:add(f_reserve, value) -- Reserve (bit 0)
  202. offset = offset + 4
  203. data = buffer(offset, 2):le_uint()
  204. value = data & 0x7
  205. subtree:add(f_modulat_0, value) -- 3 bits
  206. value = (data >> 3) & 0xf
  207. subtree:add(f_mode_0, value) -- 4 bits
  208. value = (data >> 7) & 0x7
  209. subtree:add(f_fec_0, value) -- 3 bits
  210. value = (data >> 10) & 1
  211. subtree:add(f_chen_0, value) -- 1 bit
  212. value = (data >> 11) & 1
  213. subtree:add(f_prnd_0, value) -- 1 bit
  214. value = (data >> 12) & 1
  215. subtree:add(f_asmstart_0, value) -- 1 bit
  216. value = (data >> 13) & 1
  217. subtree:add(f_offsetmod_0, value) -- 1 bit
  218. value = (data >> 14) & 1
  219. subtree:add(f_ch1_diff_ch2, value) -- 1 bit
  220. value = (data >> 15) & 1
  221. subtree:add(f_chswitchon_0, value) -- 1 bit
  222. offset = offset + 2
  223. data = buffer(offset , 2):le_uint()
  224. value = data & 7
  225. subtree:add(f_modulat_1, value) -- 3 bits
  226. value = (data >> 3) & 0xf
  227. subtree:add(f_mode_1, value) -- 4 bits
  228. value = (data >> 7) & 0x7
  229. subtree:add(f_fec_1, value) -- 3 bits
  230. value = (data >> 10) & 0x1
  231. subtree:add(f_chen_1, value) -- 1 bit
  232. value = (data >> 11) & 0x1
  233. subtree:add(f_prnd_1, value) -- 1 bit
  234. value = (data >> 12) & 0x1
  235. subtree:add(f_asmstart_1, value) -- 1 bit
  236. value = (data >> 13) & 0x1
  237. subtree:add(f_offsetmod_1, value) -- 1 bit
  238. value = (data >> 14) & 0x1
  239. subtree:add(f_chswitchon_1, value) -- 1 bit
  240. value = (data >> 15) & 0x1
  241. subtree:add(f_offsetmodnormaly, value) -- 1 bit
  242. offset = offset + 2
  243. data = buffer(offset , 4):le_uint()
  244. value = data & 0x000003ff
  245. subtree:add(f_atttxgain_0, value) -- AttTxGain_0 (bits 22–31)
  246. value = (data >> 10) & 0x000003ff
  247. subtree:add(f_atttxgain_1, value) -- AttTxGain_1 (bits 12–21)
  248. value = (data >> 20) & 0x00000fff
  249. subtree:add(f_trfrmsz, value) -- TrFrmSz (bits 0–11)
  250. offset = offset + 4
  251. data = buffer(offset, 4):le_uint()
  252. value = data & 0x1f
  253. subtree:add(f_phioffset16, value) -- PhiOffset16 (bits 27–31)
  254. value = (data >> 5) & 0x1fff
  255. subtree:add(f_y16, value) -- Y16 (bits 14–26)
  256. value = (data >> 18) & 0x3ff
  257. subtree:add(f_txsampfact, value) -- TxSampFact (bits 2–11)
  258. value = (data >> 28) & 0xf
  259. subtree:add(f_rsmode, value) -- RsMode (bits 0–3)
  260. offset = offset + 4
  261. data = buffer(offset , 2):le_uint()
  262. value = data & 0xff
  263. subtree:add(f_rxgainmax, value)
  264. -- Add ChEn (bit 23)
  265. value = (data >> 8) & 1
  266. subtree:add(f_chen, value)
  267. -- Add Modulat (bits 20–22)
  268. value = (data >> 9) & 0x7
  269. subtree:add(f_modulat, value)
  270. -- Add MsbFirst (bit 19)
  271. value = (data >> 12) & 0x1
  272. subtree:add(f_msbfirst, value)
  273. -- Add Fec (bits 16–18)
  274. value = (data >> 13) & 0x7
  275. subtree:add(f_fec, value)
  276. offset = offset + 2
  277. data = buffer(offset , 2):le_uint()
  278. value = data & 0x1
  279. -- Add PRnd (bit 15)
  280. subtree:add(f_prnd, value)
  281. -- Add BchDec (bit 14)
  282. value = (data >> 1) & 0x1
  283. subtree:add(f_bchdec, value)
  284. -- Add AccBchErr (bit 13)
  285. value = (data >> 2) & 0x1
  286. subtree:add(f_accbcherr, value)
  287. -- Add BchCountMode (bit 12)
  288. value = (data >> 3) & 0x1
  289. subtree:add(f_bchcountmode, value)
  290. -- Add PwrOff (bits 6–11)
  291. value = (data >> 4) & 0x003f
  292. subtree:add(f_pwroff, value)
  293. -- Add RcvCalib (bits 0–5)
  294. value = (data >> 10) & 0x003f
  295. subtree:add(f_rcvcalib, value)
  296. offset = offset + 2
  297. data = buffer(offset , 4):le_uint()
  298. value = data & 0x0000ffff
  299. subtree:add(f_xmtsymbfreq, value)
  300. -- Add RcvSymbFreq (bits 0–15)
  301. value = (data >> 16) & 0xffff
  302. subtree:add(f_rcvsymbfreq, value)
  303. offset = offset + 4
  304. data = buffer(offset ,4):le_uint()
  305. value = data & 0xf
  306. subtree:add(f_rcvmode, value)
  307. -- Add RcvChannel (bits 26–27)
  308. value = (data >> 4) & 0x3
  309. subtree:add(f_rcvchannel, value)
  310. -- Add ChSwitchOn_0 (bit 25)
  311. value = (data >> 6) & 0x1
  312. subtree:add(f_chnswitchon_0, value)
  313. -- Add ChSwitchOn_1 (bit 24)
  314. value = (data >> 7) & 0x1
  315. subtree:add(f_chnswitchon_1, value)
  316. -- Add DropSample (bits 12–23)
  317. value = (data >> 8) & 0xfff
  318. subtree:add(f_dropsample, value)
  319. -- Add dT_minus (bit 7)
  320. value = (data >> 20) & 0x1
  321. subtree:add(f_dtminus, value)
  322. -- Add dT_plus (bit 6)
  323. value = (data >> 21) & 0x1
  324. subtree:add(f_dtplus, value)
  325. -- Add Reserve (bits 0–9)
  326. value = (data >> 22) & 0x3ff
  327. subtree:add(f_reserve, value)
  328. offset = offset + 4
  329. end