1 /* USER CODE BEGIN Header */
2 /**
3   ******************************************************************************
4   * @file    RTDebug.c
5   * @author  MCD Application Team
6   * @brief   Real Time Debug module API definition
7   ******************************************************************************
8   * @attention
9   *
10   * Copyright (c) 2022 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 #include "RTDebug.h"
21 #include "local_debug_tables.h"
22 #include "stm32wbaxx_hal.h"
23 #include <assert.h>
24 
25 #if(CFG_RT_DEBUG_GPIO_MODULE == 1)
26 static_assert((sizeof(general_debug_table)/sizeof(st_gpio_debug_t)) == RT_DEBUG_SIGNALS_TOTAL_NUM,
27               "Debug signals number is different from debug signal table size."
28 );
29 #endif /* CFG_RT_DEBUG_GPIO_MODULE */
30 
31 /***********************/
32 /** System debug APIs **/
33 /***********************/
34 
SYSTEM_DEBUG_SIGNAL_SET(system_debug_signal_t signal)35 void SYSTEM_DEBUG_SIGNAL_SET(system_debug_signal_t signal)
36 {
37 #if(CFG_RT_DEBUG_GPIO_MODULE == 1)
38   GENERIC_DEBUG_GPIO_SET(signal, system_debug_table);
39 #endif /* CFG_RT_DEBUG_GPIO_MODULE */
40 }
41 
SYSTEM_DEBUG_SIGNAL_RESET(system_debug_signal_t signal)42 void SYSTEM_DEBUG_SIGNAL_RESET(system_debug_signal_t signal)
43 {
44 #if(CFG_RT_DEBUG_GPIO_MODULE == 1)
45   GENERIC_DEBUG_GPIO_RESET(signal, system_debug_table);
46 #endif /* CFG_RT_DEBUG_GPIO_MODULE */
47 }
48 
SYSTEM_DEBUG_SIGNAL_TOGGLE(system_debug_signal_t signal)49 void SYSTEM_DEBUG_SIGNAL_TOGGLE(system_debug_signal_t signal)
50 {
51 #if(CFG_RT_DEBUG_GPIO_MODULE == 1)
52   GENERIC_DEBUG_GPIO_TOGGLE(signal, system_debug_table);
53 #endif /* CFG_RT_DEBUG_GPIO_MODULE */
54 }
55 
56 /***************************/
57 /** Link Layer debug APIs **/
58 /***************************/
59 
60 /* Link Layer debug API definition */
LINKLAYER_DEBUG_SIGNAL_SET(linklayer_debug_signal_t signal)61 void LINKLAYER_DEBUG_SIGNAL_SET(linklayer_debug_signal_t signal)
62 {
63 #if(CFG_RT_DEBUG_GPIO_MODULE == 1)
64   GENERIC_DEBUG_GPIO_SET(signal, linklayer_debug_table);
65 #endif /* CFG_RT_DEBUG_GPIO_MODULE */
66 }
67 
LINKLAYER_DEBUG_SIGNAL_RESET(linklayer_debug_signal_t signal)68 void LINKLAYER_DEBUG_SIGNAL_RESET(linklayer_debug_signal_t signal)
69 {
70 #if(CFG_RT_DEBUG_GPIO_MODULE == 1)
71    GENERIC_DEBUG_GPIO_RESET(signal, linklayer_debug_table);
72 #endif /* CFG_RT_DEBUG_GPIO_MODULE */
73 }
74 
LINKLAYER_DEBUG_SIGNAL_TOGGLE(linklayer_debug_signal_t signal)75 void LINKLAYER_DEBUG_SIGNAL_TOGGLE(linklayer_debug_signal_t signal)
76 {
77 #if(CFG_RT_DEBUG_GPIO_MODULE == 1)
78   GENERIC_DEBUG_GPIO_TOGGLE(signal, linklayer_debug_table);
79 #endif /* CFG_RT_DEBUG_GPIO_MODULE */
80 }
81