AD-128160-UART制御用のライブラリ http://www.aitendo.co.jp/product/3119 gingaxさんのプログラムを参考に作らせてもらっています。 http://mbed.org/users/akira/libraries/AD128160/m159hi
Dependents: AD128160_HelloWorld
Diff: AD128160.h
- Revision:
- 0:2e2f3b389d8a
- Child:
- 1:328d8c8f804e
diff -r 000000000000 -r 2e2f3b389d8a AD128160.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AD128160.h Mon Dec 12 02:09:19 2011 +0000 @@ -0,0 +1,141 @@ +#ifndef AD128160_H_ +#define AD128160_H_ + +#include "mbed.h" + +#define LCD_ROWS 10 +#define LCD_COLS 16 + +/** An interface for the AD128160 LCD display + * + * @code + * #include "mbed.h" + * #include "AD128160.h" + * + * AD128160 lcd(p9,p20); // tx,reset + * + * int main() { + * lcd.printf("Hello World!"); + * } + */ +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 + + 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 \ No newline at end of file