ble_dtm.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. /**
  2. * Copyright (c) 2012 - 2020, Nordic Semiconductor ASA
  3. *
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without modification,
  7. * are permitted provided that the following conditions are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice, this
  10. * list of conditions and the following disclaimer.
  11. *
  12. * 2. Redistributions in binary form, except as embedded into a Nordic
  13. * Semiconductor ASA integrated circuit in a product or a software update for
  14. * such product, must reproduce the above copyright notice, this list of
  15. * conditions and the following disclaimer in the documentation and/or other
  16. * materials provided with the distribution.
  17. *
  18. * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * 4. This software, with or without modification, must only be used with a
  23. * Nordic Semiconductor ASA integrated circuit.
  24. *
  25. * 5. Any software provided in binary form under this license must not be reverse
  26. * engineered, decompiled, modified and/or disassembled.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  29. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  30. * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  31. * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  32. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  34. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  37. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. */
  40. /** @file
  41. *
  42. * @defgroup ble_dtm DTM - Direct Test Mode
  43. * @{
  44. * @ingroup ble_sdk_lib
  45. * @brief Module for testing RF/PHY using DTM commands.
  46. */
  47. #ifndef BLE_DTM_H__
  48. #define BLE_DTM_H__
  49. #include <stdint.h>
  50. #include <stdbool.h>
  51. #include "nrf.h"
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55. #define DTM_MAX_ANTENNA_CNT 0x13 /**< Maximum supported antenna count. */
  56. /**@brief Configuration parameters. */
  57. #define DTM_BITRATE UARTE_BAUDRATE_BAUDRATE_Baud19200 /**< Serial bitrate on the UART */
  58. #define DEFAULT_TX_POWER RADIO_TXPOWER_TXPOWER_0dBm /**< Default Transmission power using in the DTM module. */
  59. #define DEFAULT_TIMER NRF_TIMER0 /**< Default timer used for timing. */
  60. #define DEFAULT_TIMER_IRQn TIMER0_IRQn /**< IRQ used for timer. NOTE: MUST correspond to DEFAULT_TIMER. */
  61. #define ANOMALY_172_TIMER NRF_TIMER1 /**< Timer used for the workaround for errata 172 on affected nRF5 devices. */
  62. #define ANOMALY_172_TIMER_IRQn TIMER1_IRQn /**< IRQ used for timer. NOTE: MUST correspond to ERRATA_172_TIMER. */
  63. #define ANOMALY_172_TIMER_IRQHandler TIMER1_IRQHandler /**< IRQHandler used for timer. NOTE: MUST correspond to ERRATA_172_TIMER. */
  64. /**@brief BLE DTM command codes. */
  65. typedef uint32_t dtm_cmd_t; /**< DTM command type. */
  66. #define LE_TEST_SETUP 0 /**< DTM command: Set PHY or modulation, configure upper two bits of length,
  67. request matrix of supported features or request max values of parameters. */
  68. #define LE_RECEIVER_TEST 1 /**< DTM command: Start receive test. */
  69. #define LE_TRANSMITTER_TEST 2 /**< DTM command: Start transmission test. */
  70. #define LE_TEST_END 3 /**< DTM command: End test and send packet report. */
  71. #define LE_TEST_SETUP_RESET 0 /**< DTM command control: Stop TX/RX, reset the packet length upper bits and set the PHY to 1Mbit. */
  72. #define LE_TEST_SETUP_SET_UPPER 1 /**< DTM command control: Set the upper two bits of the length field. */
  73. #define LE_TEST_SETUP_SET_PHY 2 /**< DTM command control: Select the PHY to be used for packets. */
  74. #define LE_TEST_SETUP_SELECT_MODULATION 3 /**< DTM command control: Select standard or stable modulation index. Stable modulation index is not supported. */
  75. #define LE_TEST_SETUP_READ_SUPPORTED 4 /**< DTM command control: Read the supported test case features. */
  76. #define LE_TEST_SETUP_READ_MAX 5 /**< DTM command control: Read the max supported time and length for packets. */
  77. #define LE_TEST_SETUP_CONSTANT_TONE 6 /**< DTM command control: Constant Tone Extension info. */
  78. #define LE_TEST_SETUP_CONSTANT_TONE_SLOT 7 /**< DTM command control: Constant Tone Extension slot. */
  79. #define LE_TEST_SETUP_ANTENNA_ARRAY 8 /**< DTM command control: Antenna number and switch patern. */
  80. #define LE_TEST_SETUP_TRANSMIT_POWER 9 /**< DTM command control: Transmit power set. */
  81. #define LE_RESET_MIN_RANGE 0x00 /**< DTM command parameter: Reset. Minimum parameter value. */
  82. #define LE_RESET_MAX_RANGE 0x03 /**< DTM command parameter: Reset. Maximum parameter value. */
  83. #define LE_SET_UPER_BITS_MIN_RANGE 0x00 /**< DTM command parameter: Set upper bits. Minimum parameter value. */
  84. #define LE_SET_UPER_BITS_MAX_RANGE 0x0F /**< DTM command parameter: Set upper bits. Maximum parameter value. */
  85. #define LE_PHY_1M_MIN_RANGE 0x04 /**< DTM command parameter: Set PHY for future packets to use 1MBit PHY. Minimum parameter value. */
  86. #define LE_PHY_1M_MAX_RANGE 0x07 /**< DTM command parameter: Set PHY for future packets to use 1MBit PHY. Maximum parameter value. */
  87. #define LE_PHY_2M_MIN_RANGE 0x08 /**< DTM command parameter: Set PHY for future packets to use 2MBit PHY. Minimum parameter value. */
  88. #define LE_PHY_2M_MAX_RANGE 0x0B /**< DTM command parameter: Set PHY for future packets to use 2MBit PHY. Maximum parameter value. */
  89. #define LE_PHY_LE_CODED_S8_MIN_RANGE 0x0C /**< DTM command parameter: Set PHY for future packets to use coded PHY with S=8. Minimum parameter value. */
  90. #define LE_PHY_LE_CODED_S8_MAX_RANGE 0x0F /**< DTM command parameter: Set PHY for future packets to use coded PHY with S=8. Maximum parameter value. */
  91. #define LE_PHY_LE_CODED_S2_MIN_RANGE 0x10 /**< DTM command parameter: Set PHY for future packets to use coded PHY with S=2. Minimum parameter value. */
  92. #define LE_PHY_LE_CODED_S2_MAX_RANGE 0x13 /**< DTM command parameter: Set PHY for future packets to use coded PHY with S=2. Maximum parameter value. */
  93. #define LE_MODULATION_INDEX_STANDARD_MIN_RANGE 0x00 /**< DTM command parameter: Set Modulation index to stadard. Minimum parameter value. */
  94. #define LE_MODULATION_INDEX_STANDARD_MAX_RANGE 0x03 /**< DTM command parameter: Set Modulation index to stadard. Maximum parameter value. */
  95. #define LE_MODULATION_INDEX_STABLE_MIN_RANGE 0x04 /**< DTM command parameter: Set Modulation index to stable. Minimum parameter value. */
  96. #define LE_MODULATION_INDEX_STABLE_MAX_RANGE 0x07 /**< DTM command parameter: Set Modulation index to stable. Maximum parameter value. */
  97. #define LE_TEST_FEATURE_READ_MIN_RANGE 0x00 /**< DTM command parameter: Read test case supported feature. Minimum parameter value. */
  98. #define LE_TEST_FEATURE_READ_MAX_RANGE 0x03 /**< DTM command parameter: Read test case supported feature. Maximum parameter value. */
  99. #define LE_TEST_SUPPORTED_TX_OCTETS_MIN_RANGE 0x00 /**< DTM command parameter: Read maximum supported Tx Octets. Minimum parameter value. */
  100. #define LE_TEST_SUPPORTED_TX_OCTETS_MAX_RANGE 0x03 /**< DTM command parameter: Read maximum supported Tx Octets. Maximum parameter value. */
  101. #define LE_TEST_SUPPORTED_TX_TIME_MIN_RANGE 0x04 /**< DTM command parameter: Read maximum supported Tx Time. Minimum parameter value. */
  102. #define LE_TEST_SUPPORTED_TX_TIME_MAX_RANGE 0x07 /**< DTM command parameter: Read maximum supported Tx Time. Maximum parameter value. */
  103. #define LE_TEST_SUPPORTED_RX_OCTETS_MIN_RANGE 0x08 /**< DTM command parameter: Read maximum supported Rx Octets. Minimum parameter value. */
  104. #define LE_TEST_SUPPORTED_RX_OCTETS_MAX_RANGE 0x0B /**< DTM command parameter: Read maximum supported Rx Octets. Maximum parameter value. */
  105. #define LE_TEST_SUPPORTED_RX_TIME_MIN_RANGE 0x0C /**< DTM command parameter: Read maximum supported Rx Time. Minimum parameter value. */
  106. #define LE_TEST_SUPPORTED_RX_TIME_MAX_RANGE 0x0F /**< DTM command parameter: Read maximum supported Rx Time. Maximum parameter value. */
  107. #define LE_TEST_SUPPORTED_CTE_LENGTH 0x10 /**< DTM command parameter: Read maximum length of the Constant Tone Extension supported. */
  108. #define LE_UPPER_BITS_MASK 0x0C /**< DTM command parameter: Upper bits mask. */
  109. #define LE_UPPER_BITS_POS 0x04 /**< DTM command parameter: Upper bits position. */
  110. #define LE_TRANSMIT_POWER_LVL_MIN -127 /**< DTM command parameter: Minimum supported transmit power level. */
  111. #define LE_TRANSMIT_POWER_LVL_MAX 20 /**< DTM command parameter: Maximum supported transmit power level. */
  112. #define LE_TRANSMIT_POWER_LVL_SET_MIN 0x7E /**< DTM command parameter: Set minimum transmit power level. */
  113. #define LE_TRANSMIT_POWER_LVL_SET_MAX 0x7F /**< DTM command parameter: Set maximum taranmit poer level. */
  114. #define LE_TRANSMIT_POWER_RESPONSE_LVL_POS (0x01) /** Position of power level in the DTM power level set response. */
  115. #define LE_TRANSMIT_POWER_RESPONSE_LVL_MASK (0x1FE) /** Mask of the power level in the DTM power level set respose. */
  116. #define LE_TRANSMIT_POWER_MAX_LVL_BIT (1 << 0x0A) /** Maximum power level bit in the power level set response. */
  117. #define LE_TRANSMIT_POWER_MIN_LVL_BIT (1 << 0x09) /** Minimum power level bit in the power level set response. */
  118. #define LE_CTE_TYPE_MASK 0x03 /** Mask of the CTE type in the CTEInfo. */
  119. #define LE_CTE_TYPE_POS 0x06 /** Position of the CTE type in the CTEInfo. */
  120. #define LE_CTE_CTETIME_MASK 0x1F /** Mask of the CTE Time in the CTEInfo. */
  121. #define LE_CTE_TYPE_AOA 0x00 /** CTE Type Angle of Arrival. */
  122. #define LE_CTE_TYPE_AOD_1US 0x01 /** CTE Type Angle of Departure with 1 us slot. */
  123. #define LE_CTE_TYPE_AOD_2US 0x02 /** CTE Type Angle of Departure with 2 us slot.*/
  124. #define LE_CTE_LENGTH_MIN 0x02 /**< DTM command parameter: Minimum supported CTE length in 8 us units. */
  125. #define LE_CTE_LENGTH_MAX 0x14 /**< DTM command parameter: Maximum supported CTE length in 8 us units. */
  126. #define LE_ANTENNA_NUMBER_MASK 0x3F /**< DTM command parameter: Mask of the Antenna Number. */
  127. #define LE_ANTENA_SWITCH_PATTERN_MASK 0x80 /**< DTM command parameter: Mask of the Antenna switch pattern. */
  128. #define LE_TEST_ANTENNA_NUMBER_MIN 0x01 /**< Minimum antenna number. */
  129. #define LE_TEST_ANTENNA_NUMBER_MAX 0x4B /**< Maximum antenna number. */
  130. // Configuration options used as parameter 2
  131. // when cmd == LE_TRANSMITTER_TEST and payload == DTM_PKT_VENDORSPECIFIC
  132. // Configuration value, if any, is supplied in parameter 3
  133. #define CARRIER_TEST 0 /**< Length=0 indicates a constant, unmodulated carrier until LE_TEST_END or LE_RESET */
  134. #define CARRIER_TEST_STUDIO 1 /**< nRFgo Studio uses value 1 in length field, to indicate a constant, unmodulated carrier until LE_TEST_END or LE_RESET */
  135. #define SET_TX_POWER 2 /**< Set transmission power, value -40..+4 dBm in steps of 4 */
  136. #define SELECT_TIMER 3 /**< Select on of the 16 MHz timers 0, 1 or 2 */
  137. #define SET_NRF21540_TX_POWER 4 /**< Set nRF21540 transmission power level. Choose between two predefinied option +20 dBm or +10 dBm. */
  138. #define LE_PACKET_REPORTING_EVENT 0x8000 /**< DTM Packet reporting event, returned by the device to the tester. */
  139. #define LE_TEST_STATUS_EVENT_SUCCESS 0x0000 /**< DTM Status event, indicating success. */
  140. #define LE_TEST_STATUS_EVENT_ERROR 0x0001 /**< DTM Status event, indicating an error. */
  141. #define DTM_PKT_PRBS9 0x00 /**< Bit pattern PRBS9. */
  142. #define DTM_PKT_0X0F 0x01 /**< Bit pattern 11110000 (LSB is the leftmost bit). */
  143. #define DTM_PKT_0X55 0x02 /**< Bit pattern 10101010 (LSB is the leftmost bit). */
  144. #define DTM_PKT_0XFF 0x03 /**< Bit pattern 11111111 (Used only for coded PHY). */
  145. #define DTM_PKT_VENDORSPECIFIC 0x03 /**< Vendor specific PKT field value. Nordic: Continuous carrier test, or configuration. */
  146. #define DTM_PKT_TYPE_VENDORSPECIFIC 0xFF /**< Vendor specific packet type for internal use. */
  147. #define DTM_PKT_CP_BIT 0x20 /**< CTEInfo Preset bit. Indicates whether the CTEInfo field is present in the packet. */
  148. // The pdu payload type for each bit pattern. Identical to the PKT value except pattern 0xFF which is 0x04.
  149. #define DTM_PDU_TYPE_PRBS9 0x00 /**< PDU payload type for bit pattern PRBS9. */
  150. #define DTM_PDU_TYPE_0X0F 0x01 /**< PDU payload type for bit pattern 11110000 (LSB is the leftmost bit). */
  151. #define DTM_PDU_TYPE_0X55 0x02 /**< PDU payload type for bit pattern 10101010 (LSB is the leftmost bit). */
  152. #define DTM_PDU_TYPE_0XFF 0x04 /**< PDU payload type for bit pattern 11111111 (Used only for coded PHY). */
  153. /**@brief Return codes from dtm_cmd(). */
  154. #define DTM_SUCCESS 0x00 /**< Indicate that the DTM function completed with success. */
  155. #define DTM_ERROR_ILLEGAL_CHANNEL 0x01 /**< Physical channel number must be in the range 0..39. */
  156. #define DTM_ERROR_INVALID_STATE 0x02 /**< Sequencing error: Command is not valid now. */
  157. #define DTM_ERROR_ILLEGAL_LENGTH 0x03 /**< Payload size must be in the range 0..37. */
  158. #define DTM_ERROR_ILLEGAL_CONFIGURATION 0x04 /**< Parameter out of range (legal range is function dependent). */
  159. #define DTM_ERROR_UNINITIALIZED 0x05 /**< DTM module has not been initialized by the application. */
  160. #define DTM_LE_DATA_PACKET_LEN_EXTENSION 0x02 /**< DTM Status Response: LE Data Packet Length Extension feature supported. */
  161. #define DTM_LE_2M_PHY 0x04 /**< DTM Status Response: LE 2M PHY supported. */
  162. #define DTM_LE_STABLE_MODULATION_INDEX 0x08 /**< DTM Status Response: Transmitter has a Stable Modulation Index. */
  163. #define DTM_LE_CODED_PHY 0x10 /**< DTM Status Response: LE Coded PHY supported. */
  164. #define DTM_LE_CONSTANT_TONE_EXTENSION 0x20 /**< DTM Status Response: Constant Tone Extension Supported. */
  165. #define DTM_LE_ANTENNA_SWITCH 0x40 /**< DTM Status Response: Antenna switching supported. */
  166. #define DTM_LE_AOD_1US_TANSMISSION 0x80 /**< DTM Status Response: 1us switching supported for AoD tansmission. */
  167. #define DTM_LE_AOD_1US_RECEPTION 0x100 /**< DTM Status Response: 1us sampling supported for AoA reception. */
  168. #define DTM_LE_AOA_1US_RECEPTION 0x200 /**< DTM Status Response: 1us switching and sampling supported for AoA reception. */
  169. /**@details The UART poll cycle in micro seconds.
  170. * A baud rate of e.g. 19200 bits / second, and 8 data bits, 1 start/stop bit, no flow control,
  171. * give the time to transmit a byte: 10 bits * 1/19200 = approx: 520 us.
  172. * To ensure no loss of bytes, the UART should be polled every 260 us.
  173. */
  174. #if DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud9600
  175. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/9600/2))
  176. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud14400
  177. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/14400/2))
  178. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud19200
  179. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/19200/2))
  180. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud28800
  181. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/28800/2))
  182. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud38400
  183. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/38400/2))
  184. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud57600
  185. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/57600/2))
  186. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud76800
  187. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/768000/2))
  188. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud115200
  189. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/115200/2))
  190. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud230400
  191. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/230400/2))
  192. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud250000
  193. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/250000/2))
  194. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud460800
  195. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/460800/2))
  196. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud921600
  197. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/921600/2))
  198. #elif DTM_BITRATE == UARTE_BAUDRATE_BAUDRATE_Baud1M
  199. #define UART_POLL_CYCLE ((uint32_t)(10*1e6/1e6/2))
  200. #else
  201. // It is possible to find values that work for other baud rates, but the formula above is not
  202. // guaranteed to work for all values. Suitable values may have to be found by trial and error.
  203. #error "Unsupported baud rate set."
  204. #endif
  205. // Note: DTM_PKT_VENDORSPECIFIC, is not a packet type
  206. #define PACKET_TYPE_MAX DTM_PKT_0XFF /**< Highest value allowed as DTM Packet type. */
  207. /** @brief BLE DTM event type. */
  208. typedef uint32_t dtm_event_t; /**< Type for handling DTM event. */
  209. /** @brief BLE DTM frequency type. */
  210. typedef uint32_t dtm_freq_t; /**< Physical channel, valid range: 0..39. */
  211. /**@brief BLE DTM packet types. */
  212. typedef uint32_t dtm_pkt_type_t; /**< Type for holding the requested DTM payload type.*/
  213. /**@brief BLE DTM nRF21540 power mode. */
  214. typedef enum
  215. {
  216. NRF21540_POWER_MODE_A = 0x01, /**< Set nRF21540 transmission power level to the A(20 dBm) predefinied value. */
  217. NRF21540_POWER_MODE_B = 0x02 /**< Set nRF21540 transmission power level to the B(10 dBm) predefinied value. */
  218. } dtm_nrf21540_power_mode_t;
  219. /**@brief Function for initializing or re-initializing DTM module
  220. *
  221. * @return DTM_SUCCESS on successful initialization of the DTM module.
  222. */
  223. uint32_t dtm_init(void);
  224. /**@brief Function for giving control to dtmlib for handling timer and radio events.
  225. * Will return to caller at 625us intervals or whenever another event than radio occurs
  226. * (such as UART input). Function will put MCU to sleep between events.
  227. *
  228. * @return Time counter, incremented every 625 us.
  229. */
  230. uint32_t dtm_wait(void);
  231. /**@brief Function for calling when a complete command has been prepared by the Tester.
  232. *
  233. * @param[in] cmd received 16-bit complete command from the Tester.
  234. *
  235. * @return DTM_SUCCESS or one of the DTM_ERROR_ values
  236. */
  237. uint32_t dtm_cmd(uint16_t cmd);
  238. /**@brief Function for reading the result of a DTM command
  239. *
  240. * @param[out] p_dtm_event Pointer to buffer for 16 bit event code according to DTM standard.
  241. *
  242. * @return true: new event, false: no event since last call, this event has been read earlier
  243. */
  244. bool dtm_event_get(dtm_event_t * p_dtm_event);
  245. /**@brief Function for configuring the timer to use.
  246. *
  247. * @note Must be called when no DTM test is running.
  248. *
  249. * @param[in] new_timer Index (0..2) of timer to be used by the DTM library
  250. *
  251. * @return true: success, new timer was selected, false: parameter error
  252. */
  253. bool dtm_set_timer(uint32_t new_timer);
  254. /**@brief Function for configuring the transmit power.
  255. *
  256. * @note Must be called when no DTM test is running.
  257. *
  258. * @param[in] new_tx_power New output level, +4..-40, in steps of 4.
  259. *
  260. * @return true: tx power setting changed, false: parameter error
  261. */
  262. bool dtm_set_txpower(uint32_t new_tx_power);
  263. /**@brief Function for choosing nRF21540 power level.
  264. *
  265. * @note Must be called when no DTM test is running and nRF21540 is used.
  266. *
  267. * @param[in] power_mode nRF21540 power mode.
  268. *
  269. * @return true: tx power mode setting changed, false: parameter error
  270. */
  271. bool dtm_set_nrf21450_power_mode(dtm_nrf21540_power_mode_t power_mode);
  272. #ifdef __cplusplus
  273. }
  274. #endif
  275. #endif // BLE_DTM_H__
  276. /** @} */