xeye_ atsu
/
I2S_AIC23B_32khz_wavtest
I2S_Example/debug_frmwrk.h@0:63ed631d8c3a, 2011-01-21 (annotated)
- Committer:
- lynxeyed_atsu
- Date:
- Fri Jan 21 08:39:48 2011 +0000
- Revision:
- 0:63ed631d8c3a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lynxeyed_atsu | 0:63ed631d8c3a | 1 | /***********************************************************************//** |
lynxeyed_atsu | 0:63ed631d8c3a | 2 | * @file debug_frmwrk.h |
lynxeyed_atsu | 0:63ed631d8c3a | 3 | * @brief Contains some utilities that used for debugging through UART |
lynxeyed_atsu | 0:63ed631d8c3a | 4 | * @version 2.0 |
lynxeyed_atsu | 0:63ed631d8c3a | 5 | * @date 21. May. 2010 |
lynxeyed_atsu | 0:63ed631d8c3a | 6 | * @author NXP MCU SW Application Team |
lynxeyed_atsu | 0:63ed631d8c3a | 7 | *---------------------------------------------------------------------------- |
lynxeyed_atsu | 0:63ed631d8c3a | 8 | * Software that is described herein is for illustrative purposes only |
lynxeyed_atsu | 0:63ed631d8c3a | 9 | * which provides customers with programming information regarding the |
lynxeyed_atsu | 0:63ed631d8c3a | 10 | * products. This software is supplied "AS IS" without any warranties. |
lynxeyed_atsu | 0:63ed631d8c3a | 11 | * NXP Semiconductors assumes no responsibility or liability for the |
lynxeyed_atsu | 0:63ed631d8c3a | 12 | * use of the software, conveys no license or title under any patent, |
lynxeyed_atsu | 0:63ed631d8c3a | 13 | * copyright, or mask work right to the product. NXP Semiconductors |
lynxeyed_atsu | 0:63ed631d8c3a | 14 | * reserves the right to make changes in the software without |
lynxeyed_atsu | 0:63ed631d8c3a | 15 | * notification. NXP Semiconductors also make no representation or |
lynxeyed_atsu | 0:63ed631d8c3a | 16 | * warranty that such application will be suitable for the specified |
lynxeyed_atsu | 0:63ed631d8c3a | 17 | * use without further testing or modification. |
lynxeyed_atsu | 0:63ed631d8c3a | 18 | **********************************************************************/ |
lynxeyed_atsu | 0:63ed631d8c3a | 19 | |
lynxeyed_atsu | 0:63ed631d8c3a | 20 | #ifndef DEBUG_FRMWRK_H_ |
lynxeyed_atsu | 0:63ed631d8c3a | 21 | #define DEBUG_FRMWRK_H_ |
lynxeyed_atsu | 0:63ed631d8c3a | 22 | |
lynxeyed_atsu | 0:63ed631d8c3a | 23 | //#include <stdarg.h> |
lynxeyed_atsu | 0:63ed631d8c3a | 24 | #include "lpc17xx_uart.h" |
lynxeyed_atsu | 0:63ed631d8c3a | 25 | |
lynxeyed_atsu | 0:63ed631d8c3a | 26 | #define USED_UART_DEBUG_PORT 0 |
lynxeyed_atsu | 0:63ed631d8c3a | 27 | |
lynxeyed_atsu | 0:63ed631d8c3a | 28 | #if (USED_UART_DEBUG_PORT==0) |
lynxeyed_atsu | 0:63ed631d8c3a | 29 | #define DEBUG_UART_PORT LPC_UART0 |
lynxeyed_atsu | 0:63ed631d8c3a | 30 | #elif (USED_UART_DEBUG_PORT==1) |
lynxeyed_atsu | 0:63ed631d8c3a | 31 | #define DEBUG_UART_PORT LPC_UART1 |
lynxeyed_atsu | 0:63ed631d8c3a | 32 | #endif |
lynxeyed_atsu | 0:63ed631d8c3a | 33 | |
lynxeyed_atsu | 0:63ed631d8c3a | 34 | #define _DBG(x) _db_msg(DEBUG_UART_PORT, x) |
lynxeyed_atsu | 0:63ed631d8c3a | 35 | #define _DBG_(x) _db_msg_(DEBUG_UART_PORT, x) |
lynxeyed_atsu | 0:63ed631d8c3a | 36 | #define _DBC(x) _db_char(DEBUG_UART_PORT, x) |
lynxeyed_atsu | 0:63ed631d8c3a | 37 | #define _DBD(x) _db_dec(DEBUG_UART_PORT, x) |
lynxeyed_atsu | 0:63ed631d8c3a | 38 | #define _DBD16(x) _db_dec_16(DEBUG_UART_PORT, x) |
lynxeyed_atsu | 0:63ed631d8c3a | 39 | #define _DBD32(x) _db_dec_32(DEBUG_UART_PORT, x) |
lynxeyed_atsu | 0:63ed631d8c3a | 40 | #define _DBH(x) _db_hex(DEBUG_UART_PORT, x) |
lynxeyed_atsu | 0:63ed631d8c3a | 41 | #define _DBH16(x) _db_hex_16(DEBUG_UART_PORT, x) |
lynxeyed_atsu | 0:63ed631d8c3a | 42 | #define _DBH32(x) _db_hex_32(DEBUG_UART_PORT, x) |
lynxeyed_atsu | 0:63ed631d8c3a | 43 | #define _DG _db_get_char(DEBUG_UART_PORT) |
lynxeyed_atsu | 0:63ed631d8c3a | 44 | //void _printf (const char *format, ...); |
lynxeyed_atsu | 0:63ed631d8c3a | 45 | |
lynxeyed_atsu | 0:63ed631d8c3a | 46 | extern void (*_db_msg)(LPC_UART_TypeDef *UARTx, const void *s); |
lynxeyed_atsu | 0:63ed631d8c3a | 47 | extern void (*_db_msg_)(LPC_UART_TypeDef *UARTx, const void *s); |
lynxeyed_atsu | 0:63ed631d8c3a | 48 | extern void (*_db_char)(LPC_UART_TypeDef *UARTx, uint8_t ch); |
lynxeyed_atsu | 0:63ed631d8c3a | 49 | extern void (*_db_dec)(LPC_UART_TypeDef *UARTx, uint8_t decn); |
lynxeyed_atsu | 0:63ed631d8c3a | 50 | extern void (*_db_dec_16)(LPC_UART_TypeDef *UARTx, uint16_t decn); |
lynxeyed_atsu | 0:63ed631d8c3a | 51 | extern void (*_db_dec_32)(LPC_UART_TypeDef *UARTx, uint32_t decn); |
lynxeyed_atsu | 0:63ed631d8c3a | 52 | extern void (*_db_hex)(LPC_UART_TypeDef *UARTx, uint8_t hexn); |
lynxeyed_atsu | 0:63ed631d8c3a | 53 | extern void (*_db_hex_16)(LPC_UART_TypeDef *UARTx, uint16_t hexn); |
lynxeyed_atsu | 0:63ed631d8c3a | 54 | extern void (*_db_hex_32)(LPC_UART_TypeDef *UARTx, uint32_t hexn); |
lynxeyed_atsu | 0:63ed631d8c3a | 55 | extern uint8_t (*_db_get_char)(LPC_UART_TypeDef *UARTx); |
lynxeyed_atsu | 0:63ed631d8c3a | 56 | |
lynxeyed_atsu | 0:63ed631d8c3a | 57 | void UARTPutChar (LPC_UART_TypeDef *UARTx, uint8_t ch); |
lynxeyed_atsu | 0:63ed631d8c3a | 58 | void UARTPuts(LPC_UART_TypeDef *UARTx, const void *str); |
lynxeyed_atsu | 0:63ed631d8c3a | 59 | void UARTPuts_(LPC_UART_TypeDef *UARTx, const void *str); |
lynxeyed_atsu | 0:63ed631d8c3a | 60 | void UARTPutDec(LPC_UART_TypeDef *UARTx, uint8_t decnum); |
lynxeyed_atsu | 0:63ed631d8c3a | 61 | void UARTPutDec16(LPC_UART_TypeDef *UARTx, uint16_t decnum); |
lynxeyed_atsu | 0:63ed631d8c3a | 62 | void UARTPutDec32(LPC_UART_TypeDef *UARTx, uint32_t decnum); |
lynxeyed_atsu | 0:63ed631d8c3a | 63 | void UARTPutHex (LPC_UART_TypeDef *UARTx, uint8_t hexnum); |
lynxeyed_atsu | 0:63ed631d8c3a | 64 | void UARTPutHex16 (LPC_UART_TypeDef *UARTx, uint16_t hexnum); |
lynxeyed_atsu | 0:63ed631d8c3a | 65 | void UARTPutHex32 (LPC_UART_TypeDef *UARTx, uint32_t hexnum); |
lynxeyed_atsu | 0:63ed631d8c3a | 66 | uint8_t UARTGetChar (LPC_UART_TypeDef *UARTx); |
lynxeyed_atsu | 0:63ed631d8c3a | 67 | void debug_frmwrk_init(void); |
lynxeyed_atsu | 0:63ed631d8c3a | 68 | |
lynxeyed_atsu | 0:63ed631d8c3a | 69 | #endif /* DEBUG_FRMWRK_H_ */ |