bcm-v4

[Specification

N PHY RSSI Calibrate

  1. If PHY Revision >= 3

    1. Call N PHY RSSI Calibrate Rev 3

  2. Otherwise
    1. Call N PHY RSSI Calibrate Rev 2 with argument 2 (below)
    2. Call N PHY RSSI Calibrate Rev 2 with argument 0
    3. Call N PHY RSSI Calibrate Rev 2 with argument 1

N PHY RSSI Calibrate Rev 2 (u8 type)

  1. Establish a 2-element u16 array clip_state
  2. Establish a 2-element u16 array clip_off and preset with 0xFFFF in both elements
  3. Create a 4-element s32 array results_min and initialize to zero
  4. Create a 4-element u8 array vcm_final and initialize to zero
  5. Create a 4 x 4 s32 array called results and initialize to 0
  6. Create a 4 x 2 s32 array called miniq and initialize to zero
  7. If type is 2
    1. Set code to 0
    2. Set val to 6
  8. Else if type is 0 or 1
    1. Set code to 25
    2. Set val to 4
  9. Otherwise
    1. Return
  10. Call N PHY Classifier with arguments 0, 0 and save as class

  11. Call N PHY Classifier with arguments 7, 4

  12. Call N PHY Clip Detection with arguments 0, clip_state

  13. Call N PHY Clip Detection with arguments 1, clip_off

  14. If band is 5G
    1. Set override to 0x140
  15. Otherwise
    1. Set override to 0x110
  16. Save PHY Register 0x91
  17. Save Radio Register 0x17
  18. Write override to PHY Register 0x91
  19. Write val to Radio Register 0x17
  20. Save PHY Register 0x92
  21. Save Radio Register 0x1B
  22. Write override to PHY Register 0x92
  23. Write val to Radio Register 0x1B
  24. Read Radio Register 0x18, mask with 0x07 and save as state0
  25. Read Radio Register 0x1c, mask with 0x07 and save as state1
  26. Maskset Radio Register 0x18 with mask 0xF8 and set with 0
  27. Maskset Radio Register 0x1C with mask 0xF8 and set with 0
  28. Read Radio Register 0x03, mask with 0x07 and save as state2
  29. Read Radio Register 0x05, mask with 0x07 and save as state3
  30. Call N PHY RSSI Select with arguments 5 and type

  31. Call N PHY Scale Offset RSSI with arguments 0, 0, 5, 0, type

  32. Call N PHY Scale Offset RSSI with arguments 0, 0, 5, 1, type

  33. Loop 4 times with index i
    1. Set all elements of a 4-element array tmp to the loop index
    2. If type is not 1
      1. Call N PHY Set RSSI 2055 VCM with arguments type, tmp

    3. Call N PHY Poll RSSI with type, &results[i][0], 8 as arguments

    4. If type is 0 or 1
      1. Loop 2 times with index j
        1. Set miniq[i][j] to the minimum of (results[i][2 * j], results[i][2 * j + 1])
  34. Loop 4 times with index i
    1. Set mind to 0x100000
    2. Set minvcm to 0
    3. Set minpoll to 249
    4. Loop 4 times with index j
      1. If type is 2
        1. Set current to abs(results[j][i] - code * 8)
      2. Otherwise
        1. Set current to abs(miniq[j][i / 2] - code * 8)
      3. If current < mind

        1. Set mind to current
        2. Set minvcm to j
      4. If results[j][i] < minpoll

        1. Set minpoll to results[j][i]
    5. Set results_min[i] to minpoll
    6. Set vcm_final[i] to minvcm
  35. If type is not 1
    1. Call N PHY Set RSSI 2055 VCM with arguments type, vcm_final

  36. Loop 4 times with index i
    1. Set offset[i] to (code * 8) - results[vcm_final[i]][i]
    2. If offset[i] < 0

      1. Set offset[i] to -((abs(offset[i]) + 4) / 8)
    3. Otherwise
      1. Set offset to (offset + 4) / 8
    4. If results_min[i] equals 248
      1. Set offset[i] to code - 32
    5. If i % 2 is zero
      1. Set arg2 to 0
    6. Otherwise
      1. Set arg2 to 1
    7. If i / 2 is 0
      1. Set arg1 to 1
    8. Otherwise
      1. Set arg1 to 2
    9. Call N PHY Scale Offset RSSI with arguments 0, offset[i], arg1, arg2, type

  37. MaskSet Radio Register 0x18 with mask 0xF8 and set with state0

  38. MaskSet Radio Register 0x1C with mask 0xF8 and set with state1

  39. If state2 is 1
    1. Call N PHY RSSI Select with arguments 1, 2

  40. Else if state2 is 4
    1. Call N PHY RSSI Select with arguments 1, 0

  41. Else if state2 is 2
    1. Call N PHY RSSI Select with arguments 1, 1

  42. Otherwise
    1. Call N PHY RSSI Select with arguments 1, 1

  43. If state3 is 1
    1. Call N PHY RSSI Select with arguments 2, 2

  44. Else if state3 is 4
    1. Call N PHY RSSI Select with arguments 2, 0

  45. Otherwise
    1. Call N PHY RSSI Select with arguments 2, 1

  46. Call N PHY RSSI Select with arguments 0, type

  47. Restore PHY Register 0x91
  48. Restore Radio Register 0x17
  49. Restore PHY Register 0x92
  50. Restore Radio Register 0x1B
  51. Call N PHY Classifier with 7, class as arguments

  52. Call N PHY Clip Detection with 1, clip_state as arguments


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