Improved version of Simon Ford's TextDisplay library, with addressing and timing fixes. Supports up to 20x4 text displays.
Terminal.h@0:2c5bba968d7c, 2010-02-14 (annotated)
- Committer:
- bikeNomad
- Date:
- Sun Feb 14 00:28:08 2010 +0000
- Revision:
- 0:2c5bba968d7c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bikeNomad | 0:2c5bba968d7c | 1 | /* mbed Terminal TextDisplay Library |
bikeNomad | 0:2c5bba968d7c | 2 | * Copyright (c) 2007-2009 sford |
bikeNomad | 0:2c5bba968d7c | 3 | * Released under the MIT License: http://mbed.org/license/mit |
bikeNomad | 0:2c5bba968d7c | 4 | * |
bikeNomad | 0:2c5bba968d7c | 5 | * Modified by Ned Konz |
bikeNomad | 0:2c5bba968d7c | 6 | * to add baud rate setting |
bikeNomad | 0:2c5bba968d7c | 7 | * |
bikeNomad | 0:2c5bba968d7c | 8 | * Implementation of a TextDisplay using a VT100 Terminal and |
bikeNomad | 0:2c5bba968d7c | 9 | * escape codes (e.g. Teraterm, Hyperterminal) |
bikeNomad | 0:2c5bba968d7c | 10 | */ |
bikeNomad | 0:2c5bba968d7c | 11 | |
bikeNomad | 0:2c5bba968d7c | 12 | #include "TextDisplay.h" |
bikeNomad | 0:2c5bba968d7c | 13 | |
bikeNomad | 0:2c5bba968d7c | 14 | #ifndef MBED_TERMINAL_H |
bikeNomad | 0:2c5bba968d7c | 15 | #define MBED_TERMINAL_H |
bikeNomad | 0:2c5bba968d7c | 16 | |
bikeNomad | 0:2c5bba968d7c | 17 | class Terminal : public TextDisplay { |
bikeNomad | 0:2c5bba968d7c | 18 | public: |
bikeNomad | 0:2c5bba968d7c | 19 | |
bikeNomad | 0:2c5bba968d7c | 20 | Terminal(PinName tx, PinName rx); |
bikeNomad | 0:2c5bba968d7c | 21 | |
bikeNomad | 0:2c5bba968d7c | 22 | virtual void character(uint16_t column, uint16_t row, int c); |
bikeNomad | 0:2c5bba968d7c | 23 | virtual uint16_t rows(); |
bikeNomad | 0:2c5bba968d7c | 24 | virtual uint16_t columns(); |
bikeNomad | 0:2c5bba968d7c | 25 | |
bikeNomad | 0:2c5bba968d7c | 26 | virtual void cls(); |
bikeNomad | 0:2c5bba968d7c | 27 | virtual void foreground(uint32_t colour); |
bikeNomad | 0:2c5bba968d7c | 28 | virtual void background(uint32_t colour); |
bikeNomad | 0:2c5bba968d7c | 29 | virtual void baud(uint16_t newbaud) { _serial.baud(newbaud); } |
bikeNomad | 0:2c5bba968d7c | 30 | |
bikeNomad | 0:2c5bba968d7c | 31 | protected: |
bikeNomad | 0:2c5bba968d7c | 32 | |
bikeNomad | 0:2c5bba968d7c | 33 | Serial _serial; |
bikeNomad | 0:2c5bba968d7c | 34 | |
bikeNomad | 0:2c5bba968d7c | 35 | }; |
bikeNomad | 0:2c5bba968d7c | 36 | |
bikeNomad | 0:2c5bba968d7c | 37 | #endif |