Support library for the ESP8266 Wireless Terminal. Can also be used for communicating with any VT100-compatible terminal.
Diff: espterm.hpp
- Revision:
- 6:7e7550084e5f
- Parent:
- 5:7379bd37f3e2
- Child:
- 7:63d903b6ca9b
--- a/espterm.hpp Sun Mar 19 18:16:17 2017 +0000 +++ b/espterm.hpp Sun Mar 19 19:51:21 2017 +0000 @@ -281,6 +281,15 @@ /** + * @brief Move cursor relatively to the current position + * + * @param dy - vertical offset (positive = down) + * @param dx - horizontal offset (positive = right) + */ + void move(int dy, int dx); + + + /** * @brief Clear screen * * Replace part of the screen with spaces (ASCII 32) of the currently @@ -309,6 +318,17 @@ /** + * @brief Scroll the screen up or down. + * + * Moves the screen content in the specified direction, replacing the + * vacated lines with spaces (32) of the current colors. + * + * @param lines - number of lines, positive = down, negative = up. + */ + void scroll(int lines); + + + /** * @brief Set cursor visibility * * If hidden, there will be no blinking square on the screen, @@ -319,6 +339,30 @@ void show_cursor(bool yes); + /** + * @brief Push the cursor (there's only one slot) + * + * @param with_attribs - store also the colors and attributes + */ + void cursor_push(bool with_attribs=true); + + + /** + * @brief Pop the cursor (if stored) + * + * @param with_attribs - restore also the colors and attributes + */ + void cursor_pop(bool with_attribs=true); + + + /** + * @brief Enable or disable wrapping at EOL (and automatic scrolling) + * + * @param yes - enable wrap + */ + void wrap_enable(bool yes); + + // ----- System cmds ----- @@ -347,7 +391,7 @@ /** - * Clear the Device OK flag + * @brief Clear the Device OK flag */ void clear_status(void) { @@ -356,13 +400,13 @@ /** - * Query device status, clears "device_ok" and it'll be set by - * the response message. + * @brief Query device status. * * To use the query function, call clear_status() first, and then poll * query_status() with some delays in between. * - * @return the status flag, from a previous query + * @return the status flag from a previous query; + * if true, does not send another query, and just returns. */ bool query_status(void); };