]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_EFM32_Gecko_Starter_Kit_Simplicity_Studio/Source/SilLabs_Code/emlib/inc/em_dbg.h
aacc838ab8425bfd3cb751822c08722b8d6b4d7a
[freertos] / FreeRTOS / Demo / CORTEX_EFM32_Gecko_Starter_Kit_Simplicity_Studio / Source / SilLabs_Code / emlib / inc / em_dbg.h
1 /***************************************************************************//**\r
2  * @file em_dbg.h\r
3  * @brief Debug (DBG) API\r
4  * @version 4.2.1\r
5  *******************************************************************************\r
6  * @section License\r
7  * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>\r
8  *******************************************************************************\r
9  *\r
10  * Permission is granted to anyone to use this software for any purpose,\r
11  * including commercial applications, and to alter it and redistribute it\r
12  * freely, subject to the following restrictions:\r
13  *\r
14  * 1. The origin of this software must not be misrepresented; you must not\r
15  *    claim that you wrote the original software.\r
16  * 2. Altered source versions must be plainly marked as such, and must not be\r
17  *    misrepresented as being the original software.\r
18  * 3. This notice may not be removed or altered from any source distribution.\r
19  *\r
20  * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no\r
21  * obligation to support this Software. Silicon Labs is providing the\r
22  * Software "AS IS", with no express or implied warranties of any kind,\r
23  * including, but not limited to, any implied warranties of merchantability\r
24  * or fitness for any particular purpose or warranties against infringement\r
25  * of any proprietary rights of a third party.\r
26  *\r
27  * Silicon Labs will not be liable for any consequential, incidental, or\r
28  * special damages, or any other relief, or for any claim by any third party,\r
29  * arising from your use of this Software.\r
30  *\r
31  ******************************************************************************/\r
32 \r
33 \r
34 #ifndef __SILICON_LABS_EM_DBG_H__\r
35 #define __SILICON_LABS_EM_DBG_H__\r
36 \r
37 #include <stdbool.h>\r
38 #include "em_device.h"\r
39 \r
40 #if defined( CoreDebug_DHCSR_C_DEBUGEN_Msk )\r
41 \r
42 #ifdef __cplusplus\r
43 extern "C" {\r
44 #endif\r
45 \r
46 /***************************************************************************//**\r
47  * @addtogroup EM_Library\r
48  * @{\r
49  ******************************************************************************/\r
50 \r
51 /***************************************************************************//**\r
52  * @addtogroup DBG\r
53  * @{\r
54  ******************************************************************************/\r
55 \r
56 /*******************************************************************************\r
57  *****************************   PROTOTYPES   **********************************\r
58  ******************************************************************************/\r
59 \r
60 #if defined( GPIO_ROUTE_SWCLKPEN ) || defined( GPIO_ROUTEPEN_SWCLKTCKPEN )\r
61 /***************************************************************************//**\r
62  * @brief\r
63  *   Check if a debugger is connected (and debug session activated)\r
64  *\r
65  * @details\r
66  *   Used to make run-time decisions depending on whether a debug session\r
67  *   has been active since last reset, ie using a debug probe or similar. In\r
68  *   some cases special handling is required in that scenario.\r
69  *\r
70  * @return\r
71  *   true if a debug session is active since last reset, otherwise false.\r
72  ******************************************************************************/\r
73 __STATIC_INLINE bool DBG_Connected(void)\r
74 {\r
75   return (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) ? true : false;\r
76 }\r
77 #endif\r
78 \r
79 \r
80 #if defined( GPIO_ROUTE_SWOPEN ) || defined( GPIO_ROUTEPEN_SWVPEN )\r
81 void DBG_SWOEnable(unsigned int location);\r
82 #endif\r
83 \r
84 /** @} (end addtogroup DBG) */\r
85 /** @} (end addtogroup EM_Library) */\r
86 \r
87 #ifdef __cplusplus\r
88 }\r
89 #endif\r
90 \r
91 #endif /* defined( CoreDebug_DHCSR_C_DEBUGEN_Msk ) */\r
92 \r
93 #endif /* __SILICON_LABS_EM_DBG_H__ */\r