1 /* USER CODE BEGIN Header */
2 /**
3   ******************************************************************************
4   * @file    tl_dbg_conf.h
5   * @author  MCD Application Team
6   * @brief   Debug configuration file for stm32wpan transport layer interface.
7   ******************************************************************************
8   * @attention
9   *
10   * Copyright (c) 2020-2021 STMicroelectronics.
11   * All rights reserved.
12   *
13   * This software is licensed under terms that can be found in the LICENSE file
14   * in the root directory of this software component.
15   * If no LICENSE file comes with this software, it is provided AS-IS.
16   *
17   ******************************************************************************
18   */
19 /* USER CODE END Header */
20 
21 /* Define to prevent recursive inclusion -------------------------------------*/
22 #ifndef TL_DBG_CONF_H
23 #define TL_DBG_CONF_H
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /* USER CODE BEGIN Tl_Conf */
30 
31 /* Includes ------------------------------------------------------------------*/
32 #include "app_conf.h"   /* required as some configuration used in dbg_trace.h are set there */
33 #include "dbg_trace.h"
34 #include "hw_if.h"
35 
36 /**
37  * Enable or Disable traces
38  * The raw data output is the hci binary packet format as specified by the BT specification *
39  */
40 #define TL_SHCI_CMD_DBG_EN      0   /* Reports System commands sent to CPU2 and the command response */
41 #define TL_SHCI_CMD_DBG_RAW_EN  0   /* Reports raw data System commands sent to CPU2 and the command response */
42 #define TL_SHCI_EVT_DBG_EN      0   /* Reports System Asynchronous Events received from CPU2 */
43 #define TL_SHCI_EVT_DBG_RAW_EN  0   /* Reports raw data System Asynchronous Events received from CPU2 */
44 
45 #define TL_HCI_CMD_DBG_EN       0   /* Reports BLE command sent to CPU2 and the command response */
46 #define TL_HCI_CMD_DBG_RAW_EN   0   /* Reports raw data BLE command sent to CPU2 and the command response */
47 #define TL_HCI_EVT_DBG_EN       0   /* Reports BLE Asynchronous Events received from CPU2 */
48 #define TL_HCI_EVT_DBG_RAW_EN   0   /* Reports raw data BLE Asynchronous Events received from CPU2 */
49 
50 #define TL_MM_DBG_EN            0   /* Reports the information of the buffer released to CPU2 */
51 
52 /**
53  * Macro definition
54  */
55 
56 /**
57  * System Transport Layer
58  */
59 #if (TL_SHCI_CMD_DBG_EN != 0)
60 #define TL_SHCI_CMD_DBG_MSG             PRINT_MESG_DBG
61 #define TL_SHCI_CMD_DBG_BUF             PRINT_LOG_BUFF_DBG
62 #else
63 #define TL_SHCI_CMD_DBG_MSG(...)
64 #define TL_SHCI_CMD_DBG_BUF(...)
65 #endif
66 
67 #if (TL_SHCI_CMD_DBG_RAW_EN != 0)
68 #define TL_SHCI_CMD_DBG_RAW(_PDATA_, _SIZE_)  HW_UART_Transmit(hw_uart1, (uint8_t*)_PDATA_, _SIZE_, (~0))
69 #else
70 #define TL_SHCI_CMD_DBG_RAW(...)
71 #endif
72 
73 #if (TL_SHCI_EVT_DBG_EN != 0)
74 #define TL_SHCI_EVT_DBG_MSG             PRINT_MESG_DBG
75 #define TL_SHCI_EVT_DBG_BUF             PRINT_LOG_BUFF_DBG
76 #else
77 #define TL_SHCI_EVT_DBG_MSG(...)
78 #define TL_SHCI_EVT_DBG_BUF(...)
79 #endif
80 
81 #if (TL_SHCI_EVT_DBG_RAW_EN != 0)
82 #define TL_SHCI_EVT_DBG_RAW(_PDATA_, _SIZE_)  HW_UART_Transmit(hw_uart1, (uint8_t*)_PDATA_, _SIZE_, (~0))
83 #else
84 #define TL_SHCI_EVT_DBG_RAW(...)
85 #endif
86 
87 /**
88  * BLE Transport Layer
89  */
90 #if (TL_HCI_CMD_DBG_EN != 0)
91 #define TL_HCI_CMD_DBG_MSG             PRINT_MESG_DBG
92 #define TL_HCI_CMD_DBG_BUF             PRINT_LOG_BUFF_DBG
93 #else
94 #define TL_HCI_CMD_DBG_MSG(...)
95 #define TL_HCI_CMD_DBG_BUF(...)
96 #endif
97 
98 #if (TL_HCI_CMD_DBG_RAW_EN != 0)
99 #define TL_HCI_CMD_DBG_RAW(_PDATA_, _SIZE_)  HW_UART_Transmit(hw_uart1, (uint8_t*)_PDATA_, _SIZE_, (~0))
100 #else
101 #define TL_HCI_CMD_DBG_RAW(...)
102 #endif
103 
104 #if (TL_HCI_EVT_DBG_EN != 0)
105 #define TL_HCI_EVT_DBG_MSG             PRINT_MESG_DBG
106 #define TL_HCI_EVT_DBG_BUF             PRINT_LOG_BUFF_DBG
107 #else
108 #define TL_HCI_EVT_DBG_MSG(...)
109 #define TL_HCI_EVT_DBG_BUF(...)
110 #endif
111 
112 #if (TL_HCI_EVT_DBG_RAW_EN != 0)
113 #define TL_HCI_EVT_DBG_RAW(_PDATA_, _SIZE_)  HW_UART_Transmit(hw_uart1, (uint8_t*)_PDATA_, _SIZE_, (~0))
114 #else
115 #define TL_HCI_EVT_DBG_RAW(...)
116 #endif
117 
118 /**
119  * Memory Manager - Released buffer tracing
120  */
121 #if (TL_MM_DBG_EN != 0)
122 #define TL_MM_DBG_MSG             PRINT_MESG_DBG
123 #else
124 #define TL_MM_DBG_MSG(...)
125 #endif
126 
127 /* USER CODE END Tl_Conf */
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
133 #endif /* TL_DBG_CONF_H */
134