Laser cutter software
Dependencies: EthernetNetIf mbed SDFileSystem
LaosDisplay/LaosDisplay.h@0:18ead85c200b, 2011-08-11 (annotated)
- Committer:
- pbrier
- Date:
- Thu Aug 11 09:33:15 2011 +0000
- Revision:
- 0:18ead85c200b
Laos server
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pbrier | 0:18ead85c200b | 1 | /** |
pbrier | 0:18ead85c200b | 2 | * LaosDisplay.cpp |
pbrier | 0:18ead85c200b | 3 | * User interface class, for 2x16 display and keypad |
pbrier | 0:18ead85c200b | 4 | * |
pbrier | 0:18ead85c200b | 5 | * Copyright (c) 2011 Peter Brier |
pbrier | 0:18ead85c200b | 6 | * |
pbrier | 0:18ead85c200b | 7 | * This file is part of the LaOS project (see: http://wiki.protospace.nl/index.php/LaOS) |
pbrier | 0:18ead85c200b | 8 | * |
pbrier | 0:18ead85c200b | 9 | * LaOS is free software: you can redistribute it and/or modify |
pbrier | 0:18ead85c200b | 10 | * it under the terms of the GNU General Public License as published by |
pbrier | 0:18ead85c200b | 11 | * the Free Software Foundation, either version 3 of the License, or |
pbrier | 0:18ead85c200b | 12 | * (at your option) any later version. |
pbrier | 0:18ead85c200b | 13 | * |
pbrier | 0:18ead85c200b | 14 | * LaOS is distributed in the hope that it will be useful, |
pbrier | 0:18ead85c200b | 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
pbrier | 0:18ead85c200b | 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
pbrier | 0:18ead85c200b | 17 | * GNU General Public License for more details. |
pbrier | 0:18ead85c200b | 18 | * |
pbrier | 0:18ead85c200b | 19 | * You should have received a copy of the GNU General Public License |
pbrier | 0:18ead85c200b | 20 | * along with LaOS. If not, see <http://www.gnu.org/licenses/>. |
pbrier | 0:18ead85c200b | 21 | * |
pbrier | 0:18ead85c200b | 22 | * Assume (USB) serial connected display (or terminal) in future, this could be CAN or I2C connected |
pbrier | 0:18ead85c200b | 23 | * |
pbrier | 0:18ead85c200b | 24 | */ |
pbrier | 0:18ead85c200b | 25 | #ifndef _LAOS_DISPLAY_H_ |
pbrier | 0:18ead85c200b | 26 | #define _LAOS_DISPLAY_H_ |
pbrier | 0:18ead85c200b | 27 | #include "global.h" |
pbrier | 0:18ead85c200b | 28 | |
pbrier | 0:18ead85c200b | 29 | /** LaosDisplay |
pbrier | 0:18ead85c200b | 30 | * Connect to LCD terminal or PC |
pbrier | 0:18ead85c200b | 31 | * Example: |
pbrier | 0:18ead85c200b | 32 | * @code |
pbrier | 0:18ead85c200b | 33 | * @endcode |
pbrier | 0:18ead85c200b | 34 | */ |
pbrier | 0:18ead85c200b | 35 | class LaosDisplay { |
pbrier | 0:18ead85c200b | 36 | public: |
pbrier | 0:18ead85c200b | 37 | /** Make new LaosDisplay object. |
pbrier | 0:18ead85c200b | 38 | */ |
pbrier | 0:18ead85c200b | 39 | LaosDisplay(); |
pbrier | 0:18ead85c200b | 40 | |
pbrier | 0:18ead85c200b | 41 | /** Display string at position (x,y) |
pbrier | 0:18ead85c200b | 42 | * @param x x position in characters (zero based) |
pbrier | 0:18ead85c200b | 43 | * @param y y position in characters (zero based) |
pbrier | 0:18ead85c200b | 44 | * @param s The string to display |
pbrier | 0:18ead85c200b | 45 | */ |
pbrier | 0:18ead85c200b | 46 | void write(char *s); |
pbrier | 0:18ead85c200b | 47 | void write(char c); |
pbrier | 0:18ead85c200b | 48 | void ShowScreen(const char *l, int *arg, char *s); |
pbrier | 0:18ead85c200b | 49 | |
pbrier | 0:18ead85c200b | 50 | |
pbrier | 0:18ead85c200b | 51 | /** Clear screen |
pbrier | 0:18ead85c200b | 52 | */ |
pbrier | 0:18ead85c200b | 53 | void cls(); |
pbrier | 0:18ead85c200b | 54 | |
pbrier | 0:18ead85c200b | 55 | /** Read key value. (non blocking) |
pbrier | 0:18ead85c200b | 56 | * @return (ASCII) character value, zero if no character is available |
pbrier | 0:18ead85c200b | 57 | */ |
pbrier | 0:18ead85c200b | 58 | int read(); |
pbrier | 0:18ead85c200b | 59 | |
pbrier | 0:18ead85c200b | 60 | private: |
pbrier | 0:18ead85c200b | 61 | Serial *serial; |
pbrier | 0:18ead85c200b | 62 | }; |
pbrier | 0:18ead85c200b | 63 | |
pbrier | 0:18ead85c200b | 64 | #define K_UP '8' |
pbrier | 0:18ead85c200b | 65 | #define K_DOWN '2' |
pbrier | 0:18ead85c200b | 66 | #define K_LEFT '4' |
pbrier | 0:18ead85c200b | 67 | #define K_RIGHT '6' |
pbrier | 0:18ead85c200b | 68 | #define K_FUP '9' |
pbrier | 0:18ead85c200b | 69 | #define K_FDOWN '3' |
pbrier | 0:18ead85c200b | 70 | #define K_OK '5' |
pbrier | 0:18ead85c200b | 71 | #define K_CANCEL '0' |
pbrier | 0:18ead85c200b | 72 | #define K_ORIGIN '1' |
pbrier | 0:18ead85c200b | 73 | |
pbrier | 0:18ead85c200b | 74 | #endif |