Skip to content

Commit

Permalink
samples: bluetooth: direct_test_mode: Align Radio TX power levels
Browse files Browse the repository at this point in the history
Adjusted the radio transmit power levels with nrfx-3.7.0 release.

Ref: NCSDK-29120

Signed-off-by: Marcin Jelinski <[email protected]>
  • Loading branch information
maje-emb authored and rlubos committed Oct 14, 2024
1 parent 858bd8e commit b76d274
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
23 changes: 19 additions & 4 deletions samples/bluetooth/direct_test_mode/src/dtm.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,11 @@ static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power)
* to the appropriate radio register enumerator.
*/
switch (tx_power) {
#if defined(RADIO_TXPOWER_TXPOWER_Neg100dBm)
case -100:
return RADIO_TXPOWER_TXPOWER_Neg100dBm;
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) */

#if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm)
case -70:
return RADIO_TXPOWER_TXPOWER_Neg70dBm;
Expand All @@ -766,14 +771,24 @@ static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power)
return RADIO_TXPOWER_TXPOWER_Neg30dBm;
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) */

#if defined(RADIO_TXPOWER_TXPOWER_Neg26dBm)
case -26:
return RADIO_TXPOWER_TXPOWER_Neg26dBm;
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) */
#if defined(RADIO_TXPOWER_TXPOWER_Neg28dBm)
case -28:
return RADIO_TXPOWER_TXPOWER_Neg28dBm;
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) */

#if defined(RADIO_TXPOWER_TXPOWER_Neg22dBm)
case -22:
return RADIO_TXPOWER_TXPOWER_Neg22Bm;
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) */

case -20:
return RADIO_TXPOWER_TXPOWER_Neg20dBm;

#if defined(RADIO_TXPOWER_TXPOWER_Neg18dBm)
case -18:
return RADIO_TXPOWER_TXPOWER_Neg18Bm;
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) */

case -16:
return RADIO_TXPOWER_TXPOWER_Neg16dBm;

Expand Down
15 changes: 12 additions & 3 deletions samples/bluetooth/direct_test_mode/src/dtm_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

/* All valid power levels (in dBm) supported by the SoC. */
const int8_t nrf_power_value[] = {
#if defined(RADIO_TXPOWER_TXPOWER_Neg100dBm)
-100,
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) */
#if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm)
-70,
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) */
Expand All @@ -23,10 +26,16 @@ const int8_t nrf_power_value[] = {
#if defined(RADIO_TXPOWER_TXPOWER_Neg30dBm)
-30,
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) */
#if defined(RADIO_TXPOWER_TXPOWER_Neg26dBm)
-26,
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) */
#if defined(RADIO_TXPOWER_TXPOWER_Neg28dBm)
-28,
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) */
#if defined(RADIO_TXPOWER_TXPOWER_Neg22dBm)
-22,
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) */
-20,
#if defined(RADIO_TXPOWER_TXPOWER_Neg18dBm)
-18,
#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) */
-16,
#if defined(RADIO_TXPOWER_TXPOWER_Neg14dBm)
-14,
Expand Down

0 comments on commit b76d274

Please sign in to comment.