Fork of LCD-Window which works with Enhanced TextLCD from Wim
Fork of LcdWindow by
sed1335text.h@6:7ba288afed38, 2011-01-04 (annotated)
- Committer:
- hlipka
- Date:
- Tue Jan 04 22:10:41 2011 +0000
- Revision:
- 6:7ba288afed38
- Child:
- 7:b472970bd8f6
added initial driver for SED1335 based displays (text mode only, no fancy stuff, 320x240 pixels)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hlipka | 6:7ba288afed38 | 1 | /* |
hlipka | 6:7ba288afed38 | 2 | * mbed LCDWindow library |
hlipka | 6:7ba288afed38 | 3 | * Copyright (c) 2010 Hendrik Lipka |
hlipka | 6:7ba288afed38 | 4 | * |
hlipka | 6:7ba288afed38 | 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
hlipka | 6:7ba288afed38 | 6 | * of this software and associated documentation files (the "Software"), to deal |
hlipka | 6:7ba288afed38 | 7 | * in the Software without restriction, including without limitation the rights |
hlipka | 6:7ba288afed38 | 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
hlipka | 6:7ba288afed38 | 9 | * copies of the Software, and to permit persons to whom the Software is |
hlipka | 6:7ba288afed38 | 10 | * furnished to do so, subject to the following conditions: |
hlipka | 6:7ba288afed38 | 11 | * |
hlipka | 6:7ba288afed38 | 12 | * The above copyright notice and this permission notice shall be included in |
hlipka | 6:7ba288afed38 | 13 | * all copies or substantial portions of the Software. |
hlipka | 6:7ba288afed38 | 14 | * |
hlipka | 6:7ba288afed38 | 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
hlipka | 6:7ba288afed38 | 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
hlipka | 6:7ba288afed38 | 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
hlipka | 6:7ba288afed38 | 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
hlipka | 6:7ba288afed38 | 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
hlipka | 6:7ba288afed38 | 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
hlipka | 6:7ba288afed38 | 21 | * THE SOFTWARE. |
hlipka | 6:7ba288afed38 | 22 | */ |
hlipka | 6:7ba288afed38 | 23 | |
hlipka | 6:7ba288afed38 | 24 | #ifndef SED1335_8BIT_H_ |
hlipka | 6:7ba288afed38 | 25 | #define SED1335_8BIT_H_ |
hlipka | 6:7ba288afed38 | 26 | |
hlipka | 6:7ba288afed38 | 27 | #include "lcd.h" |
hlipka | 6:7ba288afed38 | 28 | |
hlipka | 6:7ba288afed38 | 29 | #include "BusOut.h" |
hlipka | 6:7ba288afed38 | 30 | #include "DigitalOut.h" |
hlipka | 6:7ba288afed38 | 31 | |
hlipka | 6:7ba288afed38 | 32 | using namespace mbed; |
hlipka | 6:7ba288afed38 | 33 | |
hlipka | 6:7ba288afed38 | 34 | /** |
hlipka | 6:7ba288afed38 | 35 | * class for connecting graphical SED1335-based LCD-Display (or using similiar controllers) |
hlipka | 6:7ba288afed38 | 36 | * displays are connected in 8bit-mode, and are using the internal 8x8 font |
hlipka | 6:7ba288afed38 | 37 | */ |
hlipka | 6:7ba288afed38 | 38 | class SED1335TextLCD: public TextLCDBase |
hlipka | 6:7ba288afed38 | 39 | { |
hlipka | 6:7ba288afed38 | 40 | public: |
hlipka | 6:7ba288afed38 | 41 | /** |
hlipka | 6:7ba288afed38 | 42 | * @param columns number of chars per line (using an 8x8 font) |
hlipka | 6:7ba288afed38 | 43 | * @param rows number of lines (using an 8x8 font) |
hlipka | 6:7ba288afed38 | 44 | * @param data the bus object used for sending data (must be 8bit) |
hlipka | 6:7ba288afed38 | 45 | * @param enable the pin name for the enable line (1=active) |
hlipka | 6:7ba288afed38 | 46 | * @param rs the pin name for the register select line (0=cmd, 1=data) |
hlipka | 6:7ba288afed38 | 47 | * @param leftCS the pin name for the left display half (1=active) |
hlipka | 6:7ba288afed38 | 48 | * @param rightCS the pin name for the right display half (1=active, use NC for smaller displays) |
hlipka | 6:7ba288afed38 | 49 | */ |
hlipka | 6:7ba288afed38 | 50 | SED1335TextLCD(const unsigned int columns, const unsigned int rows, BusOut *data, const PinName read, const PinName write, const PinName cs, const PinName a0, const PinName reset); |
hlipka | 6:7ba288afed38 | 51 | virtual void init(); |
hlipka | 6:7ba288afed38 | 52 | virtual void writeText(const unsigned int column, const unsigned int row, const char text[]); |
hlipka | 6:7ba288afed38 | 53 | virtual void clear(); |
hlipka | 6:7ba288afed38 | 54 | virtual void character(int column, int row, int c); |
hlipka | 6:7ba288afed38 | 55 | |
hlipka | 6:7ba288afed38 | 56 | protected: |
hlipka | 6:7ba288afed38 | 57 | void sendCmd(const unsigned char byte); |
hlipka | 6:7ba288afed38 | 58 | void sendData(const unsigned char byte); |
hlipka | 6:7ba288afed38 | 59 | |
hlipka | 6:7ba288afed38 | 60 | void sendByte(const unsigned char byte); |
hlipka | 6:7ba288afed38 | 61 | |
hlipka | 6:7ba288afed38 | 62 | BusOut* _data; |
hlipka | 6:7ba288afed38 | 63 | DigitalOut *_rd, *_wr, *_cs, *_a0, *_reset; |
hlipka | 6:7ba288afed38 | 64 | }; |
hlipka | 6:7ba288afed38 | 65 | #endif |