Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of DDRO_Farrari by
Diff: basic_io.h
- Revision:
- 10:95e9932f7990
diff -r cbb692f51e0f -r 95e9932f7990 basic_io.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/basic_io.h Tue Feb 25 02:14:41 2014 +0000 @@ -0,0 +1,36 @@ +/* + * A family of print and scan functions. + * + * Written by Zimin Wang. + */ + +#ifndef BASIC_IO_H +#define BASIC_IO_H + +#include <stdarg.h> +#include "jtag.h" + +// IO functions to read/write data from/to terminal to mbed program. +// These functions are used as a replacement to pc.printf() and pc.scanf() +extern int mbed_printf(const char *format, ...); +extern int mbed_scanf(const char *format,...); +extern int mbed_vprintf(const char *format, va_list args); +extern int mbed_vscanf(const char *format, va_list args); + +// IO functions to read from ram buffer within Cortex-M3 core and write to peripherals of the testboard, +// or read data from peripherals of the testboard and write them to the ram buffer of Cortex-M3 core. +// foo_printf below reads from ram buffer and write data to peripheral "foo". +// foo_scanf below reads from peripheral "foo" and write data to ram buffer. +extern int term_printf(JTAG *pJtag); +extern int term_scanf(JTAG *pJtag); +extern int xbee_printf(const char *format, ...); +extern int xbee_scanf(const char *format, ...); +extern int usb_printf(const char *format, ...); +extern int usb_scanf(const char *format, ...); +extern int inet_printf(const char *format, ...); +extern int inet_scanf(const char *format, ...); + +// read from ram buffer and print for debug use +extern void debug_print(JTAG *pJtag); + +#endif \ No newline at end of file
