/// \file syscalls-chario.c
/// \brief Sockpuppet API System Call functions for character IO
/// \defgroup SAPI Sockpuppet 
//! \addtogroup SAPI
//! @{
/// 
//
// Copyright(C) 2011-2014 Robert Sexton
//
// Change History.
// API Version 0203.  Add a return code to StreamPutChar for back-pressure.
// Re-organize the code to make it less machine specific.
// More advanced implementations will need to support both
// UARTs and USB and/or networked comms, so this is an intermediate layer
#include <stdint.h>

/// __SAPI_02_PutChar 
// The basic putchar, with backpressure.   The called function
// should return 0 if there is room for more, or -1 if the app should
// throttle the output.
void __SAPI_02_PutChar(uint32_t *frame) {
	if (frame[0] < 10 ) {
		putchar_uart(frame);
		}
	// Network ports go here.
	return;
	}	 

/// __SAPI_03_GetChar 
/// Pull a character out of the stream of choice
/// This gets called when CharsAvail says there is work to do.
void __SAPI_03_GetChar(long *frame) {
	if (frame[0] < 10 ) {
		getchar_uart(frame);
		}
	// Network ports go here.
	return;
	}
	
/// __SAPI_04_CharsAvail
/// Check to see if there is a char available
void __SAPI_04_CharsAvail(long *frame) {
	if (frame[0] < 10 ) {
		chars_available_uart(frame);
		}
	// Network ports go here.
	return;
	}	

Create a shim layer for platform-independent UARTs.
Create a shim layer for platform-independent UARTs.