NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
ble_phy_trace.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#ifndef H_BLE_PHY_TRACE_
21#define H_BLE_PHY_TRACE_
22
23#include "nimble/porting/nimble/include/os/os_trace_api.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#define BLE_PHY_TRACE_ID_START_TX 0
30#define BLE_PHY_TRACE_ID_START_RX 1
31#define BLE_PHY_TRACE_ID_DISABLE 2
32
33#if MYNEWT_VAL(BLE_PHY_SYSVIEW)
34
35extern uint32_t ble_phy_trace_off;
36
37void ble_phy_trace_init(void);
38
39static inline void
40ble_phy_trace_void(unsigned id)
41{
42 os_trace_api_void(ble_phy_trace_off + id);
43}
44
45static inline void
46ble_phy_trace_u32(unsigned id, uint32_t p1)
47{
48 os_trace_api_u32(ble_phy_trace_off + id, p1);
49}
50
51static inline void
52ble_phy_trace_u32x2(unsigned id, uint32_t p1, uint32_t p2)
53{
54 os_trace_api_u32x2(ble_phy_trace_off + id, p1, p2);
55}
56
57static inline void
58ble_phy_trace_u32x3(unsigned id, uint32_t p1, uint32_t p2, uint32_t p3)
59{
60 os_trace_api_u32x3(ble_phy_trace_off + id, p1, p2, p3);
61}
62
63#else
64
65static inline void
66ble_phy_trace_init(void)
67{
68}
69
70static inline void
71ble_phy_trace_void(unsigned id)
72{
73}
74
75static inline void
76ble_phy_trace_u32(unsigned id, uint32_t p1)
77{
78}
79
80static inline void
81ble_phy_trace_u32x2(unsigned id, uint32_t p1, uint32_t p2)
82{
83}
84
85static inline void
86ble_phy_trace_u32x3(unsigned id, uint32_t p1, uint32_t p2, uint32_t p3)
87{
88}
89
90#endif
91
92#ifdef __cplusplus
93}
94#endif
95
96#endif /* H_BLE_PHY_TRACE_ */