パラメータを適応変化させる事により圧縮率を向上させた動的ライス・ゴロム符号を利用した可逆圧縮方式。圧縮ソフト、圧縮率のMATLABシミュレーションは詳細はInterface誌2011年8月号に掲載されるRX62Nマイコン連動特集にて掲載予定。

Dependencies:   mbed

Committer:
lynxeyed_atsu
Date:
Wed Mar 30 06:05:24 2011 +0000
Revision:
0:d920d64db582
alpha

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lynxeyed_atsu 0:d920d64db582 1 /* mbed TextLCD Library, for a 4-bit LCD based on HD44780
lynxeyed_atsu 0:d920d64db582 2 * Copyright (c) 2007-2010, sford
lynxeyed_atsu 0:d920d64db582 3 *
lynxeyed_atsu 0:d920d64db582 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
lynxeyed_atsu 0:d920d64db582 5 * of this software and associated documentation files (the "Software"), to deal
lynxeyed_atsu 0:d920d64db582 6 * in the Software without restriction, including without limitation the rights
lynxeyed_atsu 0:d920d64db582 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
lynxeyed_atsu 0:d920d64db582 8 * copies of the Software, and to permit persons to whom the Software is
lynxeyed_atsu 0:d920d64db582 9 * furnished to do so, subject to the following conditions:
lynxeyed_atsu 0:d920d64db582 10 *
lynxeyed_atsu 0:d920d64db582 11 * The above copyright notice and this permission notice shall be included in
lynxeyed_atsu 0:d920d64db582 12 * all copies or substantial portions of the Software.
lynxeyed_atsu 0:d920d64db582 13 *
lynxeyed_atsu 0:d920d64db582 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
lynxeyed_atsu 0:d920d64db582 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
lynxeyed_atsu 0:d920d64db582 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
lynxeyed_atsu 0:d920d64db582 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
lynxeyed_atsu 0:d920d64db582 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
lynxeyed_atsu 0:d920d64db582 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
lynxeyed_atsu 0:d920d64db582 20 * THE SOFTWARE.
lynxeyed_atsu 0:d920d64db582 21 */
lynxeyed_atsu 0:d920d64db582 22
lynxeyed_atsu 0:d920d64db582 23 #ifndef MBED_TEXTLCD_H
lynxeyed_atsu 0:d920d64db582 24 #define MBED_TEXTLCD_H
lynxeyed_atsu 0:d920d64db582 25
lynxeyed_atsu 0:d920d64db582 26 #include "mbed.h"
lynxeyed_atsu 0:d920d64db582 27
lynxeyed_atsu 0:d920d64db582 28 /** A TextLCD interface for driving 4-bit HD44780-based LCDs
lynxeyed_atsu 0:d920d64db582 29 *
lynxeyed_atsu 0:d920d64db582 30 * Currently supports 16x2, 20x2 and 20x4 panels
lynxeyed_atsu 0:d920d64db582 31 *
lynxeyed_atsu 0:d920d64db582 32 * @code
lynxeyed_atsu 0:d920d64db582 33 * #include "mbed.h"
lynxeyed_atsu 0:d920d64db582 34 * #include "TextLCD.h"
lynxeyed_atsu 0:d920d64db582 35 *
lynxeyed_atsu 0:d920d64db582 36 * TextLCD lcd(p10, p12, p15, p16, p29, p30); // rs, e, d0-d3
lynxeyed_atsu 0:d920d64db582 37 *
lynxeyed_atsu 0:d920d64db582 38 * int main() {
lynxeyed_atsu 0:d920d64db582 39 * lcd.printf("Hello World!\n");
lynxeyed_atsu 0:d920d64db582 40 * }
lynxeyed_atsu 0:d920d64db582 41 * @endcode
lynxeyed_atsu 0:d920d64db582 42 */
lynxeyed_atsu 0:d920d64db582 43 class TextLCD : public Stream {
lynxeyed_atsu 0:d920d64db582 44 public:
lynxeyed_atsu 0:d920d64db582 45
lynxeyed_atsu 0:d920d64db582 46 /** LCD panel format */
lynxeyed_atsu 0:d920d64db582 47 enum LCDType {
lynxeyed_atsu 0:d920d64db582 48 LCD16x2 /**< 16x2 LCD panel (default) */
lynxeyed_atsu 0:d920d64db582 49 , LCD16x2B /**< 16x2 LCD panel alternate addressing */
lynxeyed_atsu 0:d920d64db582 50 , LCD20x2 /**< 20x2 LCD panel */
lynxeyed_atsu 0:d920d64db582 51 , LCD20x4 /**< 20x4 LCD panel */
lynxeyed_atsu 0:d920d64db582 52 };
lynxeyed_atsu 0:d920d64db582 53
lynxeyed_atsu 0:d920d64db582 54 /** Create a TextLCD interface
lynxeyed_atsu 0:d920d64db582 55 *
lynxeyed_atsu 0:d920d64db582 56 * @param rs Instruction/data control line
lynxeyed_atsu 0:d920d64db582 57 * @param e Enable line (clock)
lynxeyed_atsu 0:d920d64db582 58 * @param d0-d3 Data lines
lynxeyed_atsu 0:d920d64db582 59 * @param type Sets the panel size/addressing mode (default = LCD16x2)
lynxeyed_atsu 0:d920d64db582 60 */
lynxeyed_atsu 0:d920d64db582 61 TextLCD(PinName rs, PinName e, PinName d0, PinName d1, PinName d2, PinName d3, LCDType type = LCD16x2);
lynxeyed_atsu 0:d920d64db582 62
lynxeyed_atsu 0:d920d64db582 63 #if DOXYGEN_ONLY
lynxeyed_atsu 0:d920d64db582 64 /** Write a character to the LCD
lynxeyed_atsu 0:d920d64db582 65 *
lynxeyed_atsu 0:d920d64db582 66 * @param c The character to write to the display
lynxeyed_atsu 0:d920d64db582 67 */
lynxeyed_atsu 0:d920d64db582 68 int putc(int c);
lynxeyed_atsu 0:d920d64db582 69
lynxeyed_atsu 0:d920d64db582 70 /** Write a formated string to the LCD
lynxeyed_atsu 0:d920d64db582 71 *
lynxeyed_atsu 0:d920d64db582 72 * @param format A printf-style format string, followed by the
lynxeyed_atsu 0:d920d64db582 73 * variables to use in formating the string.
lynxeyed_atsu 0:d920d64db582 74 */
lynxeyed_atsu 0:d920d64db582 75 int printf(const char* format, ...);
lynxeyed_atsu 0:d920d64db582 76 #endif
lynxeyed_atsu 0:d920d64db582 77
lynxeyed_atsu 0:d920d64db582 78 /** Locate to a screen column and row
lynxeyed_atsu 0:d920d64db582 79 *
lynxeyed_atsu 0:d920d64db582 80 * @param column The horizontal position from the left, indexed from 0
lynxeyed_atsu 0:d920d64db582 81 * @param row The vertical position from the top, indexed from 0
lynxeyed_atsu 0:d920d64db582 82 */
lynxeyed_atsu 0:d920d64db582 83 void locate(int column, int row);
lynxeyed_atsu 0:d920d64db582 84
lynxeyed_atsu 0:d920d64db582 85 /** Clear the screen and locate to 0,0 */
lynxeyed_atsu 0:d920d64db582 86 void cls();
lynxeyed_atsu 0:d920d64db582 87
lynxeyed_atsu 0:d920d64db582 88 int rows();
lynxeyed_atsu 0:d920d64db582 89 int columns();
lynxeyed_atsu 0:d920d64db582 90
lynxeyed_atsu 0:d920d64db582 91 protected:
lynxeyed_atsu 0:d920d64db582 92
lynxeyed_atsu 0:d920d64db582 93 // Stream implementation functions
lynxeyed_atsu 0:d920d64db582 94 virtual int _putc(int value);
lynxeyed_atsu 0:d920d64db582 95 virtual int _getc();
lynxeyed_atsu 0:d920d64db582 96
lynxeyed_atsu 0:d920d64db582 97 int address(int column, int row);
lynxeyed_atsu 0:d920d64db582 98 void character(int column, int row, int c);
lynxeyed_atsu 0:d920d64db582 99 void writeByte(int value);
lynxeyed_atsu 0:d920d64db582 100 void writeCommand(int command);
lynxeyed_atsu 0:d920d64db582 101 void writeData(int data);
lynxeyed_atsu 0:d920d64db582 102
lynxeyed_atsu 0:d920d64db582 103 DigitalOut _rs, _e;
lynxeyed_atsu 0:d920d64db582 104 BusOut _d;
lynxeyed_atsu 0:d920d64db582 105 LCDType _type;
lynxeyed_atsu 0:d920d64db582 106
lynxeyed_atsu 0:d920d64db582 107 int _column;
lynxeyed_atsu 0:d920d64db582 108 int _row;
lynxeyed_atsu 0:d920d64db582 109 };
lynxeyed_atsu 0:d920d64db582 110
lynxeyed_atsu 0:d920d64db582 111 #endif