#include <stdarg.h>
#include <stdlib.h>
#include "fsl_debug_console_conf.h"
#include "fsl_str.h"
#include "fsl_common.h"
#include "serial_manager.h"
#include "fsl_debug_console.h"
Go to the source code of this file.
Classes | |
struct | _debug_console_state_struct |
Macros | |
#define | DEBUG_CONSOLE_BACKSPACE 127U |
character backspace ASCII value More... | |
#define | DEBUG_CONSOLE_CREATE_BINARY_SEMAPHORE(binary) |
#define | DEBUG_CONSOLE_CREATE_MUTEX_SEMAPHORE(mutex) |
#define | DEBUG_CONSOLE_DESTROY_BINARY_SEMAPHORE(binary) |
#define | DEBUG_CONSOLE_DESTROY_MUTEX_SEMAPHORE(mutex) |
#define | DEBUG_CONSOLE_FUNCTION_PREFIX |
#define | DEBUG_CONSOLE_GIVE_BINARY_SEMAPHORE_FROM_ISR(binary) |
#define | DEBUG_CONSOLE_GIVE_MUTEX_SEMAPHORE(mutex) |
#define | DEBUG_CONSOLE_TAKE_BINARY_SEMAPHORE_BLOCKING(binary) |
#define | DEBUG_CONSOLE_TAKE_MUTEX_SEMAPHORE_BLOCKING(mutex) |
#define | DEBUG_CONSOLE_TAKE_MUTEX_SEMAPHORE_NONBLOCKING(mutex, result) (result = 1U) |
#define | IS_RUNNING_IN_ISR() __get_IPSR() |
get current runing environment is ISR or not More... | |
Typedefs | |
typedef struct _debug_console_state_struct | debug_console_state_struct_t |
Functions | |
int | DbgConsole_BlockingPrintf (const char *formatString,...) |
Writes formatted output to the standard output stream with the blocking mode. More... | |
status_t | DbgConsole_Deinit (void) |
De-initializes the peripheral used for debug messages. More... | |
DEBUG_CONSOLE_FUNCTION_PREFIX status_t | DbgConsole_Flush (void) |
Debug console flush. More... | |
int | DbgConsole_Getchar (void) |
Reads a character from standard input. More... | |
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... | |
static void | DbgConsole_PrintCallback (char *buf, int32_t *indicator, char dbgVal, int len) |
This is a printf call back function which is used to relocate the log to buffer or print the log immediately when the local buffer is full. 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_ReadCharacter (uint8_t *ch) |
int | DbgConsole_ReadLine (uint8_t *buf, size_t size) |
status_t | DbgConsole_ReadOneCharacter (uint8_t *ch) |
int | DbgConsole_Scanf (char *formatString,...) |
Reads formatted data from the standard input stream. More... | |
int | DbgConsole_SendData (uint8_t *ch, size_t size) |
int | DbgConsole_SendDataReliable (uint8_t *ch, size_t size) |
Variables | |
serial_handle_t | g_serialHandle |
static volatile uint8_t | s_debugConsoleReadWaitSemaphore |
static debug_console_state_struct_t | s_debugConsoleState |
Debug console state information. More... | |
#define DEBUG_CONSOLE_BACKSPACE 127U |
character backspace ASCII value
Definition at line 75 of file fsl_debug_console.c.
#define DEBUG_CONSOLE_CREATE_BINARY_SEMAPHORE | ( | binary | ) |
Definition at line 168 of file fsl_debug_console.c.
#define DEBUG_CONSOLE_CREATE_MUTEX_SEMAPHORE | ( | mutex | ) |
Definition at line 162 of file fsl_debug_console.c.
#define DEBUG_CONSOLE_DESTROY_BINARY_SEMAPHORE | ( | binary | ) |
Definition at line 169 of file fsl_debug_console.c.
#define DEBUG_CONSOLE_DESTROY_MUTEX_SEMAPHORE | ( | mutex | ) |
Definition at line 163 of file fsl_debug_console.c.
#define DEBUG_CONSOLE_FUNCTION_PREFIX |
Definition at line 69 of file fsl_debug_console.c.
#define DEBUG_CONSOLE_GIVE_BINARY_SEMAPHORE_FROM_ISR | ( | binary | ) |
Definition at line 181 of file fsl_debug_console.c.
#define DEBUG_CONSOLE_GIVE_MUTEX_SEMAPHORE | ( | mutex | ) |
Definition at line 165 of file fsl_debug_console.c.
#define DEBUG_CONSOLE_TAKE_BINARY_SEMAPHORE_BLOCKING | ( | binary | ) |
Definition at line 180 of file fsl_debug_console.c.
#define DEBUG_CONSOLE_TAKE_MUTEX_SEMAPHORE_BLOCKING | ( | mutex | ) |
Definition at line 164 of file fsl_debug_console.c.
#define DEBUG_CONSOLE_TAKE_MUTEX_SEMAPHORE_NONBLOCKING | ( | mutex, | |
result | |||
) | (result = 1U) |
Definition at line 166 of file fsl_debug_console.c.
#define IS_RUNNING_IN_ISR | ( | ) | __get_IPSR() |
get current runing environment is ISR or not
Definition at line 99 of file fsl_debug_console.c.
typedef struct _debug_console_state_struct debug_console_state_struct_t |
|
static |
This is a printf call back function which is used to relocate the log to buffer or print the log immediately when the local buffer is full.
[in] | buf | Buffer to store log. |
[in] | indicator | Buffer index. |
[in] | val | Target character to store. |
[in] | len | length of the character |
Definition at line 648 of file fsl_debug_console.c.
int DbgConsole_ReadCharacter | ( | uint8_t * | ch | ) |
Definition at line 615 of file fsl_debug_console.c.
int DbgConsole_ReadLine | ( | uint8_t * | buf, |
size_t | size | ||
) |
Definition at line 555 of file fsl_debug_console.c.
status_t DbgConsole_ReadOneCharacter | ( | uint8_t * | ch | ) |
Definition at line 341 of file fsl_debug_console.c.
int DbgConsole_SendData | ( | uint8_t * | ch, |
size_t | size | ||
) |
Definition at line 412 of file fsl_debug_console.c.
int DbgConsole_SendDataReliable | ( | uint8_t * | ch, |
size_t | size | ||
) |
Definition at line 479 of file fsl_debug_console.c.
|
static |
Definition at line 88 of file fsl_debug_console.c.
|
static |
Debug console state information.
Definition at line 227 of file fsl_debug_console.c.