1 /*
2  * Copyright (c) 2018-2019 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /* Range Delay
8  * Refer to BT Spec v5.1 Vol.6, Part B, Section 4.2.3 Range Delay
9  * "4 / 1000" is an approximation of the propagation time in us of the
10  * signal to travel 1 meter.
11  */
12 #define RANGE_DISTANCE 1000 /* meters */
13 #define RANGE_DELAY_US (2 * RANGE_DISTANCE * 4 / 1000)
14 
addr_us_get(uint8_t phy)15 static inline uint32_t addr_us_get(uint8_t phy)
16 {
17 	switch (phy) {
18 	default:
19 	case PHY_1M:
20 		return 40;
21 	case PHY_2M:
22 		return 24;
23 	case PHY_CODED:
24 		return 376;
25 	}
26 }
27