NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
ble_ll_utils.h
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#include <stdint.h>
21
22#define INT16_GT(_a, _b) ((int16_t)((_a) - (_b)) > 0)
23#define INT16_LT(_a, _b) ((int16_t)((_a) - (_b)) < 0)
24#define INT16_LTE(_a, _b) ((int16_t)((_a) - (_b)) <= 0)
25
26uint32_t ble_ll_utils_calc_access_addr(void);
27uint8_t ble_ll_utils_remapped_channel(uint8_t remap_index, const uint8_t *chanmap);
28uint8_t ble_ll_utils_dci_csa2(uint16_t counter, uint16_t chan_id,
29 uint8_t num_used_chans, const uint8_t *chan_map);
30uint16_t ble_ll_utils_dci_iso_event(uint16_t counter, uint16_t chan_id,
31 uint16_t *prn_sub_lu, uint8_t num_used_chans,
32 const uint8_t *chan_map, uint16_t *remap_idx);
33uint16_t ble_ll_utils_dci_iso_subevent(uint16_t chan_id, uint16_t *prn_sub_lu,
34 uint8_t num_used_chans, const uint8_t *chan_map,
35 uint16_t *remap_idx);
36uint8_t ble_ll_utils_calc_num_used_chans(const uint8_t *chan_map);
37uint32_t ble_ll_utils_calc_window_widening(uint32_t anchor_point,
38 uint32_t last_anchor_point,
39 uint8_t central_sca);