|
hex printing |
These functions allow you to print data that might contain non-printable characters. The output is in the standard hex output format, with hex representation on the left, and characters to the right. include "hex_output.h"
|
| #define | print_hexdump(buffer, size) print_hexdump_ex(buffer, size, 16) |
| | print a hexdump of buffer. This function prints 16 characters per line.
|
| void | print_hexdump_ex (const char *buffer, uint16_t size, uint16_t line_length) |
| | print a hexdump of a buffer.
|
printf |
| The printf function is similiar to the printf() function used in regular C programming, except that in this case the output is sent over the UART, meaning it is readable on a PC or other connected device.
This implementation does not support all formatting and has a few differences from the standard C function:
- use %C for 8-bit numbers. Example output: 255
- use %d for 16-bit numbers. Example output: 65535
- use %l for 32-bit numbers. Example output: 4294967295
- use %c for characters. Example output: a
- use %s for strings. Example output: hello world!
- use %b for binary. Example output: 00110001
- use %o for octal. Example output: 31
- use %h for hexadecimal. Example output: 3f
- use %x for hexadecimal. Example output: 0x3f
- padding and minumum width modifiers are supported. Example output: 00012
See src/apps/printf/test_printf.c for more examples.
Note: All numeric types are unsigned. printf does not support negative signed numbers.
|
| int | puts (const char *msg) |
| | print a non-formatted string.
|
| int | putchar (int character) |
| | print a single character.
|
| int | printf (const char *format,...) |
| | print a formatted string.
|
This module contains functions that allow a node attached to a PC to easily output data to the mos_shell. include "printf.h"