bcm-v4

[Specification

int NPHY ACI Scan W2based

  1. Set u16 repeat_ctr to nphy_aci.detect_repeat_ctr

  2. Set u16 nsamps to nphy_aci.detect_num_samples

  3. Set u16 min_valid_samples to nsamps / 8
  4. Set u16 sleep_us to 10
  5. Set u16 array clip_off to { 0xFFFF, 0xFFFF }
  6. Set s8 w2_thresh to 22
  7. Set s8 array w2_range to { 22, 14, 11, 0, -20, -25, -33 }
  8. Set u32 array adc_range to { 1000, 2000, 10000, 30000, 60000, 90000 }
  9. Set u32 num_ranges to 6
  10. Set int aci to 0
  11. Set s8 minw2 to 32
  12. Call N PHY Classifier with arguments ( 0, 0 ) and save result in u16 classifier_state

  13. Call N PHY Classifier with arguments ( 7, 4 )

  14. Call N PHY Clip Det with arguments ( 0, clip_state) (2 - element u16 array)

  15. Call N PHY Clip Det with arguments ( 1, clip_off )

  16. Call N PHY RF Control Override with arguments ( 0x400 0xAC, 0x3, 0 )

  17. Read PHY Register 0x91 and save result in rfctrlintc1

  18. Read PHY Register 0x92 and save result in rfctrlintc2

  19. Write 0x120 to PHY Registers 0x91 and 0x92

  20. Call NPHY Force RFseq with argument 2

  21. Read PHY Register 0x66 and save result in rxrf_spc1

  22. Read PHY Register 0x95 and save result in rxrf_spc2

  23. Set bits 0x0C in PHY Registers 0x66 and 0x95

  24. Set bits 0x7 in PHY Registers 0xCD and 0xD9

  25. Clear bit 2 in PHY Registers 0x66 and 0x95

  26. Read PHY Register 0x71 and save in core1_rxbb_rccal_ctrl

  27. Read PHY Register 0x95 and save in core2_rxbb_rccal_ctrl

  28. Write 0 to PHY Registers 0x71 and 0x95

  29. Read PHY Register 0xCA and save in gpiosel

  30. Call NPHY Select RSSI Select with arguments ( 5, 1 )

  31. Loop 2 times using core as an index
    1. Write core + 6 to PHY Register 0xCA

    2. Loop repeat_ctr times using ctr as the index
      1. Loop 2 times using iq as the index
        1. Set pwr_ctr, avg_adcpwr, and avgw2 to 0
        2. Loop nsamp times using samp as the index
          1. If iq is zero
            1. Read PHY Register 0x1C9 and save as gpio

          2. Otherwise
            1. Read PHY Register 0x1CA and save as gpio

          3. Set adc_code to ((gpio & 0x3FF) << 6 ) >> 6

          4. Set w2 (((gpio >> 10) & 0x3F) << 2 ) >> 2

          5. If w2 <= w2_thresh

            1. Add w2 to avgw2
            2. Add adc_code squared to avg_adcpwr
            3. Increment pwr_ctr
        3. If pwr_ctr > min_valid_samples

          1. Divide avg_adcpwr by pwr_ctr to get average
          2. Divide avgw2 by pwr_ctr to get average
          3. Loop num_ranges times using w2_ctr as index
            1. Set w2_l to w2_range[w2_ctrl]
            2. Set w2_r to w2_range[w2_ctrl + 1]
            3. If awgw2 <= w2_l AND avgw2 > w2_r AND avg_adcpwr < adc_range[w2_ctr]

              1. Set aci to 1
              2. If avgw2 < minw2

                1. Set minw2 to avgw2
    3. Delay 10 usec
  32. Write gpiosel to PHY Register 0xCA

  33. Call NPHY RSSI Select with arguments ( 0, 0 )

  34. Write core1_rxbb_rccal_ctrl to Radio Register 0x71

  35. Write core2_rxbb_rccal_ctrl to Radio Register 0xA0

  36. Write rxrf_spc1 to Radio Register 0x66

  37. Write rxrf_spc2 to Radio Register 0x95

  38. Write lna_gainbst1 to Radio Register 0xCD

  39. Write lna_gainbst2 to Radio Register 0xD9

  40. Write rfctrlintc1 to PHY Register 0x91

  41. Write rfctrlintc2 to PHY Register 0x92

  42. Call NPHY RF Control Override with arguments ( 0x400, 0, 3, 1 )

  43. Call NPHY Force RF Seq with argument 2

  44. Call NPHY Clip Det with arguments ( 1, clip_state )

  45. Call NPHY Classifier with arguments ( 7, classifier_state )

  46. If aci is zero
    1. Set aci_pwr to 0
  47. Otherwise
    1. If minw2 >= 18

      1. Set aci_pwr to 1
    2. Else if minw2 >= -20

      1. Set aci_pwr to 2
    3. Otherwise
      1. Set aci_pwr to 3
  48. Return aci_pwr

Exported/Archived from the wiki to HTML on 2016-10-27