b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /** \file vp_debug.h |
| 2 | * vp_debug.h |
| 3 | * |
| 4 | * This file contains the configuration and compile time settings for |
| 5 | * the VoicePath API debug statements. |
| 6 | * |
| 7 | * Copyright (c) 2011, Microsemi Corporation |
| 8 | * |
| 9 | * $Revision: 12408 $ |
| 10 | * $LastChangedDate: 2017-06-08 16:48:24 -0500 (Thu, 08 Jun 2017) $ |
| 11 | * |
| 12 | * As of svn 5835, no part of the VP-API-II uses the old VP_DOUT method. |
| 13 | */ |
| 14 | |
| 15 | #ifndef VP_DEBUG_H |
| 16 | #define VP_DEBUG_H |
| 17 | |
| 18 | #include "vp_api_cfg.h" |
| 19 | #include "vp_api_types.h" |
| 20 | #include "sys_service.h" |
| 21 | |
| 22 | /* |
| 23 | * These are not documented in the API-II and should be used for internal |
| 24 | * purposes only. Reserved range (0x00010000 to 0x80000000) |
| 25 | */ |
| 26 | #define DBG_EVENT_VERBOSE 0x00010000 /* Verbose event debug (792) */ |
| 27 | #define DBG_BOOT_WRITE 0x00020000 /* Displays all boot blocks */ |
| 28 | |
| 29 | /* Define VP_DEBUG_COLOR to display ANSI X3.64 color codes in debug output. */ |
| 30 | #define VP_DEBUG_COLOR |
| 31 | #include "vp_debug_colors.h" |
| 32 | |
| 33 | /* Colors for debug messages (if VP_DEBUG_COLOR is defined): */ |
| 34 | #define VP_DBG_ERROR_COLOR bright_red |
| 35 | #define VP_DBG_WARNING_COLOR dark_yellow |
| 36 | #define VP_DBG_INFO_COLOR dark_blue |
| 37 | #define VP_DBG_API_FUNC_COLOR bright_cyan |
| 38 | #define VP_DBG_API_FUNC_INT_COLOR dark_cyan |
| 39 | #define VP_DBG_HAL_COLOR bright_white |
| 40 | #define VP_DBG_SSL_COLOR dark_green |
| 41 | #define VP_DBG_EVENT_COLOR bright_blue |
| 42 | #define VP_DBG_CALIBRATION_COLOR bright_white |
| 43 | #define VP_DBG_LINE_STATE_COLOR dark_yellow |
| 44 | #define VP_DBG_HOOK_COLOR bright_cyan |
| 45 | #define VP_DBG_TEST_COLOR bright_blue |
| 46 | #define VP_DBG_TEST_FUNC_COLOR bright_yellow |
| 47 | #define VP_DBG_FXO_FUNC_COLOR dark_green |
| 48 | #define VP_DBG_SEQUENCER_COLOR dark_blue |
| 49 | #define VP_DBG_CID_COLOR bright_white |
| 50 | #define VP_DBG_TEST_PCM_COLOR bright_cyan |
| 51 | #define VP_DBG_GAIN_COLOR dark_yellow |
| 52 | #define VP_DBG_TIMER_COLOR bright_green |
| 53 | #define VP_DBG_TEST_CALC_COLOR dark_yellow |
| 54 | #define VP_DBG_ADP_RING_COLOR dark_green |
| 55 | #define VP_DBG_INTERRUPT_COLOR dark_cyan |
| 56 | #define VP_DBG_DTMF_COLOR dark_green |
| 57 | #define VP_DBG_DTMF_DETAIL_COLOR dark_blue |
| 58 | |
| 59 | /* Define VP_DEBUG_LOC to include the location (file and line) in each debug message. */ |
| 60 | #undef VP_DEBUG_LOC |
| 61 | |
| 62 | #ifdef VP_DEBUG_LOC |
| 63 | #define VP_SHOW_LOC() VpSysDebugPrintf(" (" __FILE__ ":%d)", __LINE__) |
| 64 | #else |
| 65 | #define VP_SHOW_LOC() |
| 66 | #endif |
| 67 | |
| 68 | /* Basic debug output macro: */ |
| 69 | #define VP_DOUT_(msgType, msgColor, objType, pObj, printf_args) \ |
| 70 | if (VpDebugEnabled_ ## objType (VP_DBG_ ## msgType, color_fg(msgColor) #msgType, pObj)) { \ |
| 71 | VpSysDebugPrintf printf_args; \ |
| 72 | VP_SHOW_LOC(); \ |
| 73 | VpSysDebugPrintf(color_reset "\n"); \ |
| 74 | } |
| 75 | |
| 76 | /* Conditionally compile in various types of debug messages: */ |
| 77 | #if !defined(VP_DEBUG) && defined(VP_CC_DEBUG_SELECT) |
| 78 | #undef VP_CC_DEBUG_SELECT |
| 79 | #endif |
| 80 | #ifndef VP_CC_DEBUG_SELECT |
| 81 | #define VP_CC_DEBUG_SELECT 0 |
| 82 | #endif |
| 83 | #if (VP_CC_DEBUG_SELECT & VP_DBG_ERROR) |
| 84 | #define VP_ERROR(objType, pObj, printf_args) VP_DOUT_(ERROR, VP_DBG_ERROR_COLOR, objType, pObj, printf_args) |
| 85 | #else |
| 86 | #define VP_ERROR(objType, pObj, printf_args) |
| 87 | #endif |
| 88 | #if (VP_CC_DEBUG_SELECT & VP_DBG_WARNING) |
| 89 | #define VP_WARNING(objType, pObj, printf_args) VP_DOUT_(WARNING, VP_DBG_WARNING_COLOR, objType, pObj, printf_args) |
| 90 | #else |
| 91 | #define VP_WARNING(objType, pObj, printf_args) |
| 92 | #endif |
| 93 | #if (VP_CC_DEBUG_SELECT & VP_DBG_INFO) |
| 94 | #define VP_INFO(objType, pObj, printf_args) VP_DOUT_(INFO, VP_DBG_INFO_COLOR, objType, pObj, printf_args) |
| 95 | #else |
| 96 | #define VP_INFO(objType, pObj, printf_args) |
| 97 | #endif |
| 98 | #if (VP_CC_DEBUG_SELECT & VP_DBG_API_FUNC) |
| 99 | #define VP_API_FUNC(objType, pObj, printf_args) VP_DOUT_(API_FUNC, VP_DBG_API_FUNC_COLOR, objType, pObj, printf_args) |
| 100 | #else |
| 101 | #define VP_API_FUNC(objType, pObj, printf_args) |
| 102 | #endif |
| 103 | #if (VP_CC_DEBUG_SELECT & VP_DBG_API_FUNC_INT) |
| 104 | #define VP_API_FUNC_INT(objType, pObj, printf_args) VP_DOUT_(API_FUNC_INT, VP_DBG_API_FUNC_INT_COLOR, objType, pObj, printf_args) |
| 105 | #else |
| 106 | #define VP_API_FUNC_INT(objType, pObj, printf_args) |
| 107 | #endif |
| 108 | #if (VP_CC_DEBUG_SELECT & VP_DBG_CALIBRATION) |
| 109 | #define VP_CALIBRATION(objType, pObj, printf_args) VP_DOUT_(CALIBRATION, VP_DBG_CALIBRATION_COLOR, objType, pObj, printf_args) |
| 110 | #else |
| 111 | #define VP_CALIBRATION(objType, pObj, printf_args) |
| 112 | #endif |
| 113 | #if (VP_CC_DEBUG_SELECT & VP_DBG_LINE_STATE) |
| 114 | #define VP_LINE_STATE(objType, pObj, printf_args) VP_DOUT_(LINE_STATE, VP_DBG_LINE_STATE_COLOR, objType, pObj, printf_args) |
| 115 | #else |
| 116 | #define VP_LINE_STATE(objType, pObj, printf_args) |
| 117 | #endif |
| 118 | #if (VP_CC_DEBUG_SELECT & VP_DBG_HOOK) |
| 119 | #define VP_HOOK(objType, pObj, printf_args) VP_DOUT_(HOOK, VP_DBG_HOOK_COLOR, objType, pObj, printf_args) |
| 120 | #else |
| 121 | #define VP_HOOK(objType, pObj, printf_args) |
| 122 | #endif |
| 123 | #if (VP_CC_DEBUG_SELECT & VP_DBG_TEST) |
| 124 | #define VP_TEST(objType, pObj, printf_args) VP_DOUT_(TEST, VP_DBG_TEST_COLOR, objType, pObj, printf_args) |
| 125 | #else |
| 126 | #define VP_TEST(objType, pObj, printf_args) |
| 127 | #endif |
| 128 | #if (VP_CC_DEBUG_SELECT & VP_DBG_TEST_FUNC) |
| 129 | #define VP_TEST_FUNC(objType, pObj, printf_args) VP_DOUT_(TEST_FUNC, VP_DBG_TEST_FUNC_COLOR, objType, pObj, printf_args) |
| 130 | #else |
| 131 | #define VP_TEST_FUNC(objType, pObj, printf_args) |
| 132 | #endif |
| 133 | #if (VP_CC_DEBUG_SELECT & VP_DBG_FXO_FUNC) |
| 134 | #define VP_FXO_FUNC(objType, pObj, printf_args) VP_DOUT_(FXO_FUNC, VP_DBG_FXO_FUNC_COLOR, objType, pObj, printf_args) |
| 135 | #else |
| 136 | #define VP_FXO_FUNC(objType, pObj, printf_args) |
| 137 | #endif |
| 138 | #if (VP_CC_DEBUG_SELECT & VP_DBG_SEQUENCER) |
| 139 | #define VP_SEQUENCER(objType, pObj, printf_args) VP_DOUT_(SEQUENCER, VP_DBG_SEQUENCER_COLOR, objType, pObj, printf_args) |
| 140 | #else |
| 141 | #define VP_SEQUENCER(objType, pObj, printf_args) |
| 142 | #endif |
| 143 | #if (VP_CC_DEBUG_SELECT & VP_DBG_CID) |
| 144 | #define VP_CID(objType, pObj, printf_args) VP_DOUT_(CID, VP_DBG_CID_COLOR, objType, pObj, printf_args) |
| 145 | #else |
| 146 | #define VP_CID(objType, pObj, printf_args) |
| 147 | #endif |
| 148 | #if (VP_CC_DEBUG_SELECT & VP_DBG_TEST_PCM) |
| 149 | #define VP_TEST_PCM(objType, pObj, printf_args) VP_DOUT_(TEST_PCM, VP_DBG_TEST_PCM_COLOR, objType, pObj, printf_args) |
| 150 | #else |
| 151 | #define VP_TEST_PCM(objType, pObj, printf_args) |
| 152 | #endif |
| 153 | #if (VP_CC_DEBUG_SELECT & VP_DBG_GAIN) |
| 154 | #define VP_GAIN(objType, pObj, printf_args) VP_DOUT_(GAIN, VP_DBG_GAIN_COLOR, objType, pObj, printf_args) |
| 155 | #else |
| 156 | #define VP_GAIN(objType, pObj, printf_args) |
| 157 | #endif |
| 158 | #if (VP_CC_DEBUG_SELECT & VP_DBG_TIMER) |
| 159 | #define VP_TIMER(objType, pObj, printf_args) VP_DOUT_(TIMER, VP_DBG_TIMER_COLOR, objType, pObj, printf_args) |
| 160 | #else |
| 161 | #define VP_TIMER(objType, pObj, printf_args) |
| 162 | #endif |
| 163 | #if (VP_CC_DEBUG_SELECT & VP_DBG_TEST_CALC) |
| 164 | #define VP_TEST_CALC(objType, pObj, printf_args) VP_DOUT_(TEST_CALC, VP_DBG_TEST_CALC_COLOR, objType, pObj, printf_args) |
| 165 | #else |
| 166 | #define VP_TEST_CALC(objType, pObj, printf_args) |
| 167 | #endif |
| 168 | #if (VP_CC_DEBUG_SELECT & VP_DBG_ADP_RING) |
| 169 | #define VP_ADP_RING(objType, pObj, printf_args) VP_DOUT_(ADP_RING, VP_DBG_ADP_RING_COLOR, objType, pObj, printf_args) |
| 170 | #else |
| 171 | #define VP_ADP_RING(objType, pObj, printf_args) |
| 172 | #endif |
| 173 | #if (VP_CC_DEBUG_SELECT & VP_DBG_INTERRUPT) |
| 174 | #define VP_INTERRUPT(objType, pObj, printf_args) VP_DOUT_(INTERRUPT, VP_DBG_INTERRUPT_COLOR, objType, pObj, printf_args) |
| 175 | #else |
| 176 | #define VP_INTERRUPT(objType, pObj, printf_args) |
| 177 | #endif |
| 178 | #if (VP_CC_DEBUG_SELECT & VP_DBG_DTMF) |
| 179 | #define VP_DTMF(objType, pObj, printf_args) VP_DOUT_(DTMF, VP_DBG_DTMF_COLOR, objType, pObj, printf_args) |
| 180 | #else |
| 181 | #define VP_DTMF(objType, pObj, printf_args) |
| 182 | #endif |
| 183 | #if (VP_CC_DEBUG_SELECT & VP_DBG_DTMF_DETAIL) |
| 184 | #define VP_DTMF_DETAIL(objType, pObj, printf_args) VP_DOUT_(DTMF_DETAIL, VP_DBG_DTMF_DETAIL_COLOR, objType, pObj, printf_args) |
| 185 | #else |
| 186 | #define VP_DTMF_DETAIL(objType, pObj, printf_args) |
| 187 | #endif |
| 188 | |
| 189 | |
| 190 | #if (VP_CC_DEBUG_SELECT & VP_DBG_SSL) |
| 191 | #define VP_SSL(objType, pObj, printf_args) VP_DOUT_(SSL, VP_DBG_SSL_COLOR, objType, pObj, printf_args) |
| 192 | #define VP_SYS_ENTER_CRITICAL(deviceId, criticalSecType) VpSysEnterCriticalWrapper(deviceId, criticalSecType) |
| 193 | #define VP_SYS_EXIT_CRITICAL(deviceId, criticalSecType) VpSysExitCriticalWrapper(deviceId, criticalSecType) |
| 194 | #define VP_SYS_WAIT(time) \ |
| 195 | (VP_SSL(None, VP_NULL, ("VpSysWait(%u frames = %u ms)", (time), ((time) + 7 / 8))), VpSysWait(time)) |
| 196 | #else |
| 197 | #define VP_SSL(objType, pObj, printf_args) |
| 198 | #define VP_SYS_ENTER_CRITICAL(deviceId, criticalSecType) VpSysEnterCritical(deviceId, criticalSecType) |
| 199 | #define VP_SYS_EXIT_CRITICAL(deviceId, criticalSecType) VpSysExitCritical(deviceId, criticalSecType) |
| 200 | #define VP_SYS_WAIT(time) VpSysWait(time) |
| 201 | #endif |
| 202 | |
| 203 | #ifndef VP_HAL_DEVICE_TYPE |
| 204 | #define VP_HAL_DEVICE_TYPE VP_DEV_VCP_SERIES |
| 205 | #endif |
| 206 | |
| 207 | #if (VP_CC_DEBUG_SELECT & VP_DBG_HAL) |
| 208 | #define VP_HAL(objType, pObj, printf_args) VP_DOUT_(HAL, VP_DBG_HAL_COLOR, objType, pObj, printf_args) |
| 209 | #define VP_HAL_HBI_CMD(deviceId, cmd) \ |
| 210 | (VpDisplayHbiCmd(VP_HAL_DEVICE_TYPE, deviceId, cmd), \ |
| 211 | VpHalHbiCmd(deviceId, cmd)) |
| 212 | #define VP_HAL_HBI_WRITE(deviceId, cmd, numwords, data) \ |
| 213 | (VpDisplayHbiCmd(VP_HAL_DEVICE_TYPE, deviceId, cmd), \ |
| 214 | VpDisplayHbiData(deviceId, numwords + 1, data), \ |
| 215 | VpHalHbiWrite(deviceId, cmd, numwords, data)) |
| 216 | #define VP_HAL_HBI_READ(deviceId, cmd, numwords, data) \ |
| 217 | VpHalHbiReadWrapper(VP_HAL_DEVICE_TYPE, deviceId, cmd, numwords, data) |
| 218 | #if (VP_CC_DEBUG_SELECT & DBG_BOOT_WRITE) |
| 219 | #define VP_HAL_HBI_BOOT_WR(deviceId, numWords, data) \ |
| 220 | (VpDisplayHbiAccess(VP_HAL_DEVICE_TYPE, deviceId, numWords + 1, (uint16p)(data)), \ |
| 221 | VpHalHbiBootWr(deviceId, numWords, data)) |
| 222 | #else |
| 223 | #define VP_HAL_HBI_BOOT_WR(deviceId, numWords, data) \ |
| 224 | VpHalHbiBootWr(deviceId, numWords, data) |
| 225 | #endif |
| 226 | #else |
| 227 | #define VP_HAL(objType, pObj, printf_args) |
| 228 | #define VP_HAL_HBI_CMD(deviceId, cmd) \ |
| 229 | VpHalHbiCmd(deviceId, cmd) |
| 230 | #define VP_HAL_HBI_WRITE(deviceId, cmd, numwords, data) \ |
| 231 | VpHalHbiWrite(deviceId, cmd, numwords, data) |
| 232 | #define VP_HAL_HBI_READ(deviceId, cmd, numwords, data) \ |
| 233 | VpHalHbiRead(deviceId, cmd, numwords, data) |
| 234 | #define VP_HAL_HBI_BOOT_WR(deviceId, numWords, data) \ |
| 235 | VpHalHbiBootWr(deviceId, numWords, data) |
| 236 | #endif |
| 237 | |
| 238 | /* Basic assert macro: */ |
| 239 | #define VP_ASSERT(condition) \ |
| 240 | if (!(condition)) { \ |
| 241 | VP_ERROR(None, VP_NULL, ("Assertion failed: %s\n", #condition)); \ |
| 242 | /* exit(-1); */ \ |
| 243 | } |
| 244 | |
| 245 | #define VP_DOUT(msgType, printf_args) |
| 246 | |
| 247 | /* Global debug select mask (for messages that are not specific to a particular |
| 248 | line or device): */ |
| 249 | EXTERN uint32 vpDebugSelectMask; |
| 250 | |
| 251 | #ifdef VP_CC_VCP2_SERIES |
| 252 | EXTERN bool |
| 253 | VpDebugEnabled_VpVcp2DeviceObjectType( |
| 254 | uint32 msgType, |
| 255 | char *msgTypeStr, |
| 256 | VpVcp2DeviceObjectType *pDevObj); |
| 257 | |
| 258 | EXTERN bool |
| 259 | VpDebugEnabled_VpVcp2LineObjectType( |
| 260 | uint32 msgType, |
| 261 | char *msgTypeStr, |
| 262 | VpVcp2LineObjectType *pLineObj); |
| 263 | #endif |
| 264 | |
| 265 | #ifdef VP_CC_MELT_SERIES |
| 266 | EXTERN bool |
| 267 | VpDebugEnabled_VpMeltDeviceObjectType( |
| 268 | uint32 msgType, |
| 269 | char *msgTypeStr, |
| 270 | VpMeltDeviceObjectType *pDevObj); |
| 271 | |
| 272 | EXTERN bool |
| 273 | VpDebugEnabled_VpMeltLineObjectType( |
| 274 | uint32 msgType, |
| 275 | char *msgTypeStr, |
| 276 | VpMeltLineObjectType *pLineObj); |
| 277 | #endif |
| 278 | |
| 279 | #ifdef VP_CC_MELT792_SERIES |
| 280 | EXTERN bool |
| 281 | VpDebugEnabled_VpMelt792DeviceObjectType( |
| 282 | uint32 msgType, |
| 283 | char *msgTypeStr, |
| 284 | VpMelt792DeviceObjectType *pDevObj); |
| 285 | |
| 286 | EXTERN bool |
| 287 | VpDebugEnabled_VpMelt792LineObjectType( |
| 288 | uint32 msgType, |
| 289 | char *msgTypeStr, |
| 290 | VpMelt792LineObjectType *pLineObj); |
| 291 | #endif |
| 292 | |
| 293 | #ifdef VP_CC_890_SERIES |
| 294 | EXTERN bool |
| 295 | VpDebugEnabled_Vp890DeviceObjectType( |
| 296 | uint32 msgType, |
| 297 | char *msgTypeStr, |
| 298 | Vp890DeviceObjectType *pDevObj); |
| 299 | |
| 300 | EXTERN bool |
| 301 | VpDebugEnabled_Vp890LineObjectType( |
| 302 | uint32 msgType, |
| 303 | char *msgTypeStr, |
| 304 | Vp890LineObjectType *pLineObj); |
| 305 | #endif |
| 306 | |
| 307 | #ifdef VP_CC_880_SERIES |
| 308 | EXTERN bool |
| 309 | VpDebugEnabled_Vp880DeviceObjectType( |
| 310 | uint32 msgType, |
| 311 | char *msgTypeStr, |
| 312 | Vp880DeviceObjectType *pDevObj); |
| 313 | |
| 314 | EXTERN bool |
| 315 | VpDebugEnabled_Vp880LineObjectType( |
| 316 | uint32 msgType, |
| 317 | char *msgTypeStr, |
| 318 | Vp880LineObjectType *pLineObj); |
| 319 | #endif |
| 320 | |
| 321 | #ifdef VP_CC_886_SERIES |
| 322 | EXTERN bool |
| 323 | VpDebugEnabled_Vp886DeviceObjectType( |
| 324 | uint32 msgType, |
| 325 | char *msgTypeStr, |
| 326 | Vp886DeviceObjectType *pDevObj); |
| 327 | |
| 328 | EXTERN bool |
| 329 | VpDebugEnabled_Vp886LineObjectType( |
| 330 | uint32 msgType, |
| 331 | char *msgTypeStr, |
| 332 | Vp886LineObjectType *pLineObj); |
| 333 | #endif |
| 334 | |
| 335 | EXTERN bool |
| 336 | VpDebugEnabled_VpDeviceIdType( |
| 337 | uint32 msgType, |
| 338 | char *msgTypeStr, |
| 339 | VpDeviceIdType *pDeviceId); |
| 340 | |
| 341 | EXTERN bool |
| 342 | VpDebugEnabled_VpLineIdType( |
| 343 | uint32 msgType, |
| 344 | char *msgTypeStr, |
| 345 | VpLineIdType *pLineId); |
| 346 | |
| 347 | EXTERN bool |
| 348 | VpDebugEnabled_VpDevCtxType( |
| 349 | uint32 msgType, |
| 350 | char *msgTypeStr, |
| 351 | VpDevCtxType *pDevCtx); |
| 352 | |
| 353 | EXTERN bool |
| 354 | VpDebugEnabled_VpLineCtxType( |
| 355 | uint32 msgType, |
| 356 | char *msgTypeStr, |
| 357 | VpLineCtxType *pLineCtx); |
| 358 | |
| 359 | EXTERN bool |
| 360 | VpDebugEnabled_None( |
| 361 | uint32 msgType, |
| 362 | char *msgTypeStr, |
| 363 | void *nothing); |
| 364 | |
| 365 | EXTERN const char * |
| 366 | VpGetString_VpStatusType( |
| 367 | VpStatusType status); |
| 368 | |
| 369 | EXTERN const char * |
| 370 | VpGetString_VpOptionIdType( |
| 371 | VpOptionIdType status); |
| 372 | |
| 373 | EXTERN const char * |
| 374 | VpGetString_VpProfileType( |
| 375 | VpProfileType profType); |
| 376 | |
| 377 | EXTERN void |
| 378 | VpDisplayEvent( |
| 379 | VpEventType *pEvent); |
| 380 | |
| 381 | EXTERN void |
| 382 | VpDisplayResults( |
| 383 | VpEventType *pEvent, |
| 384 | void *pResult); |
| 385 | |
| 386 | EXTERN void |
| 387 | VpDisplayHbiAccess( |
| 388 | VpDeviceType deviceType, |
| 389 | VpDeviceIdType deviceId, |
| 390 | unsigned bufLen, |
| 391 | uint16 *buf); |
| 392 | |
| 393 | EXTERN unsigned |
| 394 | VpDisplayHbiCmd( |
| 395 | VpDeviceType deviceType, |
| 396 | VpDeviceIdType deviceId, |
| 397 | uint16 cmd); |
| 398 | |
| 399 | EXTERN void |
| 400 | VpDisplayHbiData( |
| 401 | VpDeviceIdType deviceId, |
| 402 | unsigned bufLen, |
| 403 | uint16 *buf); |
| 404 | |
| 405 | EXTERN bool |
| 406 | VpHalHbiReadWrapper( |
| 407 | VpDeviceType deviceType, |
| 408 | VpDeviceIdType deviceId, |
| 409 | uint16 cmd, |
| 410 | uint8 numwords, |
| 411 | uint16 *data); |
| 412 | |
| 413 | #if (VP_CC_DEBUG_SELECT & VP_DBG_SSL) |
| 414 | EXTERN const char * |
| 415 | VpGetString_VpCriticalSecType( |
| 416 | VpCriticalSecType criticalSecType); |
| 417 | |
| 418 | EXTERN uint8 |
| 419 | VpSysEnterCriticalWrapper( |
| 420 | VpDeviceIdType deviceId, |
| 421 | VpCriticalSecType criticalSecType); |
| 422 | |
| 423 | EXTERN uint8 |
| 424 | VpSysExitCriticalWrapper( |
| 425 | VpDeviceIdType deviceId, |
| 426 | VpCriticalSecType criticalSecType); |
| 427 | #endif |
| 428 | |
| 429 | /* Derivative debug macros: */ |
| 430 | #define VP_API_ENTER(objType, pObj, funcName) \ |
| 431 | VP_API_FUNC(objType, pObj, ("Vp%s():", funcName)) |
| 432 | #define VP_API_EXIT(objType, pObj, funcName, status) \ |
| 433 | VP_API_FUNC(objType, pObj, ("Vp%s() = %s", funcName, VpGetString_VpStatusType(status))) |
| 434 | #define VP_API_INT_ENTER(objType, pObj, funcName) \ |
| 435 | VP_API_FUNC_INT(objType, pObj, ("%s():", funcName)) |
| 436 | #define VP_API_INT_EXIT(objType, pObj, funcName, status) \ |
| 437 | VP_API_FUNC_INT(objType, pObj, ("%s() = %s", funcName, VpGetString_VpStatusType(status))) |
| 438 | |
| 439 | #if (VP_CC_DEBUG_SELECT & VP_DBG_INFO) |
| 440 | void VpPrintVpApiVersion(void); |
| 441 | #if defined (VP_CC_880_SERIES) || defined (VP_CC_890_SERIES) || defined (VP_CC_886_SERIES) |
| 442 | void VpPrintTermType(VpTermType termType); |
| 443 | void VpPrintLineStateType(VpLineStateType lineState, char *strLineState); |
| 444 | void VpPrintOptionRingControlType(VpOptionRingControlType *ringCtrl); |
| 445 | void VpPrintOptionZeroCrossType(VpOptionZeroCrossType zeroCross); |
| 446 | void VpPrintRelayControlType(VpRelayControlType relayState); |
| 447 | void VpPrintOptionCodecType(VpOptionCodecType codec); |
| 448 | void VpPrintOptionPcmTxRxCntrlType(VpOptionPcmTxRxCntrlType pcmTxRxCtrl); |
| 449 | void VpPrintDigitType(VpDigitType digit, char *name); |
| 450 | void VpPrintCallerIdType(VpCallerIdType *callerId); |
| 451 | void VpPrintCidSeqDataType(VpCidSeqDataType *cidSeq); |
| 452 | void VpPrintSeqDataType(VpSeqDataType *cadence); |
| 453 | void VpPrintVpCslacTimerStruct(VpCslacTimerStruct *lineTimers); |
| 454 | |
| 455 | |
| 456 | void VpPrintApiIntLineState(VpApiIntLineStateType *lineState); |
| 457 | void VpPrintDigitGenDataType(VpDigitGenerationDataType *digitGenStruct); |
| 458 | |
| 459 | |
| 460 | void VpPrintDynamicInfoStruct(VpDeviceDynamicInfoType *dynamicInfo); |
| 461 | void VpPrintStaticInfoStruct(VpDeviceStaticInfoType *staticInfo); |
| 462 | |
| 463 | /* Bit-wise values from VpDeviceBusyFlagsType */ |
| 464 | void VpPrintStateInformation(uint16 state); |
| 465 | void |
| 466 | VpPrintDeviceProfileStruct( |
| 467 | VpDeviceType deviceType, |
| 468 | void *devProfileData); |
| 469 | |
| 470 | void |
| 471 | VpPrintEventMaskStruct( |
| 472 | bool isDeviceInfo, |
| 473 | bool isMask, |
| 474 | VpOptionEventMaskType *eventMask); |
| 475 | |
| 476 | void VpPrintCriticalFltStruct(VpOptionCriticalFltType *criticalFault); |
| 477 | void VpPrintGetResultsOptionStruct(VpGetResultsOptionsType *resultsOption); |
| 478 | void VpPrintRelGainResultsStruct(VpRelGainResultsType *relGainResults); |
| 479 | |
| 480 | #define VpPrintEventHandle(eventHandle) VpSysDebugPrintf("\n\n\rpDevObj->eventHandle = 0x%04X", eventHandle) |
| 481 | #define VpPrintTimeStamp(timeStamp) VpSysDebugPrintf("\n\n\rpDevObj->timeStamp = 0x%04X", timeStamp) |
| 482 | |
| 483 | void VpPrintDeviceProfileTable(VpCSLACDeviceProfileTableType *devProfileTable); |
| 484 | void VpPrintProfileTableEntry(VpCSLACProfileTableEntryType *profEntry); |
| 485 | |
| 486 | #if defined (VP890_FXS_SUPPORT) || defined (VP880_FXS_SUPPORT) |
| 487 | void |
| 488 | VpPrintPulseSpecs( |
| 489 | uint8 specNumber, |
| 490 | VpOptionPulseType *pulseSpecs); |
| 491 | void |
| 492 | VpPrintDPStateMachine( |
| 493 | uint8 stateMachineNum, |
| 494 | VpDialPulseDetectType *dpStruct); |
| 495 | #endif |
| 496 | |
| 497 | void |
| 498 | VpPrintDeviceTimers( |
| 499 | uint16 devTimer[VP_DEV_TIMER_LAST]); |
| 500 | |
| 501 | #define VpPrintResponseData(responseData) VpSysDebugPrintf("\n\n\rpDevObj->responseData = 0x%04X", responseData) |
| 502 | #define VpPrintTxBufferRate(txBufferDataRate) VpSysDebugPrintf("\n\n\rpDevObj->txBufferDataRate = %d", txBufferDataRate) |
| 503 | |
| 504 | #if defined (VP_CC_886_SERIES) |
| 505 | void VpPrintTimerQueue(VpTimerQueueInfoType *pInfo, VpTimerQueueNodeType *pNodes); |
| 506 | void VpPrintPulseDecodeData(VpPulseDecodeDataType *pPulseDecode); |
| 507 | void VpPrintSlacBufData(VpSlacBufDataType *pSlacBuf); |
| 508 | #endif /* defined (VP_CC_886_SERIES) */ |
| 509 | |
| 510 | |
| 511 | #endif /* defined (VP_CC_880_SERIES) || defined (VP_CC_890_SERIES) || defined (VP_CC_886_SERIES) */ |
| 512 | #endif /* VP_CC_DEBUG_SELECT & VP_DBG_INFO */ |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | |
| 519 | |
| 520 | #endif /* VP_DEBUG_H */ |
| 521 | |