35 #ifndef _DEBUG_FRMWRK_H_ 36 #define _DEBUG_FRMWRK_H_ 51 #define USED_UART_DEBUG_PORT 1 // A31R71x doesn't support UART0. 53 #if (USED_UART_DEBUG_PORT == 0) 54 #define DEBUG_UART_PORT UART0 55 #elif (USED_UART_DEBUG_PORT == 1) 56 #define DEBUG_UART_PORT UART1 63 #define _DBG( x ) _db_msg( (UARTn_Type*)DEBUG_UART_PORT, x ) 64 #define _DBG_( x ) _db_msg_( (UARTn_Type*)DEBUG_UART_PORT, x ) 65 #define _DBC( x ) _db_char( (UARTn_Type*)DEBUG_UART_PORT, x ) 66 #define _DBD( x ) _db_dec( (UARTn_Type*)DEBUG_UART_PORT, x ) 67 #define _DBD16( x ) _db_dec_16( (UARTn_Type*)DEBUG_UART_PORT, x ) 68 #define _DBD32( x ) _db_dec_32( (UARTn_Type*)DEBUG_UART_PORT, x ) 69 #define _DBH( x ) _db_hex( (UARTn_Type*)DEBUG_UART_PORT, x ) 70 #define _DBH16( x ) _db_hex_16( (UARTn_Type*)DEBUG_UART_PORT, x ) 71 #define _DBH32( x ) _db_hex_32( (UARTn_Type*)DEBUG_UART_PORT, x ) 72 #define _DG() _db_get_char( (UARTn_Type*)DEBUG_UART_PORT ) 73 #define _DG_( x ) _db_get_ch( (UARTn_Type*)DEBUG_UART_PORT, x ) 79 extern void ( *
_db_msg )( UARTn_Type* UARTx,
const void* s );
80 extern void ( *
_db_msg_ )( UARTn_Type* UARTx,
const void* s );
81 extern void ( *
_db_char )( UARTn_Type* UARTx, uint8_t ch );
82 extern void ( *
_db_dec )( UARTn_Type* UARTx, uint8_t decn );
83 extern void ( *
_db_dec_16 )( UARTn_Type* UARTx, uint16_t decn );
84 extern void ( *
_db_dec_32 )( UARTn_Type* UARTx, uint32_t decn );
85 extern void ( *
_db_hex )( UARTn_Type* UARTx, uint8_t hexn );
86 extern void ( *
_db_hex_16 )( UARTn_Type* UARTx, uint16_t hexn );
87 extern void ( *
_db_hex_32 )( UARTn_Type* UARTx, uint32_t hexn );
89 extern uint8_t ( *
_db_get_ch )( UARTn_Type* UARTx, uint8_t* ch );
96 void UARTPuts( UARTn_Type* UARTx,
const void* str );
97 void UARTPuts_( UARTn_Type* UARTx,
const void* str );
98 void UARTPutDec( UARTn_Type* UARTx, uint8_t decnum );
100 void UARTPutDec32( UARTn_Type* UARTx, uint32_t decnum );
101 void UARTPutHex( UARTn_Type* UARTx, uint8_t hexnum );
102 void UARTPutHex16( UARTn_Type* UARTx, uint16_t hexnum );
103 void UARTPutHex32( UARTn_Type* UARTx, uint32_t hexnum );
105 uint8_t
UARTGetCh( UARTn_Type* UARTx, uint8_t* ch );
106 void cprintf(
const char* format, ... );
void(* _db_hex)(UARTn_Type *UARTx, uint8_t hexn)
uint8_t(* _db_get_ch)(UARTn_Type *UARTx, uint8_t *ch)
void(* _db_dec_32)(UARTn_Type *UARTx, uint32_t decn)
Contains all macro definitions and function prototypes support for libcfg firmware library on A31R71x...
void UARTPutHex(UARTn_Type *UARTx, uint8_t hexnum)
Puts a hex number to UART port.
void debug_frmwrk_init(void)
Initializes Debug Framework through initializing UARTn.
uint8_t(* _db_get_char)(UARTn_Type *UARTx)
void UARTPutChar(UARTn_Type *UARTx, uint8_t ch)
Puts a character to UART port.
uint8_t UARTGetChar(UARTn_Type *UARTx)
Get a character to UART port.
void UARTPutDec16(UARTn_Type *UARTx, uint16_t decnum)
Puts a decimal number to UART port.
void UARTPutHex32(UARTn_Type *UARTx, uint32_t hexnum)
Puts a hex number to UART port.
void(* _db_hex_16)(UARTn_Type *UARTx, uint16_t hexn)
void UARTPutDec(UARTn_Type *UARTx, uint8_t decnum)
Puts a decimal number to UART port.
Contains all macro definitions and function prototypes support for uartn firmware library on A31R71x.
void UARTPutHex16(UARTn_Type *UARTx, uint16_t hexnum)
Puts a hex number to UART port.
uint8_t UARTGetCh(UARTn_Type *UARTx, uint8_t *ch)
Get a character to UART port.
void(* _db_hex_32)(UARTn_Type *UARTx, uint32_t hexn)
void(* _db_msg)(UARTn_Type *UARTx, const void *s)
void UARTPuts_(UARTn_Type *UARTx, const void *str)
Puts a string to UART port and print new line.
void UARTPuts(UARTn_Type *UARTx, const void *str)
Puts a string to UART port.
void(* _db_dec)(UARTn_Type *UARTx, uint8_t decn)
void(* _db_char)(UARTn_Type *UARTx, uint8_t ch)
void(* _db_dec_16)(UARTn_Type *UARTx, uint16_t decn)
void(* _db_msg_)(UARTn_Type *UARTx, const void *s)
void cprintf(const char *format,...)
print function that supports format as same as printf() function of <stdio.h> library
uint8_t getstring(void)
Get a character to UART port.
void UARTPutDec32(UARTn_Type *UARTx, uint32_t decnum)
Puts a decimal number to UART port.