bcm-v4 [Specification]

## LP PHY TX Power Recalc Target

1. Define a u32 rate array with 12 elements
2. Establish an LP PHY table with width = 32
3. Set reset (u8) to 0
4. If the PHY revision is less than 2
1. Set the table ID to 10
5. Otherwise
1. Set the table ID to 7
6. Loop from 0 to 11 (inclusive) in steps of 1 using loop variable i
1. Set the i'th element of the rate array to the negative of the i'th element of Transmit power offset

7. Set the table length to 12, the table offset to 0x40, and the table data pointer to the rate array
8. Write the LP PHY Table

9. Convert the current channel to frequency (MHz) and save as frequency (u16)
10. If Target TX frequency is not equal to frequency

1. If frequency less than 2500
1. Set b0 (int) to txpa[0]

2. Set b1 (int) to txpa[1]

3. Set a1 (int) to txpa[2]

2. Else if frequency less than 5321
1. Set b0 to txpa low[0]

2. Set b1 to txpa low[1]

3. Set a1 to txpa low[2]

3. Else if frequency less than 5701
1. Set b0 to txpa[0]

2. Set b1 to txpa[1]

3. Set a1 to txpa[2]

4. Otherwise
1. Set b0 to txpa high[0]

2. Set b1 to txpa high[1]

3. Set a1 to txpa high[2]

5. Set the table data pointer to power (int), the table length to 1, and the table offset to 0
6. Loop from 0 to 63 (inclusive) in steps of 1 with tssi (int) as the loop variable
1. Using LP PHY Tssi to dBm, convert tssi, a1, b0, and b1 to dBm and save the result in power

2. Write the LP PHY Table

3. Increment the table offset
7. Set Target TX frequency to frequency

8. Set reset to 1
11. Read PHY Register 0x4A7, and bitwise AND with 0xFF

12. If the result obtained in the previous step is not equal to Transmit power minimum

1. MaskSet PHY Register 0x4A7 with mask 0xFF00 and set with Transmit power minimum

2. Set reset to 1
13. If reset equal to 1

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