CuVoodoo STM32F1 firmware template
|
printing utilities to replace the large printf from the standard library (code) More...
Go to the source code of this file.
Functions | |
static void | print_printed (size_t *length, size_t printed) |
add printed length to total printed length, and sets error if maximum size is exceeded More... | |
static size_t | print_char (char **str, size_t *size, char c) |
print character More... | |
static size_t | print_string (char **str, size_t *size, const char *s) |
print string More... | |
static size_t | print_unsigned (char **str, size_t *size, uint64_t u, uint32_t padding, bool sign) |
print unsigned integer More... | |
static size_t | print_signed (char **str, size_t *size, int64_t d, uint32_t padding, bool sign) |
print signed integer More... | |
static size_t | print_float (char **str, size_t *size, double f, uint32_t padding, uint32_t fractional, bool sign) |
print floating number More... | |
static size_t | print_nibble (char **str, size_t *size, uint8_t nibble, bool upcase) |
print nibble (half-byte) More... | |
static size_t | print_hex (char **str, size_t *size, uint64_t hex, uint32_t padding, bool prefix, bool upcase) |
print hex value More... | |
static size_t | print_bits (char **str, size_t *size, uint64_t u, uint32_t padding, bool prefix) |
print bits More... | |
static size_t | vsnprintf (char **str, size_t *size, const char *format, va_list va) |
print format string on string or 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... | |
Variables | |
uint8_t | print_error |
flags to indicate which error(s) occurred within printf or snprintf | |
printing utilities to replace the large printf from the standard library (code)
Definition in file print.c.
|
static |
|
static |
|
static |
print floating number
[out] | str | string to print floating number on (use NULL to print on user output) |
[in,out] | size | size of string |
[in] | f | floating number to be printed |
[in] | padding | number of 0's to pad |
[in] | fractional | numbers of digits after the decimal point |
[in] | sign | if sign should be printed |
|
static |
print hex value
[out] | str | string to print hex on (use NULL to print on user output) |
[in,out] | size | size of string |
[in] | hex | hex value to be printed |
[in] | padding | number of 0's to pad |
[in] | prefix | if 0x prefix should be printed |
[in] | upcase | use upcase digits (A-F) |
|
static |
|
static |
|
static |
print signed integer
[out] | str | string to print signed integer on (use NULL to print on user output) |
[in,out] | size | size of string |
[in] | d | signed integer to be printed |
[in] | padding | number of 0's to pad |
[in] | sign | if sign should be printed |
|
static |
|
static |
print unsigned integer
[out] | str | string to print unsigned integer on (use NULL to print on user output) |
[in,out] | size | size of string |
[in] | u | unsigned integer to be printed |
[in] | padding | number of 0's to pad |
[in] | sign | if sign should be printed |
size_t printf | ( | const char * | format, |
... | |||
) |
size_t snprintf | ( | char * | str, |
size_t | size, | ||
const char * | format, | ||
... | |||
) |
print format string on string or user output
[out] | str | string 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] | size | size of string (writes at most size characters on str, including the termination null character '\0') |
[in] | format | format string to be printed |
[in] | ... | arguments referenced by format string to be printed |
|
static |
print format string on string or user output
[out] | str | string 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] | size | size of string (writes at most size characters on str, including the termination null character '\0') |
[in] | format | format string to be printed |
[in] | va | arguments referenced by format string to be printed |