Basic library for SHARP LCD LS027B4DH01/LS027B7DH01

Dependents:   AkiSpiLcd_demo AkiSpiLcd_demo2 LCDRAM AkiSpiLcd_example

Committer:
Kazuki Yamamoto
Date:
Sun Oct 23 17:25:47 2016 +0900
Revision:
32:7e37fd2ddaa4
[ NEW ] MemoryLcd.h/cpp for base class declaration

new class LCD_MODE has basic command definitions
new class AkiLCD_MODE inherits LCD_MODE and overrides command definitions

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kazuki Yamamoto 32:7e37fd2ddaa4 1 /* Copyright (c) 2016 Kazuki Yamamoto <k.yamamoto.08136891@gmail.com>
Kazuki Yamamoto 32:7e37fd2ddaa4 2 Permission is hereby granted, free of charge, to any person obtaining
Kazuki Yamamoto 32:7e37fd2ddaa4 3 a copy of this software and associated documentation files
Kazuki Yamamoto 32:7e37fd2ddaa4 4 (the "Software"), to deal in the Software without restriction,
Kazuki Yamamoto 32:7e37fd2ddaa4 5 including without limitation the rights to use, copy, modify, merge,
Kazuki Yamamoto 32:7e37fd2ddaa4 6 publish, distribute, sublicense, and/or sell copies of the Software,
Kazuki Yamamoto 32:7e37fd2ddaa4 7 and to permit persons to whom the Software is furnished to do so,
Kazuki Yamamoto 32:7e37fd2ddaa4 8 subject to the following conditions:
Kazuki Yamamoto 32:7e37fd2ddaa4 9 The above copyright notice and this permission notice shall be
Kazuki Yamamoto 32:7e37fd2ddaa4 10 included in all copies or substantial portions of the Software.
Kazuki Yamamoto 32:7e37fd2ddaa4 11 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Kazuki Yamamoto 32:7e37fd2ddaa4 12 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Kazuki Yamamoto 32:7e37fd2ddaa4 13 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Kazuki Yamamoto 32:7e37fd2ddaa4 14 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
Kazuki Yamamoto 32:7e37fd2ddaa4 15 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
Kazuki Yamamoto 32:7e37fd2ddaa4 16 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
Kazuki Yamamoto 32:7e37fd2ddaa4 17 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Kazuki Yamamoto 32:7e37fd2ddaa4 18 */
Kazuki Yamamoto 32:7e37fd2ddaa4 19 /** this is base class for Memory LCDs from SHARP or JDI
Kazuki Yamamoto 32:7e37fd2ddaa4 20 * by Kazuki Yamamoto, or _K4ZUKI_
Kazuki Yamamoto 32:7e37fd2ddaa4 21 */
Kazuki Yamamoto 32:7e37fd2ddaa4 22
Kazuki Yamamoto 32:7e37fd2ddaa4 23 #ifndef __MEMORYLCD_H__ // NOLINT
Kazuki Yamamoto 32:7e37fd2ddaa4 24 #define __MEMORYLCD_H__
Kazuki Yamamoto 32:7e37fd2ddaa4 25
Kazuki Yamamoto 32:7e37fd2ddaa4 26 #include "mbed.h" // NOLINT
Kazuki Yamamoto 32:7e37fd2ddaa4 27
Kazuki Yamamoto 32:7e37fd2ddaa4 28 class LCD_MODE {
Kazuki Yamamoto 32:7e37fd2ddaa4 29 public:
Kazuki Yamamoto 32:7e37fd2ddaa4 30 static const uint8_t COM_INVERT = 0;
Kazuki Yamamoto 32:7e37fd2ddaa4 31 static const uint8_t CLEAR_SCREEN = 0;
Kazuki Yamamoto 32:7e37fd2ddaa4 32 static const uint8_t UPDATE = 0;
Kazuki Yamamoto 32:7e37fd2ddaa4 33 };
Kazuki Yamamoto 32:7e37fd2ddaa4 34
Kazuki Yamamoto 32:7e37fd2ddaa4 35 // class MemoryLCD {
Kazuki Yamamoto 32:7e37fd2ddaa4 36 // public:
Kazuki Yamamoto 32:7e37fd2ddaa4 37 // // enum LCD_MODE { COM_INVERT, CLEAR_SCREEN, UPDATE };
Kazuki Yamamoto 32:7e37fd2ddaa4 38 //
Kazuki Yamamoto 32:7e37fd2ddaa4 39 // /** Constructor
Kazuki Yamamoto 32:7e37fd2ddaa4 40 // * @param mosi SPI data output from mbed
Kazuki Yamamoto 32:7e37fd2ddaa4 41 // * @param mosi SPI data input from slave
Kazuki Yamamoto 32:7e37fd2ddaa4 42 // * @param sck SPI clock output from mbed
Kazuki Yamamoto 32:7e37fd2ddaa4 43 // * @param csl chip select input for LCD
Kazuki Yamamoto 32:7e37fd2ddaa4 44 // */
Kazuki Yamamoto 32:7e37fd2ddaa4 45 // MemoryLCD(PinName mosi, PinName miso, PinName sck, PinName csl);
Kazuki Yamamoto 32:7e37fd2ddaa4 46 //
Kazuki Yamamoto 32:7e37fd2ddaa4 47 // /** Clear screen
Kazuki Yamamoto 32:7e37fd2ddaa4 48 // */
Kazuki Yamamoto 32:7e37fd2ddaa4 49 // void cls();
Kazuki Yamamoto 32:7e37fd2ddaa4 50 //
Kazuki Yamamoto 32:7e37fd2ddaa4 51 // /** Writes single line(400 bits = 50 bytes)
Kazuki Yamamoto 32:7e37fd2ddaa4 52 // * @param line line number
Kazuki Yamamoto 32:7e37fd2ddaa4 53 // * @param *data pointer to data
Kazuki Yamamoto 32:7e37fd2ddaa4 54 // */
Kazuki Yamamoto 32:7e37fd2ddaa4 55 // void directUpdateSingle(int line, uint8_t *data);
Kazuki Yamamoto 32:7e37fd2ddaa4 56 //
Kazuki Yamamoto 32:7e37fd2ddaa4 57 // /** Writes multi lines
Kazuki Yamamoto 32:7e37fd2ddaa4 58 // * @param line line number
Kazuki Yamamoto 32:7e37fd2ddaa4 59 // * @param length number of line to write
Kazuki Yamamoto 32:7e37fd2ddaa4 60 // * @param *data pointer to data
Kazuki Yamamoto 32:7e37fd2ddaa4 61 // */
Kazuki Yamamoto 32:7e37fd2ddaa4 62 // void directUpdateMulti(int startline, int length, uint8_t *data);
Kazuki Yamamoto 32:7e37fd2ddaa4 63 //
Kazuki Yamamoto 32:7e37fd2ddaa4 64 // /** Inverting internal COM signal
Kazuki Yamamoto 32:7e37fd2ddaa4 65 // */
Kazuki Yamamoto 32:7e37fd2ddaa4 66 // void cominvert();
Kazuki Yamamoto 32:7e37fd2ddaa4 67 //
Kazuki Yamamoto 32:7e37fd2ddaa4 68 // private:
Kazuki Yamamoto 32:7e37fd2ddaa4 69 // int _comflag;
Kazuki Yamamoto 32:7e37fd2ddaa4 70 // SPI _spi;
Kazuki Yamamoto 32:7e37fd2ddaa4 71 // DigitalOut _csl;
Kazuki Yamamoto 32:7e37fd2ddaa4 72 // };
Kazuki Yamamoto 32:7e37fd2ddaa4 73 #endif // __MEMORYLCD_H__ //NOLINT