bcm-v4

[Specification

u16 N PHY Gen Load Samples (u32 freq, u16 max, u8 test)

This routine uses a macro CONVERT(X) defined as (((X) >= 0) ? ((((X) >> 15) + 1) >> 1) : -((((-(X)) >> 15) + 1) >> 1))

  1. If the band width is 40 MHz
    1. Set bw to 40
  2. Otherwise
    1. Set bw to 20
  3. Set len to bw << 3

  4. If test is 1
    1. Read PHY Register 0x01, right shift by 15 and mask with 1
    2. If the result of the previous step is 1
      1. Set bw to 82
    3. Otherwise
      1. Set bw to 80
    4. If the band width is 40 MHz
      1. Set bw to bw << 1

    5. Set len to bw << 1

  5. Allocate a complex u32 buffer of length len
  6. Set rot to (((freq * 36) / bw) << 16) / 100

  7. Set angle to 0
  8. Loop len times with i as index
    1. Call PHY Cordic with angle and buffer[i] as arguments

    2. Increase angle by rot
    3. Set buffer[i].q to CONVERT(buffer[i].q * max)
    4. Set buffer[i].i to CONVERT(buffer[i].i * max)
  9. Call N PHY Load Sample Table with buffer, len as arguments

  10. Free buffer
  11. Return len

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