nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
cs_de.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef CS_DE_H__
8#define CS_DE_H__
9
10#include <zephyr/bluetooth/conn.h>
11#include <zephyr/net_buf.h>
12
13#define CS_DE_NUM_CHANNELS (75)
14
27typedef struct {
29 float i_local[CS_DE_NUM_CHANNELS];
31 float q_local[CS_DE_NUM_CHANNELS];
33 float i_remote[CS_DE_NUM_CHANNELS];
35 float q_remote[CS_DE_NUM_CHANNELS];
37
42
47typedef struct {
49 float ifft;
53 float rtt;
59 float best;
61
69
73typedef struct {
75 enum bt_conn_le_cs_role role;
76
78 uint8_t n_ap;
79
81 cs_de_iq_tones_t iq_tones[CONFIG_BT_CS_DE_MAX_NUM_ANTENNA_PATHS];
82
84 cs_de_tone_quality_t tone_quality[CONFIG_BT_CS_DE_MAX_NUM_ANTENNA_PATHS];
85
87 cs_de_dist_estimates_t distance_estimates[CONFIG_BT_CS_DE_MAX_NUM_ANTENNA_PATHS];
88
91
93 uint8_t rtt_count;
95
105 float iq_tones_comb[CS_DE_NUM_CHANNELS * 2]);
106
116
125float cs_de_ifft(float iq_tones_comb[2 * CONFIG_BT_CS_DE_NFFT_SIZE]);
126
135float cs_de_rtt(int32_t rtt_accumulated_half_ns, uint8_t rtt_count);
136
143float cs_de_phase_slope(float iq_tones_comb[CS_DE_NUM_CHANNELS * 2]);
144
149#endif /* CS_DE_H__ */
#define CS_DE_NUM_CHANNELS
Definition cs_de.h:13
cs_de_tone_quality_t
Definition cs_de.h:38
@ CS_DE_TONE_QUALITY_BAD
Definition cs_de.h:40
@ CS_DE_TONE_QUALITY_OK
Definition cs_de.h:39
cs_de_quality_t
Quality of the procedure.
Definition cs_de.h:65
@ CS_DE_QUALITY_OK
Definition cs_de.h:66
@ CS_DE_QUALITY_DO_NOT_USE
Definition cs_de.h:67
void cs_de_combined_iq_calculate(cs_de_iq_tones_t *cs_de_iq_tones, float iq_tones_comb[(75) *2])
Combine the local and remote IQ values in a cs_de_iq_tones_t to one array. This is done through an el...
float cs_de_phase_slope(float iq_tones_comb[(75) *2])
Calculate distance estimate based on the phase slope of the input IQ values.
cs_de_quality_t cs_de_calc(cs_de_report_t *p_report)
Calculate distance estimates and quality for a given report This function assumes the report has been...
float cs_de_rtt(int32_t rtt_accumulated_half_ns, uint8_t rtt_count)
Calculate a distance estimate based on the accumulated RTT To do this, average time of flight is calc...
float cs_de_ifft(float iq_tones_comb[2 *CONFIG_BT_CS_DE_NFFT_SIZE])
Calculates a distance estimate based on the IFFT magnitude of the input IQ values....
float phase_slope
Definition cs_de.h:51
float rtt
Definition cs_de.h:53
float ifft
Definition cs_de.h:49
float best
Definition cs_de.h:59
Container of distance estimate results for a number of different methods, in meters.
Definition cs_de.h:47
Container of IQ values for local and remote measured tones.
Definition cs_de.h:27
enum bt_conn_le_cs_role role
Definition cs_de.h:75
int32_t rtt_accumulated_half_ns
Definition cs_de.h:90
uint8_t n_ap
Definition cs_de.h:78
uint8_t rtt_count
Definition cs_de.h:93
Output data for distance estimation.
Definition cs_de.h:73