Roland Elmiger / Mbed 2 deprecated AudioCODEC_6

Dependencies:   FatFileSystemCpp I2SSlave TLV320 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LCD.h Source File

LCD.h

00001 /* mbed LCD Library, for a 4-bit LCD based on HD44780
00002  * Copyright (c) 2007-2012, hb9gaa
00003  */
00004 
00005 #ifndef MBED_LCD_H
00006 #define MBED_LCD_H
00007 
00008 #include "mbed.h"
00009 
00010 class TextLCD : public Stream {
00011 public:
00012 
00013     /** LCD panel format */
00014     enum LCDType {
00015         LCD16x2     /**< 16x2 LCD panel (default) */
00016         , LCD16x2B  /**< 16x2 LCD panel alternate addressing */
00017         , LCD20x2   /**< 20x2 LCD panel */
00018         , LCD20x4   /**< 20x4 LCD panel */
00019     };
00020 
00021     /** Create a TextLCD interface
00022      * @param rs    Instruction/data control line
00023      * @param e     Enable line (clock)
00024      * @param d0-d3 Data lines
00025      * @param type  Sets the panel size/addressing mode (default = LCD16x2)
00026      */
00027     TextLCD(PinName rs, PinName rw, PinName e, PinName d0, PinName d1, PinName d2, PinName d3, LCDType type = LCD16x2);
00028 
00029     /** Write a character to the LCD
00030      * @param c The character to write to the display
00031      */
00032     int putc(int c);
00033 
00034     /** Locate to a screen column and row
00035      * @param column  The horizontal position from the left, indexed from 0
00036      * @param row     The vertical position from the top, indexed from 0
00037      */
00038     void locate(int column, int row);
00039     void buildChar(unsigned char *p);
00040 
00041     /** Clear the screen and locate to 0,0 */
00042     void cls();
00043 
00044     int rows();
00045     int columns();
00046 
00047 protected:
00048 
00049     // Stream implementation functions
00050     virtual int _putc(int value);
00051     virtual int _getc();
00052 
00053     int address(int column, int row);
00054     void character(int column, int row, int c);
00055     void writeByte(int value);
00056     void writeCommand(int command);
00057     void writeData(int data);
00058     
00059     DigitalOut _rs, _rw, _e;
00060     BusOut _d;
00061     LCDType _type;
00062 
00063     int _column;
00064     int _row;
00065 };
00066 
00067 #endif