212#define NRF_DM_DEFAULT_SINGLE_ANTENNA_CONFIG \
213 ((nrf_dm_antenna_config_t){ \
214 .antenna_gpios_count = 0, \
215 .antenna_gpios = NULL, \
216 .switch_pattern_count = 0, \
217 .switch_pattern = NULL, \
244#if defined(RADIO_TXPOWER_TXPOWER_Pos8dBm)
245#define NRF_DM_DEFAULT_TX_POWER RADIO_TXPOWER_TXPOWER_Pos8dBm
246#elif defined(RADIO_TXPOWER_TXPOWER_Pos4dBm)
247#define NRF_DM_DEFAULT_TX_POWER RADIO_TXPOWER_TXPOWER_Pos4dBm
248#elif defined(RADIO_TXPOWER_TXPOWER_Pos1dBm)
249#define NRF_DM_DEFAULT_TX_POWER RADIO_TXPOWER_TXPOWER_Pos1dBm
250#elif defined(RADIO_TXPOWER_TXPOWER_0dBm)
251#define NRF_DM_DEFAULT_TX_POWER RADIO_TXPOWER_TXPOWER_0dBm
254#define NRF_DM_DEFAULT_ANTENNA_COMP (NRF_DM_ANTENNA_COMP_1_1)
259#define NRF_DM_DEFAULT_CONFIG \
260 ((nrf_dm_config_t){ \
261 .role = NRF_DM_ROLE_NONE, \
262 .ranging_mode = NRF_DM_RANGING_MODE_MCPD, \
264 .tx_power_dbm = NRF_DM_DEFAULT_TX_POWER, \
265 .ant_comp = NRF_DM_DEFAULT_ANTENNA_COMP, \
281 NRF_TIMER_Type * timer);
314#define NRF_DM_PROC_EXECUTE_DURATION_OVERHEAD_US (200)
346#define NRF_DM_CHANNEL_MAP_LEN 75
void nrf_dm_populate_report(nrf_dm_report_t *p_report)
Partially populate the report. This populates the report but does not set the distance estimates and ...
nrf_dm_sinr_indicator_t
SINR indicator for IQ measurements.
Definition: nrf_dm.h:40
@ NRF_DM_SINR_INDICATOR_VERY_LOW
Definition: nrf_dm.h:44
@ NRF_DM_SINR_INDICATOR_MEDIUM
Definition: nrf_dm.h:42
@ NRF_DM_SINR_INDICATOR_HIGH
Definition: nrf_dm.h:41
@ NRF_DM_SINR_INDICATOR_LOW
Definition: nrf_dm.h:43
#define NRF_DM_CHANNEL_MAP_LEN
This is the length, in number of channels, of the channel map used within the library.
Definition: nrf_dm.h:346
float nrf_dm_high_precision_calc(nrf_dm_report_t *p_report)
Estimate the distance with more computation-intensive higher precision algorithm.
nrf_dm_quality_t nrf_dm_calc(nrf_dm_report_t *p_report)
Estimate the distance Fills nrf_dm_report_t with distance estimates either mcpd or rtt according to t...
nrf_dm_ranging_mode_t
Ranging modes.
Definition: nrf_dm.h:71
@ NRF_DM_RANGING_MODE_MCPD
Definition: nrf_dm.h:73
@ NRF_DM_RANGING_MODE_RTT
Definition: nrf_dm.h:72
nrf_dm_quality_t
Quality of the procedure.
Definition: nrf_dm.h:30
@ NRF_DM_QUALITY_OK
Definition: nrf_dm.h:31
@ NRF_DM_QUALITY_POOR
Definition: nrf_dm.h:32
@ NRF_DM_QUALITY_DO_NOT_USE
Definition: nrf_dm.h:33
@ NRF_DM_QUALITY_CRC_FAIL
Definition: nrf_dm.h:34
void nrf_dm_init(const nrf_dm_ppi_config_t *ppi_cfg, const nrf_dm_antenna_config_t *antenna_cfg, NRF_TIMER_Type *timer)
Initialize the distance measurement procedure.
uint32_t nrf_dm_get_duration_us(const nrf_dm_config_t *config)
Get the duration in microseconds that it will take to execute the distance measurement in initiator r...
nrf_dm_status_t nrf_dm_proc_execute(uint32_t timeout_us)
Start the distance measurement.
nrf_dm_antenna_composition_t
Configuration options for antenna configurations.
Definition: nrf_dm.h:123
@ NRF_DM_ANTENNA_COMP_2_1
Definition: nrf_dm.h:127
@ NRF_DM_ANTENNA_COMP_1_2
Definition: nrf_dm.h:133
@ NRF_DM_ANTENNA_COMP_1_4
Definition: nrf_dm.h:137
@ NRF_DM_ANTENNA_COMP_2_2
Definition: nrf_dm.h:139
@ NRF_DM_ANTENNA_COMP_3_1
Definition: nrf_dm.h:129
@ NRF_DM_ANTENNA_COMP_1_1
Definition: nrf_dm.h:125
@ NRF_DM_ANTENNA_COMP_4_1
Definition: nrf_dm.h:131
@ NRF_DM_ANTENNA_COMP_1_3
Definition: nrf_dm.h:135
nrf_dm_status_t nrf_dm_configure(const nrf_dm_config_t *config)
Configures the distance measurement procedure.
nrf_dm_role_t
Role definition.
Definition: nrf_dm.h:50
@ NRF_DM_ROLE_NONE
Definition: nrf_dm.h:51
@ NRF_DM_ROLE_REFLECTOR
Definition: nrf_dm.h:55
@ NRF_DM_ROLE_INITIATOR
Definition: nrf_dm.h:53
void nrf_dm_get_hopping_sequence(const nrf_dm_config_t *config, uint8_t hopping_sequence[75])
Get the channel hopping sequence used for a given configuration instance.
const char * nrf_dm_version_string_get(void)
Get a null-terminated string containing the library revision.
nrf_dm_status_t
Status of the procedure.
Definition: nrf_dm.h:61
@ NRF_DM_STATUS_CONF_INVALID
Definition: nrf_dm.h:65
@ NRF_DM_STATUS_EVENT_FAIL_TIMEOUT
Definition: nrf_dm.h:64
@ NRF_DM_STATUS_SUCCESS
Definition: nrf_dm.h:62
@ NRF_DM_STATUS_FAIL_SYNC
Definition: nrf_dm.h:63
#define NRF_DM_MAX_NUM_ANT
Definition: nrf_dm_version.h:14
uint32_t * switch_pattern
Definition: nrf_dm.h:209
uint8_t switch_pattern_count
Definition: nrf_dm.h:201
uint8_t antenna_gpios_count
Definition: nrf_dm.h:197
nrf_dm_antenna_gpio_t * antenna_gpios
Definition: nrf_dm.h:199
uint8_t gpio
Definition: nrf_dm.h:190
uint8_t gpio_te
Definition: nrf_dm.h:192
uint32_t tx_power_dbm
Definition: nrf_dm.h:239
uint32_t rng_seed
Definition: nrf_dm.h:235
nrf_dm_antenna_composition_t ant_comp
Definition: nrf_dm.h:241
nrf_dm_role_t role
Definition: nrf_dm.h:229
nrf_dm_ranging_mode_t ranging_mode
Definition: nrf_dm.h:231
float phase_slope
Definition: nrf_dm.h:106
float rssi_openspace
Definition: nrf_dm.h:108
float best
Definition: nrf_dm.h:110
float ifft
Definition: nrf_dm.h:104
float rtt
Definition: nrf_dm.h:115
Container of IQ values for local and remote measured tones.
Definition: nrf_dm.h:79
uint8_t * ppi_chan
Definition: nrf_dm.h:224
uint8_t ppi_chan_count
Definition: nrf_dm.h:222
nrf_dm_quality_t quality
Definition: nrf_dm.h:179
uint8_t rssi_remote
Definition: nrf_dm.h:171
uint8_t rtt_count
Definition: nrf_dm.h:185
nrf_dm_iq_tones_sinr_indicator_t tone_sinr_indicators
Definition: nrf_dm.h:155
int8_t txpwr_local
Definition: nrf_dm.h:174
uint8_t link_loss
Definition: nrf_dm.h:166
nrf_dm_dist_estimates_t distance_estimates
Definition: nrf_dm.h:160
nrf_dm_ranging_mode_t ranging_mode
Definition: nrf_dm.h:158
int32_t rtt_accumulated_ns
Definition: nrf_dm.h:182
nrf_dm_status_t status
Definition: nrf_dm.h:163
uint8_t rssi_local
Definition: nrf_dm.h:169
int8_t txpwr_remote
Definition: nrf_dm.h:176
Output data for distance estimation.
Definition: nrf_dm.h:145
Container of distance estimate results for a number of different methods, in meters.
Definition: nrf_dm.h:101