uc-sdk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
debug_frmwrk.h
Go to the documentation of this file.
1 /***********************************************************************/
20 #ifndef DEBUG_FRMWRK_H_
21 #define DEBUG_FRMWRK_H_
22 
23 //#include <stdarg.h>
24 #include "lpc17xx_uart.h"
25 
26 #define USED_UART_DEBUG_PORT 0
27 
28 #if (USED_UART_DEBUG_PORT==0)
29 #define DEBUG_UART_PORT LPC_UART0
30 #elif (USED_UART_DEBUG_PORT==1)
31 #define DEBUG_UART_PORT LPC_UART1
32 #endif
33 
34 #define _DBG(x) _db_msg(DEBUG_UART_PORT, x)
35 #define _DBG_(x) _db_msg_(DEBUG_UART_PORT, x)
36 #define _DBC(x) _db_char(DEBUG_UART_PORT, x)
37 #define _DBD(x) _db_dec(DEBUG_UART_PORT, x)
38 #define _DBD16(x) _db_dec_16(DEBUG_UART_PORT, x)
39 #define _DBD32(x) _db_dec_32(DEBUG_UART_PORT, x)
40 #define _DBH(x) _db_hex(DEBUG_UART_PORT, x)
41 #define _DBH16(x) _db_hex_16(DEBUG_UART_PORT, x)
42 #define _DBH32(x) _db_hex_32(DEBUG_UART_PORT, x)
43 #define _DG _db_get_char(DEBUG_UART_PORT)
44 //void _printf (const char *format, ...);
45 
46 extern void (*_db_msg)(LPC_UART_TypeDef *UARTx, const void *s);
47 extern void (*_db_msg_)(LPC_UART_TypeDef *UARTx, const void *s);
48 extern void (*_db_char)(LPC_UART_TypeDef *UARTx, uint8_t ch);
49 extern void (*_db_dec)(LPC_UART_TypeDef *UARTx, uint8_t decn);
50 extern void (*_db_dec_16)(LPC_UART_TypeDef *UARTx, uint16_t decn);
51 extern void (*_db_dec_32)(LPC_UART_TypeDef *UARTx, uint32_t decn);
52 extern void (*_db_hex)(LPC_UART_TypeDef *UARTx, uint8_t hexn);
53 extern void (*_db_hex_16)(LPC_UART_TypeDef *UARTx, uint16_t hexn);
54 extern void (*_db_hex_32)(LPC_UART_TypeDef *UARTx, uint32_t hexn);
55 extern uint8_t (*_db_get_char)(LPC_UART_TypeDef *UARTx);
56 
57 void UARTPutChar (LPC_UART_TypeDef *UARTx, uint8_t ch);
58 void UARTPuts(LPC_UART_TypeDef *UARTx, const void *str);
59 void UARTPuts_(LPC_UART_TypeDef *UARTx, const void *str);
60 void UARTPutDec(LPC_UART_TypeDef *UARTx, uint8_t decnum);
61 void UARTPutDec16(LPC_UART_TypeDef *UARTx, uint16_t decnum);
62 void UARTPutDec32(LPC_UART_TypeDef *UARTx, uint32_t decnum);
63 void UARTPutHex (LPC_UART_TypeDef *UARTx, uint8_t hexnum);
64 void UARTPutHex16 (LPC_UART_TypeDef *UARTx, uint16_t hexnum);
65 void UARTPutHex32 (LPC_UART_TypeDef *UARTx, uint32_t hexnum);
66 uint8_t UARTGetChar (LPC_UART_TypeDef *UARTx);
67 void debug_frmwrk_init(void);
68 
69 #endif /* DEBUG_FRMWRK_H_ */