Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
TCLcd.h
00001 #ifndef MBED_TCLCD_H 00002 #define MBED_TCLCD_H 00003 00004 #include "mbed.h" 00005 00006 #define ENDCOL 320 // X 00007 #define ENDROW 280 // Y 00008 #define WHITE 0xFFFF 00009 #define BLACK 0x0000 00010 #define RED 0xF800 00011 #define GREEN 0x07E0 00012 #define BLUE 0x001F 00013 #define CYAN 0x07FF 00014 #define MAGENTA 0xF81F 00015 #define YELLOW 0xFFE0 00016 #define BROWN 0x8000 00017 #define ORANGE 0xFC00 00018 #define PERPLE 0x8010 00019 #define COBALT 0x041F 00020 00021 typedef struct { 00022 char Identifier[6]; // "FONTX2"という文字列が入る 00023 char FontName[8]; // Font名(8文字) 00024 unsigned char XSize; // フォントの横幅 00025 unsigned char YSize; // フォントの高さ 00026 unsigned char CodeType; // 0x01 00027 unsigned char Tnum; // 文字コードテーブルのエントリ数 0x58 00028 struct { 00029 unsigned short Start; // 領域の始まりの文字コード 00030 unsigned short End; // 領域の終わりの文字コード 00031 } Block[100]; // Tnum個続く 00032 } FONT_HEAD; 00033 00034 class TCLcd { 00035 public: 00036 00037 TCLcd(PinName db10 ,PinName db11 ,PinName db12 ,PinName db13 ,PinName db14 ,PinName db15 ,PinName db16 ,PinName db17 , 00038 PinName wr ,PinName rs ,PinName cs ,PinName reset ); 00039 00040 void lcd_Clear(unsigned short Color); 00041 void lcd_Pixel(short Xpos, short Ypos, unsigned short Color); 00042 void lcd_Line(short x0, short y0, short x1, short y1, unsigned short Color); 00043 void lcd_Circle(int x0, int y0, int r, unsigned short color); 00044 unsigned short putch2( short x, short y, unsigned char* c, unsigned short fg, unsigned short bg); 00045 int putc(int value); 00046 protected: 00047 BusOut _bus; 00048 DigitalOut _wr; 00049 DigitalOut _rs; 00050 DigitalOut _cs; 00051 DigitalOut _reset; 00052 signed long search_font_area( unsigned short code ); 00053 signed long get_font_pt( unsigned short code ,unsigned char *chr ); 00054 FONT_HEAD fnt_head; 00055 unsigned short font_head_size; 00056 unsigned short font_search_tbl[100]; 00057 short _column; 00058 short _row; 00059 void lcd_out(unsigned short index, unsigned short data); 00060 00061 }; 00062 00063 00064 00065 #endif
Generated on Wed Jul 13 2022 15:02:52 by
1.7.2