ATtiny85 Template Code
Code snippets for the ATtiny85
 All Files Functions Variables Typedefs Enumerations Enumerator Macros
uart_format.c File Reference
#include <stdarg.h>
#include <stdbool.h>
#include "../hardware.h"
#include "softuart.h"
Include dependency graph for uart_format.c:

Go to the source code of this file.

Functions

void uartFormat (const char *cszString,...)
 
void uartFormatP (const char *cszString,...)
 

Function Documentation

void uartFormat ( const char *  cszString,
  ... 
)

Print a formatted string from RAM

Prints a formatted string from RAM to the serial port. This function supports a subset of the 'printf' string formatting syntax. Allowable insertion types are:

%% - Display a % character. There should be no entry in the variable argument list for this entry. u - Display an unsigned integer in decimal. The matching argument may be any 16 bit value. x - Display an unsigned integer in hexadecimal. The matching argument may be any 16 bit value. c - Display a single ASCII character. The matching argument may be any 8 bit value. s - Display a NUL terminated string from RAM. The matching argument must be a pointer to a RAM location. S - Display a NUL terminated string from PROGMEM. The matching argument must be a pointer to a PROGMEM location.

Parameters
cszStringpointer to a nul terminated format string in RAM.

Definition at line 82 of file uart_format.c.

void uartFormatP ( const char *  cszString,
  ... 
)

Print a formatted string from PROGMEM

Prints a formatted string from PROGMEM to the serial port. This function supports a subset of the 'printf' string formatting syntax. Allowable insertion types are:

%% - Display a % character. There should be no entry in the variable argument list for this entry. u - Display an unsigned integer in decimal. The matching argument may be any 16 bit value. x - Display an unsigned integer in hexadecimal. The matching argument may be any 16 bit value. c - Display a single ASCII character. The matching argument may be any 8 bit value. s - Display a NUL terminated string from RAM. The matching argument must be a pointer to a RAM location. S - Display a NUL terminated string from PROGMEM. The matching argument must be a pointer to a PROGMEM location.

Parameters
cszStringpointer to a nul terminated format string in PROGMEM.

Definition at line 119 of file uart_format.c.