Trident IoT SDK
Loading...
Searching...
No Matches

A simple printf utility for debug prints and cli support. More...

Collaboration diagram for Printf:

Macros

#define PRINTF_FLOAT_ENABLE   1
 Definition to enable float data type formatting Pass in to the build system with a value of 0 to disable.

Typedefs

typedef void(* putchar_cb) (char ch)
 Function pointer definition for put char callback.
typedef void(* putstr_cb) (const char *str, int len)
 Function pointer definition for put string callback.

Functions

void tr_printf_init (putchar_cb putc, putstr_cb puts)
 Initializes the printf utility.
void tr_vsprintf (char *buf, int maxlen, const char *fmt, const va_list args)
 Write formated data from variable argument list to string.
void tr_printf (const char *fmt,...)
 Writes the passed in C string to the standard output (stdout).

Detailed Description

A simple printf utility for debug prints and cli support.

Macro Definition Documentation

◆ PRINTF_FLOAT_ENABLE

#define PRINTF_FLOAT_ENABLE   1

Definition to enable float data type formatting Pass in to the build system with a value of 0 to disable.

Typedef Documentation

◆ putchar_cb

typedef void(* putchar_cb) (char ch)

Function pointer definition for put char callback.

◆ putstr_cb

typedef void(* putstr_cb) (const char *str, int len)

Function pointer definition for put string callback.

Function Documentation

◆ tr_printf()

void tr_printf ( const char * fmt,
... )

Writes the passed in C string to the standard output (stdout).

Parameters
[in]fmtC string that contains the text to be written to stdout.
[in]...Depends on the format string

◆ tr_printf_init()

void tr_printf_init ( putchar_cb putc,
putstr_cb puts )

Initializes the printf utility.

Parameters
[in]putcFunction pointer to a putc function used for writing a single byte.
[in]putsFunction pointer to a puts function used for writing a string of bytes.

◆ tr_vsprintf()

void tr_vsprintf ( char * buf,
int maxlen,
const char * fmt,
const va_list args )

Write formated data from variable argument list to string.

Parameters
[in]bufPointer to a buffer where the resulting C-string is stored. The buffer should be large enough to contain the resulting string.
[in]maxlenThe max len of the buffer.
[in]fmtA printf formatted C string.
[in]argsA value identifying a variable argument list initialized with va_start().