PSDK QNX API Guide
DebugP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2020, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
67 #ifndef ti_drivers_ports_DebugP__include
68 #define ti_drivers_ports_DebugP__include
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
74 #include <stdint.h>
75 #include <stdbool.h>
76 #include <stddef.h>
77 #include <stdarg.h>
78 
79 #define DebugP_ASSERT_ENABLED 1
80 #define DebugP_LOG_ENABLED 1
81 
89 #ifndef DebugP_ASSERT_ENABLED
90 #define DebugP_ASSERT_ENABLED 0
91 #endif
92 
99 #ifndef DebugP_LOG_ENABLED
100 #define DebugP_LOG_ENABLED 0
101 #endif
102 
103 #if DebugP_LOG_ENABLED
104 
108 typedef void (*DebugP_exptnLogFxn)(const char *format, ...);
109 
116 #define DEBUGP_LOGFXN_REGISTER_SUCCESS (0)
117 #define DEBUGP_LOGFXN_ALREADY_REGISTERD (-1)
118 #endif
119 
134 #if DebugP_ASSERT_ENABLED
135 /* Rename file to filename in function prototype to fix MISRA.CT.UNIQUE.ID and MISRA.VAR.HIDDEN KW issues */
136 extern void Osal_DebugP_assert_fcn(bool expression, const char *filename, int32_t line);
137 #define DebugP_assert(expression) (Osal_DebugP_assert_fcn(expression, \
138  __FILE__, __LINE__))
139 #else
140 #define DebugP_assert(expression)
141 #endif
142 
155 #if DebugP_LOG_ENABLED
156 extern void DebugP_exceptionLog(const char * format, uint32_t arg1, uint32_t arg2);
157 #else
158 #define DebugP_exceptionLog(const char * format, uint32_t arg1, uint32_t arg2)
159 #endif
160 
172 #if DebugP_LOG_ENABLED
173 extern void DebugP_log0(const char *format);
174 #else
175 #define DebugP_log0(format)
176 #endif
177 
188 #if DebugP_LOG_ENABLED
190 #else
191 #define DebugP_registerExcptnLogFxn(DebugP_exptnLogFxn fxn)
192 #endif
193 
203 #if DebugP_LOG_ENABLED
205 #else
206 #define DebugP_deRegisterExcptnLogFxn(void)
207 #endif
208 
219 #if DebugP_LOG_ENABLED
220 extern void DebugP_log1(const char *format, uintptr_t p1);
221 #else
222 #define DebugP_log1(format, p1)
223 #endif
224 
237 #if DebugP_LOG_ENABLED
238 extern void DebugP_log2(const char *format, uintptr_t p1, uintptr_t p2);
239 #else
240 #define DebugP_log2(format, p1, p2)
241 #endif
242 
255 #if DebugP_LOG_ENABLED
256 extern void DebugP_log3(const char *format, uintptr_t p1, uintptr_t p2, uintptr_t p3);
257 #else
258 #define DebugP_log3(format, p1, p2, p3)
259 #endif
260 
274 #if DebugP_LOG_ENABLED
275 extern void DebugP_log4(const char *format, uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4);
276 #else
277 #define DebugP_log4(format, p1, p2, p3, p4)
278 #endif
279 
280 #ifdef __cplusplus
281 }
282 #endif
283 
284 #endif /* ti_drivers_ports_DebugP__include */
285 /* @} */
void DebugP_deRegisterExcptnLogFxn(void)
Debug log function deregistration.
void DebugP_exceptionLog(const char *format, uint32_t arg1, uint32_t arg2)
DebugP Exception state log function. It takes a pair of values to be printed during exception dump.
void DebugP_log3(const char *format, uintptr_t p1, uintptr_t p2, uintptr_t p3)
Debug log function with 3 parameters.
int32_t DebugP_registerExcptnLogFxn(DebugP_exptnLogFxn fxn)
Debug log function registration.
void(* DebugP_exptnLogFxn)(const char *format,...)
Assert Enabled.
Definition: DebugP.h:108
void DebugP_log2(const char *format, uintptr_t p1, uintptr_t p2)
Debug log function with 2 parameters.
void Osal_DebugP_assert_fcn(bool expression, const char *filename, int32_t line)
Assert checking function.
void DebugP_log4(const char *format, uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4)
Debug log function with 4 parameters.
void DebugP_log1(const char *format, uintptr_t p1)
Debug log function with 1 parameters.
void DebugP_log0(const char *format)
Debug log function with 0 parameters.