PDK API Guide for J721E
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 extern void Osal_DebugP_assert_fcn(bool expression, const char *file, int32_t line);
136 #define DebugP_assert(expression) (Osal_DebugP_assert_fcn(expression, \
137  __FILE__, __LINE__))
138 #else
139 #define DebugP_assert(expression)
140 #endif
141 
154 #if DebugP_LOG_ENABLED
155 extern void DebugP_exceptionLog(const char * format, uint32_t arg1, uint32_t arg2);
156 #else
157 #define DebugP_exceptionLog(const char * format, uint32_t arg1, uint32_t arg2)
158 #endif
159 
171 #if DebugP_LOG_ENABLED
172 extern void DebugP_log0(const char *format);
173 #else
174 #define DebugP_log0(format)
175 #endif
176 
187 #if DebugP_LOG_ENABLED
189 #else
190 #define DebugP_registerExcptnLogFxn(DebugP_exptnLogFxn fxn)
191 #endif
192 
202 #if DebugP_LOG_ENABLED
204 #else
205 #define DebugP_deRegisterExcptnLogFxn(void)
206 #endif
207 
218 #if DebugP_LOG_ENABLED
219 extern void DebugP_log1(const char *format, uintptr_t p1);
220 #else
221 #define DebugP_log1(format, p1)
222 #endif
223 
236 #if DebugP_LOG_ENABLED
237 extern void DebugP_log2(const char *format, uintptr_t p1, uintptr_t p2);
238 #else
239 #define DebugP_log2(format, p1, p2)
240 #endif
241 
254 #if DebugP_LOG_ENABLED
255 extern void DebugP_log3(const char *format, uintptr_t p1, uintptr_t p2, uintptr_t p3);
256 #else
257 #define DebugP_log3(format, p1, p2, p3)
258 #endif
259 
273 #if DebugP_LOG_ENABLED
274 extern void DebugP_log4(const char *format, uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4);
275 #else
276 #define DebugP_log4(format, p1, p2, p3, p4)
277 #endif
278 
279 #ifdef __cplusplus
280 }
281 #endif
282 
283 #endif /* ti_drivers_ports_DebugP__include */
284 /* @} */
void DebugP_log1(const char *format, uintptr_t p1)
Debug log function with 1 parameters.
void DebugP_log3(const char *format, uintptr_t p1, uintptr_t p2, uintptr_t p3)
Debug log function with 3 parameters.
void DebugP_log2(const char *format, uintptr_t p1, uintptr_t p2)
Debug log function with 2 parameters.
void DebugP_log0(const char *format)
Debug log function with 0 parameters.
void Osal_DebugP_assert_fcn(bool expression, const char *file, int32_t line)
Assert checking function.
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_log4(const char *format, uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4)
Debug log function with 4 parameters.
int32_t DebugP_registerExcptnLogFxn(DebugP_exptnLogFxn fxn)
Debug log function registration.
void(* DebugP_exptnLogFxn)(const char *format,...)
Assert Enabled.
Definition: DebugP.h:108