A31R71x F/W Packages  1.5.0
ABOV Cortex-M0+ Core based MCUs Integrated Driver
A31R71x_hal_debug_frmwrk.h
Go to the documentation of this file.
1 /***************************************************************************//****************************************************************************/
34 
35 #ifndef _DEBUG_FRMWRK_H_
36 #define _DEBUG_FRMWRK_H_
37 
38 #include "A31R71x_hal_uartn.h"
39 #include "A31R71x_hal_libcfg.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 #ifdef _DEBUG_MSG
46 
47 //******************************************************************************
48 // Constant
49 //******************************************************************************
50 
51 #define USED_UART_DEBUG_PORT 1 // A31R71x doesn't support UART0.
52 
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
57 #endif
58 
59 //******************************************************************************
60 // Macro
61 //******************************************************************************
62 
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 )
74 
75 //******************************************************************************
76 // Variable
77 //******************************************************************************
78 
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 );
88 extern uint8_t ( *_db_get_char )( UARTn_Type* UARTx );
89 extern uint8_t ( *_db_get_ch )( UARTn_Type* UARTx, uint8_t* ch );
90 
91 //******************************************************************************
92 // Function
93 //******************************************************************************
94 
95 void UARTPutChar( 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 );
99 void UARTPutDec16( UARTn_Type* UARTx, uint16_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 );
104 uint8_t UARTGetChar( UARTn_Type* UARTx );
105 uint8_t UARTGetCh( UARTn_Type* UARTx, uint8_t* ch );
106 void cprintf( const char* format, ... );
107 void debug_frmwrk_init( void );
108 uint8_t getstring( void );
109 
110 #endif /* _DEBUG_MSG */
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif /* _DEBUG_FRMWRK_H_ */
117 
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.