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.
Dependents: Fancy-Terminal-Menu Fancy-Terminal
SerialTerminal.h
00001 #include "mbed.h" 00002 00003 #ifndef MBED_TERMINAL_H 00004 #define MBED_TERMINAL_H 00005 00006 /** Control and display on an ANSI/VT100 Terminal (puTTy or similar...) 00007 * 00008 * This allows you to control an ANSI serial terminal 00009 * Set TX pin and RX . also spesify bauderate if needed different than default 9600 00010 */ 00011 class SerialTerminal : public Serial { 00012 public: 00013 /** Create the Terminal interface 00014 * 00015 * @param tx Serial transmit 00016 * @param rx Serial recieve 00017 * @param baud Serial baudreate speed (default 9600) 00018 */ 00019 SerialTerminal(PinName tx, PinName rx, int baudrate=9600); 00020 00021 #if DOXYGEN_ONLY 00022 /** Write a character to the terminal 00023 * 00024 * @param c The character to write to the display 00025 */ 00026 int putc(int c); 00027 00028 /** Write a formated string to the terminal 00029 * 00030 * @param format A printf-style format string, followed by the 00031 * variables to use in formating the string. 00032 */ 00033 int printf(const char* format, ...); 00034 00035 // also baud etc 00036 #endif 00037 00038 /** Locate to a screen column and row 00039 * 00040 * @param column The horizontal position from the left, indexed from 0 00041 * @param row The vertical position from the top, indexed from 0 00042 */ 00043 void locate(int column, int row); 00044 00045 /** Clear the screen and locate to 0,0 */ 00046 void cls(); 00047 00048 /** Set the foreground colour */ 00049 void foreground(int colour); 00050 00051 /** Set the background colour */ 00052 void background(int colour); 00053 00054 /** Hide Cursor from terminal*/ 00055 void hideCursor(); 00056 00057 /** Hide Cursor from terminal*/ 00058 void showCursor(); 00059 }; 00060 00061 #endif
Generated on Wed Jul 20 2022 02:15:49 by
1.7.2