1 /**********************************************************************
\r
2 * $Id$ debug_frmwrk.h 2011-06-02
\r
4 * @file debug_frmwrk.h
\r
5 * @brief Contains some utilities that used for debugging through UART
\r
7 * @date 02. June. 2011
\r
8 * @author NXP MCU SW Application Team
\r
10 * Copyright(C) 2011, NXP Semiconductor
\r
11 * All rights reserved.
\r
13 ***********************************************************************
\r
14 * Software that is described herein is for illustrative purposes only
\r
15 * which provides customers with programming information regarding the
\r
16 * products. This software is supplied "AS IS" without any warranties.
\r
17 * NXP Semiconductors assumes no responsibility or liability for the
\r
18 * use of the software, conveys no license or title under any patent,
\r
19 * copyright, or mask work right to the product. NXP Semiconductors
\r
20 * reserves the right to make changes in the software without
\r
21 * notification. NXP Semiconductors also make no representation or
\r
22 * warranty that such application will be suitable for the specified
\r
23 * use without further testing or modification.
\r
24 **********************************************************************/
\r
26 /* Peripheral group ----------------------------------------------------------- */
\r
27 /** @defgroup DEBUG_FRMWRK DEBUG FRAMEWORK
\r
28 * @ingroup LPC1800CMSIS_FwLib_Drivers
\r
32 #ifndef DEBUG_FRMWRK_H_
\r
33 #define DEBUG_FRMWRK_H_
\r
35 /* Includes ------------------------------------------------------------------- */
\r
36 #include "lpc18xx_uart.h"
\r
38 #define VCOM_DEBUG_MESSEGES
\r
39 //#define UART_DEBUG_MESSEGES
\r
41 #define USED_UART_DEBUG_PORT 1
\r
43 #if (USED_UART_DEBUG_PORT==0)
\r
44 #define DEBUG_UART_PORT LPC_UART0
\r
45 #elif (USED_UART_DEBUG_PORT==1)
\r
46 #define DEBUG_UART_PORT LPC_UART1
\r
49 #define _DBG(x) _db_msg((LPC_USARTn_Type*)DEBUG_UART_PORT, x)
\r
50 #define _DBG_(x) _db_msg_((LPC_USARTn_Type*)DEBUG_UART_PORT, x)
\r
51 #define _DBC(x) _db_char((LPC_USARTn_Type*)DEBUG_UART_PORT, x)
\r
52 #define _DBD(x) _db_dec((LPC_USARTn_Type*)DEBUG_UART_PORT, x)
\r
53 #define _DBD16(x) _db_dec_16((LPC_USARTn_Type*)DEBUG_UART_PORT, x)
\r
54 #define _DBD32(x) _db_dec_32((LPC_USARTn_Type*)DEBUG_UART_PORT, x)
\r
55 #define _DBH(x) _db_hex((LPC_USARTn_Type*)DEBUG_UART_PORT, x)
\r
56 #define _DBH16(x) _db_hex_16((LPC_USARTn_Type*)DEBUG_UART_PORT, x)
\r
57 #define _DBH32(x) _db_hex_32((LPC_USARTn_Type*)DEBUG_UART_PORT, x)
\r
58 #define _DG _db_get_char((LPC_USARTn_Type*)DEBUG_UART_PORT)
\r
59 void lpc_printf (const char *format, ...);
\r
61 extern void (*_db_msg)(LPC_USARTn_Type *UARTx, const void *s);
\r
62 extern void (*_db_msg_)(LPC_USARTn_Type *UARTx, const void *s);
\r
63 extern void (*_db_char)(LPC_USARTn_Type *UARTx, uint8_t ch);
\r
64 extern void (*_db_dec)(LPC_USARTn_Type *UARTx, uint8_t decn);
\r
65 extern void (*_db_dec_16)(LPC_USARTn_Type *UARTx, uint16_t decn);
\r
66 extern void (*_db_dec_32)(LPC_USARTn_Type *UARTx, uint32_t decn);
\r
67 extern void (*_db_hex)(LPC_USARTn_Type *UARTx, uint8_t hexn);
\r
68 extern void (*_db_hex_16)(LPC_USARTn_Type *UARTx, uint16_t hexn);
\r
69 extern void (*_db_hex_32)(LPC_USARTn_Type *UARTx, uint32_t hexn);
\r
70 extern uint8_t (*_db_get_char)(LPC_USARTn_Type *UARTx);
\r
72 void UARTPutChar (LPC_USARTn_Type *UARTx, uint8_t ch);
\r
73 void UARTPuts(LPC_USARTn_Type *UARTx, const void *str);
\r
74 void UARTPuts_(LPC_USARTn_Type *UARTx, const void *str);
\r
75 void UARTPutDec(LPC_USARTn_Type *UARTx, uint8_t decnum);
\r
76 void UARTPutDec16(LPC_USARTn_Type *UARTx, uint16_t decnum);
\r
77 void UARTPutDec32(LPC_USARTn_Type *UARTx, uint32_t decnum);
\r
78 void UARTPutHex (LPC_USARTn_Type *UARTx, uint8_t hexnum);
\r
79 void UARTPutHex16 (LPC_USARTn_Type *UARTx, uint16_t hexnum);
\r
80 void UARTPutHex32 (LPC_USARTn_Type *UARTx, uint32_t hexnum);
\r
81 uint8_t UARTGetChar (LPC_USARTn_Type *UARTx);
\r
82 void debug_frmwrk_init(void);
\r
84 #endif /* DEBUG_FRMWRK_H_ */
\r
90 /* --------------------------------- End Of File ------------------------------ */
\r