Differential pressure meter

Dependencies:   TFT_Touch_WaveShare

Committer:
igbt6
Date:
Tue Apr 03 20:13:35 2018 +0000
Revision:
1:c311d5f59c8b
Parent:
0:619824763516
Differential pressure meter

Who changed what in which revision?

UserRevisionLine numberNew contents of line
igbt6 0:619824763516 1 /* mbed TextDisplay Library Base Class
igbt6 0:619824763516 2 * Copyright (c) 2007-2009 sford
igbt6 0:619824763516 3 * Released under the MIT License: http://mbed.org/license/mit
igbt6 0:619824763516 4 *
igbt6 0:619824763516 5 * A common base class for Text displays
igbt6 0:619824763516 6 * To port a new display, derive from this class and implement
igbt6 0:619824763516 7 * the constructor (setup the display), character (put a character
igbt6 0:619824763516 8 * at a location), rows and columns (number of rows/cols) functions.
igbt6 0:619824763516 9 * Everything else (locate, printf, putc, cls) will come for free
igbt6 0:619824763516 10 *
igbt6 0:619824763516 11 * The model is the display will wrap at the right and bottom, so you can
igbt6 0:619824763516 12 * keep writing and will always get valid characters. The location is
igbt6 0:619824763516 13 * maintained internally to the class to make this easy
igbt6 0:619824763516 14 */
igbt6 0:619824763516 15
igbt6 0:619824763516 16 #ifndef MBED_TEXTDISPLAY_H
igbt6 0:619824763516 17 #define MBED_TEXTDISPLAY_H
igbt6 0:619824763516 18
igbt6 0:619824763516 19 #include "mbed.h"
igbt6 0:619824763516 20
igbt6 0:619824763516 21 class TextDisplay : public Stream {
igbt6 0:619824763516 22 public:
igbt6 0:619824763516 23
igbt6 0:619824763516 24 // functions needing implementation in derived implementation class
igbt6 0:619824763516 25 /** Create a TextDisplay interface
igbt6 0:619824763516 26 *
igbt6 0:619824763516 27 * @param name The name used in the path to access the strean through the filesystem
igbt6 0:619824763516 28 */
igbt6 0:619824763516 29 TextDisplay(const char *name = NULL);
igbt6 0:619824763516 30
igbt6 0:619824763516 31 /** output a character at the given position
igbt6 0:619824763516 32 *
igbt6 0:619824763516 33 * @param column column where charater must be written
igbt6 0:619824763516 34 * @param row where character must be written
igbt6 0:619824763516 35 * @param c the character to be written to the TextDisplay
igbt6 0:619824763516 36 */
igbt6 0:619824763516 37 virtual void character(int column, int row, int c) = 0;
igbt6 0:619824763516 38
igbt6 0:619824763516 39 /** return number if rows on TextDisplay
igbt6 0:619824763516 40 * @result number of rows
igbt6 0:619824763516 41 */
igbt6 0:619824763516 42 virtual int rows() = 0;
igbt6 0:619824763516 43
igbt6 0:619824763516 44 /** return number if columns on TextDisplay
igbt6 0:619824763516 45 * @result number of rows
igbt6 0:619824763516 46 */
igbt6 0:619824763516 47 virtual int columns() = 0;
igbt6 0:619824763516 48
igbt6 0:619824763516 49 // functions that come for free, but can be overwritten
igbt6 0:619824763516 50
igbt6 0:619824763516 51 /** redirect output from a stream (stoud, sterr) to display
igbt6 0:619824763516 52 * @param stream stream that shall be redirected to the TextDisplay
igbt6 0:619824763516 53 */
igbt6 0:619824763516 54 virtual bool claim (FILE *stream);
igbt6 0:619824763516 55
igbt6 0:619824763516 56 /** clear screen
igbt6 0:619824763516 57 */
igbt6 0:619824763516 58 virtual void cls();
igbt6 0:619824763516 59 virtual void locate(int column, int row);
igbt6 0:619824763516 60 virtual void foreground(uint16_t colour);
igbt6 0:619824763516 61 virtual void background(uint16_t colour);
igbt6 0:619824763516 62 // putc (from Stream)
igbt6 0:619824763516 63 // printf (from Stream)
igbt6 0:619824763516 64
igbt6 0:619824763516 65 protected:
igbt6 0:619824763516 66
igbt6 0:619824763516 67 virtual int _putc(int value);
igbt6 0:619824763516 68 virtual int _getc();
igbt6 0:619824763516 69
igbt6 0:619824763516 70 // character location
igbt6 0:619824763516 71 uint16_t _column;
igbt6 0:619824763516 72 uint16_t _row;
igbt6 0:619824763516 73
igbt6 0:619824763516 74 // colours
igbt6 0:619824763516 75 uint16_t _foreground;
igbt6 0:619824763516 76 uint16_t _background;
igbt6 0:619824763516 77 char *_path;
igbt6 0:619824763516 78 };
igbt6 0:619824763516 79
igbt6 0:619824763516 80 #endif