Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

Printf Lite - Print formatted data to stdout


Files

file  otPrintfLite.h
 Printf Lite Library.

Modules

 Version History

Functions

void setStdout (U8 chan)
 Set the stdout channel on specified uart, Use UART0 or UART1.
void stdOutLF ()
int printf (const char *format,...)
int sprintf (char *out, const char *format,...)
 Composes a string with the same text that would be printed if format was used on printf,
but instead of being printed, the content is stored as a C string in the buffer pointed by out.

Detailed Description

Dependency: SERIAL - Procedure for serial usage

Function Documentation

int printf const char *  format,
  ...
 

Print formatted data to stdout. Printf like format function.
General format :
[width]type

  • width Is the minimum size of the field.
    Supported type :
  • s Null terminated string of char.
  • i Integer number.
  • d Integer number.
  • u Unsigned number.
  • x Unsigned number in hex.
  • X Unsigned number in hex upper case.
  • c Character
    Parameters:
    format C string that contains the text to be written to stdout.
    ... Arguments
    Returns:
    The number of char emitted.

void setStdout U8  chan  ) 
 

Parameters:
chan UartId

int sprintf char *  out,
const char *  format,
  ...
 

Parameters:
out Pointer to a buffer where the resulting C-string is stored. The buffer should be large enough to contain the resulting string.
format C string that contains a format string that follows the same specifications as format in printf (see printf for details).
... depending on the format string, the function may expect a sequence of additional arguments.
Returns:
On success, the total number of characters written is returned.

void stdOutLF  ) 
 

Send on standard out a line feed character.

footer

otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0