![]() |
NUC472_NUC442_BSP V3.03.004
The Board Support Package for NUC472/NUC442
|
NUC472/NUC442 Debug Port and Semihost Setting Source File. More...
Go to the source code of this file.
Macros | |
#define | DEBUG_PORT UART0 |
Enumerations | |
enum | { r0 , r1 , r2 , r3 , r12 , lr , pc , psr } |
Functions | |
static void | stackDump (uint32_t stack[]) |
Helper function to dump register while hard fault occurred. More... | |
void | Hard_Fault_Handler (uint32_t stack[]) |
Hard fault handler. More... | |
__asm int32_t | HardFault_Handler (void) |
This HardFault handler is implemented to show r0, r1, r2, r3, r12, lr, pc, psr. More... | |
void | SendChar_ToUART (int ch) |
Write a char to UART. More... | |
void | SendChar (int ch) |
Write a char to debug console. More... | |
char | GetChar (void) |
Read a char from debug console. More... | |
int | kbhit (void) |
Check whether UART receive FIFO is empty or not. More... | |
int | IsDebugFifoEmpty (void) |
Check whether UART transmit FIFO is empty or not. More... | |
void | _ttywrch (int ch) |
C library retargetting. More... | |
int | fputc (int ch, FILE *stream) |
Write character to stream. More... | |
int | fgetc (FILE *stream) |
Get character from UART debug port or semihosting input. More... | |
int | ferror (FILE *stream) |
Check error indicator. More... | |
Variables | |
FILE | __stdout |
FILE | __stdin |
NUC472/NUC442 Debug Port and Semihost Setting Source File.
Definition in file retarget.c.
#define DEBUG_PORT UART0 |
Definition at line 385 of file retarget.c.
anonymous enum |
Enumerator | |
---|---|
r0 | |
r1 | |
r2 | |
r3 | |
r12 | |
lr | |
pc | |
psr |
Definition at line 41 of file retarget.c.
void _ttywrch | ( | int | ch | ) |
C library retargetting.
ch | Character to send out |
Check if message finished (FIFO empty of debug port)
Definition at line 511 of file retarget.c.
int ferror | ( | FILE * | stream | ) |
Check error indicator.
[in] | stream | Pointer to a FILE object that identifies the stream. |
Checks if the error indicator associated with stream is set, returning a value different from zero if it is. This indicator is generally set by a previous operation on the stream that failed.
Definition at line 586 of file retarget.c.
int fgetc | ( | FILE * | stream | ) |
Get character from UART debug port or semihosting input.
[in] | stream | Pointer to a FILE object that identifies the stream on which the operation is to be performed. |
For get message from debug port or semihosting.
Definition at line 572 of file retarget.c.
int fputc | ( | int | ch, |
FILE * | stream | ||
) |
Write character to stream.
[in] | ch | Character to be written. The character is passed as its int promotion. |
[in] | stream | Pointer to a FILE object that identifies the stream where the character is to be written. |
Writes a character to the stream and advances the position indicator.
The character is written at the current position of the stream as indicated
by the internal position indicator, which is then advanced one character.
Definition at line 559 of file retarget.c.
char GetChar | ( | void | ) |
Read a char from debug console.
None |
Definition at line 439 of file retarget.c.
void Hard_Fault_Handler | ( | uint32_t | stack[] | ) |
Hard fault handler.
[in] | stack | pointer points to the dumped registers in SRAM |
Definition at line 66 of file retarget.c.
__asm int32_t HardFault_Handler | ( | void | ) |
This HardFault handler is implemented to show r0, r1, r2, r3, r12, lr, pc, psr.
None |
This function is implement to print r0, r1, r2, r3, r12, lr, pc, psr
Definition at line 365 of file retarget.c.
int IsDebugFifoEmpty | ( | void | ) |
Check whether UART transmit FIFO is empty or not.
None |
1 | UART Tx FIFO is empty |
0 | UART Tx FIFO is not empty |
Definition at line 495 of file retarget.c.
int kbhit | ( | void | ) |
Check whether UART receive FIFO is empty or not.
None |
1 | Indicates at least one character is available in UART Rx FIFO |
0 | UART Rx FIFO is empty |
Definition at line 479 of file retarget.c.
void SendChar | ( | int | ch | ) |
Write a char to debug console.
ch | The character sent to debug console |
Definition at line 409 of file retarget.c.
void SendChar_ToUART | ( | int | ch | ) |
Write a char to UART.
ch | The character sent to UART. |
Definition at line 392 of file retarget.c.
|
static |
Helper function to dump register while hard fault occurred.
[in] | stack | pointer points to the dumped registers in SRAM |
Definition at line 48 of file retarget.c.
FILE __stdin |
Definition at line 39 of file retarget.c.
FILE __stdout |
Definition at line 38 of file retarget.c.