AD-128160-UART制御用のライブラリ http://www.aitendo.co.jp/product/3119 gingaxさんのプログラムを参考に作らせてもらっています。 http://mbed.org/users/akira/libraries/AD128160/m159hi

Dependents:   AD128160_HelloWorld

AD128160.h

Committer:
nucho
Date:
2011-12-12
Revision:
2:6f2db745808e
Parent:
1:328d8c8f804e
Child:
3:d15cda2a5e91

File content as of revision 2:6f2db745808e:

#ifndef AD128160_H_
#define AD128160_H_

#include "mbed.h"

#define LCD_ROWS 10
#define LCD_COLS 16
#define LCD_WIDTH 128
#define LCD_HEIGHT 160
/** An interface for the AD128160 LCD display
 *
 */
 
class AD128160: public Stream {
public:
    /** Create and AD128160 interface, using a tx and one DigitalOut interfaces
     *
     * @param A serialport
     * @param reset A DigitalOut
     */
    AD128160(PinName tx,PinName reset);
    
    /** Set a pixel on te screen
    *
    * @param x horizontal position from left
    * @param y vertical position from top
    */
    void pixel(int x0,int y0);
    
    /** Draw a box on the screen
    *
    * @param x0 start point of box(X)
    * @param y0 start point of box(Y)
    * @param x1 end point of box(X)
    * @param y1 end poinrt of box(Y)
    * @param paint Setting the fill.If set of 1, fill of box.
    */
    void box(int x0,int y0,int x1,int y1,int paint);
    
    /** Draw a line on the screen
    *
    * @param x0 start point of line(X)
    * @param y0 start point of line(Y)
    * @param x1 end point of line(X)
    * @param y1 end point of line(Y)
    */
    void line(int x0,int y0,int x1,int y1);
    
    /** Draw a circle on the screen
    *
    * @param x0 center point of circle(X)
    * @param y0 centor point of circle(Y)
    * @param r circle of radius
    * @param paint Setting the fill.If set of 1, fill of circle.
    */
    void circle(int x0,int y0,int r,int paint);
    
    /** Locate to a screen column and row
     *
     * @param column  The horizontal position from the left, indexed from 0
     * @param row     The vertical position from the top, indexed from 0
     */
    void locate(int column, int row);  

    /** Configure of the LCD's back light blightness
     *
     * @param value brightness value. range of 0-500
     */ 
    void brightness(int value);

    /** Set a color
    *
    * @param color 2byte colour in format RGB:56
    */
    void color(int rgb);

    /** Set a Text'd back ground olor
    *
    * @param color 2byte colour in format RGB:56
    */
    void backgroudColor(int rgb);

    /** Configure of the LCD speed
    *
    * @param baud baudrate of the LCD
    */
    void speed(int baud);

    /** Clear the screen and locate to 0,0 */
    void cls();

    /** Reset of the LCD */
    void reset();

    /** Write a string to the LCD
     *
     * @param s The string to write to the display
     */
    void puts(char s[98]);
    
#if DOXYGEN_ONLY
    /** Write a character to the LCD
     *
     * @param c The character to write to the display
     */
    int putc(int c);

    /** Write a formated string to the LCD
     *
     * @param format A printf-style format string, followed by the
     *               variables to use in formating the string.
     */
    int printf(const char* format, ...);
#endif
    /** get of the LCD width
    *
    * @return LCD width
    */
    int width();
    
    /** get of the LCD height
    *
    * @return LCD height
    */
    int height();
    
    /** get of the LCD width
    *
    * @return LCD colums
    */
    int columns();
    
    /** get of the LCD width
    *
    * @return LCD rows
    */
    int rows();

    void bmp(int x0,int y0,int bmp_n);
    
protected:
    void init();
    void newline(void);
    virtual int _putc(int c);
    virtual int _getc() {
        return 0;
    }

    Serial _device;  // tx, rx  LCD
    DigitalOut _rst;     // LCD  RST  (Reset)

    int _row, _column;

};


#endif