Macros | |
#define | DEBUGCONSOLE_DISABLE 2U |
#define | DEBUGCONSOLE_REDIRECT_TO_SDK 1U |
#define | DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN 0U |
Definition select redirect toolchain printf, scanf to uart or not. More... | |
#define | GETCHAR DbgConsole_Getchar |
#define | PRINTF DbgConsole_Printf |
Definition to select redirect toolchain printf, scanf to uart or not. More... | |
#define | PUTCHAR DbgConsole_Putchar |
#define | SCANF DbgConsole_Scanf |
#define | SDK_DEBUGCONSOLE 1U |
Definition to select sdk or toolchain printf, scanf. The macro only support to be redefined in project setting. More... | |
Typedefs | |
typedef void(* | printfCb) (char *buf, int32_t *indicator, char val, int len) |
A function pointer which is used when format printf log. More... | |
Functions | |
int | StrFormatPrintf (const char *fmt, va_list ap, char *buf, printfCb cb) |
This function outputs its parameters according to a formatted string. More... | |
int | StrFormatScanf (const char *line_ptr, char *format, va_list args_ptr) |
Converts an input line of ASCII characters based upon a provided string format. More... | |
Variables | |
serial_handle_t | g_serialHandle |
Initialization | |
status_t | DbgConsole_Init (uint8_t instance, uint32_t baudRate, serial_port_type_t device, uint32_t clkSrcFreq) |
Initializes the peripheral used for debug messages. More... | |
status_t | DbgConsole_Deinit (void) |
De-initializes the peripheral used for debug messages. More... | |
int | DbgConsole_Printf (const char *formatString,...) |
Writes formatted output to the standard output stream. More... | |
int | DbgConsole_Putchar (int ch) |
Writes a character to stdout. More... | |
int | DbgConsole_Scanf (char *formatString,...) |
Reads formatted data from the standard input stream. More... | |
int | DbgConsole_Getchar (void) |
Reads a character from standard input. More... | |
int | DbgConsole_BlockingPrintf (const char *formatString,...) |
Writes formatted output to the standard output stream with the blocking mode. More... | |
status_t | DbgConsole_Flush (void) |
Debug console flush. More... | |
#define DEBUGCONSOLE_DISABLE 2U |
Disable debugconsole function.
Definition at line 42 of file fsl_debug_console.h.
#define DEBUGCONSOLE_REDIRECT_TO_SDK 1U |
Select SDK version printf, scanf.
Definition at line 41 of file fsl_debug_console.h.
#define DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN 0U |
Definition select redirect toolchain printf, scanf to uart or not.
Select toolchain printf and scanf.
Definition at line 40 of file fsl_debug_console.h.
#define GETCHAR DbgConsole_Getchar |
Definition at line 79 of file fsl_debug_console.h.
#define PRINTF DbgConsole_Printf |
Definition to select redirect toolchain printf, scanf to uart or not.
if SDK_DEBUGCONSOLE defined to 0,it represents select toolchain printf, scanf. if SDK_DEBUGCONSOLE defined to 1,it represents select SDK version printf, scanf. if SDK_DEBUGCONSOLE defined to 2,it represents disable debugconsole function.
Definition at line 76 of file fsl_debug_console.h.
#define PUTCHAR DbgConsole_Putchar |
Definition at line 78 of file fsl_debug_console.h.
#define SCANF DbgConsole_Scanf |
Definition at line 77 of file fsl_debug_console.h.
#define SDK_DEBUGCONSOLE 1U |
Definition to select sdk or toolchain printf, scanf. The macro only support to be redefined in project setting.
Definition at line 48 of file fsl_debug_console.h.
typedef void(* printfCb) (char *buf, int32_t *indicator, char val, int len) |
int DbgConsole_BlockingPrintf | ( | const char * | formatString, |
... | |||
) |
Writes formatted output to the standard output stream with the blocking mode.
Call this function to write a formatted output to the standard output stream with the blocking mode. The function will send data with blocking mode no matter the DEBUG_CONSOLE_TRANSFER_NON_BLOCKING set or not. The function could be used in system ISR mode with DEBUG_CONSOLE_TRANSFER_NON_BLOCKING set.
formatString | Format control string. |
Definition at line 922 of file fsl_debug_console.c.
status_t DbgConsole_Deinit | ( | void | ) |
De-initializes the peripheral used for debug messages.
Call this function to disable debug log messages to be output via the specified peripheral initialized by the serial manager module.
Definition at line 801 of file fsl_debug_console.c.
status_t DbgConsole_Flush | ( | void | ) |
Debug console flush.
Call this function to wait the tx buffer empty. If interrupt transfer is using, make sure the global IRQ is enable before call this function This function should be called when 1, before enter power down mode 2, log is required to print to terminal immediately
Definition at line 838 of file fsl_debug_console.c.
int DbgConsole_Getchar | ( | void | ) |
Reads a character from standard input.
Call this function to read a character from standard input.
Definition at line 990 of file fsl_debug_console.c.
status_t DbgConsole_Init | ( | uint8_t | instance, |
uint32_t | baudRate, | ||
serial_port_type_t | device, | ||
uint32_t | clkSrcFreq | ||
) |
Initializes the peripheral used for debug messages.
Call this function to enable debug log messages to be output via the specified peripheral initialized by the serial manager module. After this function has returned, stdout and stdin are connected to the selected peripheral.
instance | The instance of the module. |
baudRate | The desired baud rate in bits per second. |
device | Low level device type for the debug console, can be one of the following.
|
clkSrcFreq | Frequency of peripheral source clock. |
kStatus_Success | Execution successfully |
Definition at line 670 of file fsl_debug_console.c.
int DbgConsole_Printf | ( | const char * | formatString, |
... | |||
) |
Writes formatted output to the standard output stream.
Call this function to write a formatted output to the standard output stream.
formatString | Format control string. |
Definition at line 877 of file fsl_debug_console.c.
int DbgConsole_Putchar | ( | int | ch | ) |
Writes a character to stdout.
Call this function to write a character to stdout.
ch | Character to be written. |
Definition at line 897 of file fsl_debug_console.c.
int DbgConsole_Scanf | ( | char * | formatString, |
... | |||
) |
Reads formatted data from the standard input stream.
Call this function to read formatted data from the standard input stream.
formatString | Format control string. |
Definition at line 904 of file fsl_debug_console.c.
int StrFormatPrintf | ( | const char * | fmt, |
va_list | ap, | ||
char * | buf, | ||
printfCb | cb | ||
) |
This function outputs its parameters according to a formatted string.
[in] | fmt | Format string for printf. |
[in] | ap | Arguments to printf. |
[in] | buf | pointer to the buffer |
cb | print callbck function pointer |
brief This function outputs its parameters according to a formatted string.
note I/O is performed by calling given function pointer using following (*func_ptr)(c);
param[in] fmt_ptr Format string for printf. param[in] args_ptr Arguments to printf. param[in] buf pointer to the buffer param cb print callback function pointer
return Number of characters to be print
int StrFormatScanf | ( | const char * | line_ptr, |
char * | format, | ||
va_list | args_ptr | ||
) |
Converts an input line of ASCII characters based upon a provided string format.
[in] | line_ptr | The input line of ASCII data. |
[in] | format | Format first points to the format string. |
[in] | args_ptr | The list of parameters. |
IO_EOF | When line_ptr is empty string "". |
brief Converts an input line of ASCII characters based upon a provided string format.
param[in] line_ptr The input line of ASCII data. param[in] format Format first points to the format string. param[in] args_ptr The list of parameters.
return Number of input items converted and assigned. retval IO_EOF When line_ptr is empty string "".
serial_handle_t g_serialHandle |
serial manager handle
Definition at line 229 of file fsl_debug_console.c.