//this is the header file to use together with the __io_putchar.a library
// (use this library by selecting "options"->"Project"->"LD-ARM"->"UART0 putchar")

//it alows to use the UART0 as stdin and stdout
// and get rid of the file management stuff, which is useless in embedded devices

//standard stdio includes
#include <stdio.h> 

//we want to use the functions putchar and getchar
// and not some big machinery with stdout and stdin
#ifdef putchar
#undef putchar
#endif

#ifdef getchar
#undef getchar
#endif

//we could leave putchar=putchar but the following lines prevent errors in case 
// stdio.h is included again later in the compilation.
//also, this is a little faster. (by one function call and return)
#define putchar __io_putchar
#define getchar __io_getchar


//call this to reinit the UART after a clock reconfiguration
extern void __io_init( void );

//call this to tell the library what is the frequency of the main oscillator.
// default values are good for the REva board. (40000000 for STR71x ad 8000000 for STR730)
extern void __io_SetMainOscFreq( unsigned int NewFreq );



