49 #define ASCII_BACKSPACE (0x08) 50 #define ASCII_LINEFEED (0x0A) 51 #define ASCII_CARRIAGE_RETURN (0x0D) 59 void ( *
_db_msg )( UARTn_Type* UARTx,
const void* s );
60 void ( *
_db_msg_ )( UARTn_Type* UARTx,
const void* s );
61 void ( *
_db_char )( UARTn_Type* UARTx, uint8_t ch );
62 void ( *
_db_dec )( UARTn_Type* UARTx, uint8_t decn );
63 void ( *
_db_dec_16 )( UARTn_Type* UARTx, uint16_t decn );
64 void ( *
_db_dec_32 )( UARTn_Type* UARTx, uint32_t decn );
65 void ( *
_db_hex )( UARTn_Type* UARTx, uint8_t hexn );
66 void ( *
_db_hex_16 )( UARTn_Type* UARTx, uint16_t hexn );
67 void ( *
_db_hex_32 )( UARTn_Type* UARTx, uint32_t hexn );
69 uint8_t ( *
_db_get_ch )( UARTn_Type* UARTx, uint8_t* ch );
136 if( !( UARTx->LSR & UARTn_LSR_RDR ) )
157 void UARTPuts( UARTn_Type* UARTx,
const void* str )
159 uint8_t* s = ( uint8_t* )str;
193 uint8_t c1 = decnum % 10;
194 uint8_t c2 = ( decnum / 10 ) % 10;
195 uint8_t c3 = ( decnum / 100 ) % 10;
213 uint8_t c1 = decnum % 10;
214 uint8_t c2 = ( decnum / 10 ) % 10;
215 uint8_t c3 = ( decnum / 100 ) % 10;
216 uint8_t c4 = ( decnum / 1000 ) % 10;
217 uint8_t c5 = ( decnum / 10000 ) % 10;
237 uint8_t c1 = decnum % 10;
238 uint8_t c2 = ( decnum / 10 ) % 10;
239 uint8_t c3 = ( decnum / 100 ) % 10;
240 uint8_t c4 = ( decnum / 1000 ) % 10;
241 uint8_t c5 = ( decnum / 10000 ) % 10;
242 uint8_t c6 = ( decnum / 100000 ) % 10;
243 uint8_t c7 = ( decnum / 1000000 ) % 10;
244 uint8_t
c8 = ( decnum / 10000000 ) % 10;
245 uint8_t c9 = ( decnum / 100000000 ) % 10;
246 uint8_t c10 = ( decnum / 1000000000 ) % 10;
276 nibble = ( hexnum >> ( 4 * i ) ) & 0x0F;
277 UARTPutChar( UARTx, ( nibble > 9 ) ? (
'A' + nibble - 10 ) : (
'0' + nibble ) );
297 nibble = ( hexnum >> ( 4 * i ) ) & 0x0F;
298 UARTPutChar( UARTx, ( nibble > 9 ) ? (
'A' + nibble - 10 ) : (
'0' + nibble ) );
318 nibble = ( hexnum >> ( 4 * i ) ) & 0x0F;
319 UARTPutChar( UARTx, ( nibble > 9 ) ? (
'A' + nibble - 10 ) : (
'0' + nibble ) );
331 char buffer[512 + 1];
334 va_start( vArgs, format );
335 vsprintf( (
char* )buffer, (
char const* )format, vArgs );
350 #if (USED_UART_DEBUG_PORT == 0) 359 #elif (USED_UART_DEBUG_PORT == 1) 380 HAL_UART_Init( ( UARTn_Type* )DEBUG_UART_PORT, &UARTn_Config );
410 if(
InCount == 0 && ch < 0x20 )
417 if( ch == ASCII_BACKSPACE )
423 if( ch == ASCII_CARRIAGE_RETURN )
void(* _db_hex_16)(UARTn_Type *UARTx, uint16_t hexn)
Contains all macro definitions and function prototypes support for pcu firmware library on A31G11x.
void(* _db_dec_32)(UARTn_Type *UARTx, uint32_t decn)
void UARTPutDec16(UARTn_Type *UARTx, uint16_t decnum)
Puts a decimal number to UART port.
void UARTPutDec(UARTn_Type *UARTx, uint8_t decnum)
Puts a decimal number to UART port.
Contains all macro definitions and function prototypes support for debug_frmwrk firmware library on A...
void(* _db_dec_16)(UARTn_Type *UARTx, uint16_t decn)
HAL_Status_Type HAL_UART_ConfigStructInit(UARTn_CFG_Type *UARTn_Config)
Fills each UARTn_Config member with its default value:
uint8_t UARTGetCh(UARTn_Type *UARTx, uint8_t *ch)
Get a character to UART port.
void(* _db_msg_)(UARTn_Type *UARTx, const void *s)
void(* _db_hex)(UARTn_Type *UARTx, uint8_t hexn)
void HAL_GPIO_ConfigOutput(Pn_Type *Px, uint8_t pin_no, PCU_PORT_MODE dir_type)
Configure pin mode.
void(* _db_msg)(UARTn_Type *UARTx, const void *s)
void HAL_GPIO_ConfigFunction(Pn_Type *Px, uint8_t pin_no, uint32_t func)
Configure pin function.
void UARTPutHex(UARTn_Type *UARTx, uint8_t hexnum)
Puts a hex number to UART port.
void UARTPutHex32(UARTn_Type *UARTx, uint32_t hexnum)
Puts a hex number to UART port.
void debug_frmwrk_init(void)
Initializes Debug Framework through initializing UARTn.
void cprintf(const char *format,...)
print function that supports format as same as printf() function of <stdio.h> library
void UARTPutDec32(UARTn_Type *UARTx, uint32_t decnum)
Puts a decimal number to UART port.
FlagStatus HAL_UART_CheckBusy(UARTn_Type *UARTx)
Check whether if UART is busy or not.
uint8_t HAL_UART_ReceiveByte(UARTn_Type *UARTx)
Receive a single data from UART peripheral.
uint32_t HAL_UART_Transmit(UARTn_Type *UARTx, uint8_t *txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag)
Send a block of data via UART peripheral.
void UARTPuts(UARTn_Type *UARTx, const void *str)
Puts a string to UART port.
uint32_t HAL_UART_Receive(UARTn_Type *UARTx, uint8_t *rxbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag)
Receive a block of data via UART peripheral.
void(* _db_dec)(UARTn_Type *UARTx, uint8_t decn)
uint8_t(* _db_get_ch)(UARTn_Type *UARTx, uint8_t *ch)
uint8_t getstring(void)
Get a character to UART port.
void UARTPuts_(UARTn_Type *UARTx, const void *str)
Puts a string to UART port and print new line.
uint8_t UARTGetChar(UARTn_Type *UARTx)
Get a character to UART port.
void(* _db_char)(UARTn_Type *UARTx, uint8_t ch)
HAL_Status_Type HAL_UART_TransmitByte(UARTn_Type *UARTx, uint8_t Data)
Transmit a single data through UART peripheral.
int fputc(int ch, FILE *f)
Puts a character to file.
void UARTPutHex16(UARTn_Type *UARTx, uint16_t hexnum)
Puts a hex number to UART port.
void UARTPutChar(UARTn_Type *UARTx, uint8_t ch)
Puts a character to UART port.
HAL_Status_Type HAL_UART_Init(UARTn_Type *UARTx, UARTn_CFG_Type *UARTn_Config)
Initialize the UARTn peripheral with the specified parameters.
void(* _db_hex_32)(UARTn_Type *UARTx, uint32_t hexn)
uint8_t(* _db_get_char)(UARTn_Type *UARTx)