MicroShellというライブラリのバッファ編集機能に惹かれて強引にSerialクラスっぽくラップしたもの
https://www.cubeatsystems.com/microshell/index.html 様に感謝 やっつけすぎて申し訳ないが技量が足りない...
Diff: MicroShell.h
- Revision:
- 0:ff53d8f5146a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MicroShell.h Thu Oct 19 07:39:57 2017 +0000 @@ -0,0 +1,21 @@ +#ifndef MICROSHELL_CLASS_H +#define MICROSHELL_CLASS_H + +#include "mbed.h" + +class MicroShell +{ +public: + MicroShell(PinName tx, PinName rx, int baud = 9600); + + void putc(int c); + void puts(const char *s); + int getc(); + char *gets(char *s, int size); + int printf(const char* format, ...); + int scanf( const char* format, ...); + int vprintf(const char* format, std::va_list args); + int vscanf( const char* format, std::va_list args); +}; + +#endif \ No newline at end of file