CuVoodoo STM32F1 firmware template
Functions
print.h File Reference

printing utilities to replace the large printf from the standard library (API) More...

Go to the source code of this file.

Functions

size_t putc (char c)
 print a single character on user output More...
 
size_t printf (const char *format,...)
 print format string on user output More...
 
size_t snprintf (char *str, size_t size, const char *format,...)
 print format string on string or user output More...
 

Detailed Description

printing utilities to replace the large printf from the standard library (API)

use % as format specifier prefix, followed by + to enforce sign of prefix, 0 and 0-9 for padding, and format specifier

format specifier supported are: c for char, s for string, u for uint32, d for int32, U for uint64, D for int64, x for lower case hex up to uint32, X for upper case hex up to uint32, b for bits up to uint32

Author
King Kévin kingk.nosp@m.evin.nosp@m.@cuvo.nosp@m.odoo.nosp@m..info
Date
2017

Definition in file print.h.

Function Documentation

◆ printf()

size_t printf ( const char *  format,
  ... 
)

print format string on user output

Parameters
[in]formatformat string to be printed
[in]...arguments referenced by format string to be printed
Returns
number of characters printed

Definition at line 296 of file print.c.

◆ putc()

size_t putc ( char  c)

print a single character on user output

Warning
this must be implemented by the user (using the desired output interface)
Parameters
[in]ccharacter to be printed
Returns
number of characters printed

Definition at line 136 of file main.c.

◆ snprintf()

size_t snprintf ( char *  str,
size_t  size,
const char *  format,
  ... 
)

print format string on string or user output

Parameters
[out]strstring to print format string on, or user output if str is set to NULL (str will always be terminated with a null character '\0')
[in,out]sizesize of string (writes at most size characters on str, including the termination null character '\0')
[in]formatformat string to be printed
[in]...arguments referenced by format string to be printed
Returns
number of characters printed (a return value of size or more means that the output was truncated)

Definition at line 306 of file print.c.