Koji Tanikawa / kt_vfd_20170703

Dependents:   mbed_vfd_ntp

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers kt_vfd.h Source File

kt_vfd.h

00001 /**
00002  * @bref VFD class definition
00003  * for GU256X128C-3900
00004  */
00005 #ifndef   __MBED_KT_VFD_H_
00006 #define   __MBED_KT_VFD_H_
00007 
00008 enum { // write mode
00009     CURRENT = 0x00,
00010     ALL     = 0x01
00011 } ;
00012 
00013 enum { // display mode
00014     MODE1 = 0x01,   // overwrite
00015     MODE2,          // horizontal scroll
00016     MODE3           // vertical scroll
00017 } ;
00018 
00019 enum { // font size: 3900 only
00020     FONT_SMALL  = 0x01,
00021     FONT_MEDIUM = 0x02,
00022     FONT_LARGE  = 0x03,
00023     FONT_HUGE   = 0x04
00024 } ;
00025 
00026 class KT_VFD : public Stream
00027 {
00028 public:
00029     KT_VFD(PinName rd, PinName wr,
00030            PinName d0, PinName d1, PinName d2, PinName d3,
00031            PinName d4, PinName d5, PinName d6, PinName d7) ;
00032     void write_mode(unsigned char mode) ;
00033     void disp_mode(unsigned char mode) ;
00034     void scroll_speed(unsigned char n) ;
00035     void scroll_act(unsigned int w, unsigned int c, unsigned char s) ;
00036     void cls() ;
00037     void locate(unsigned int x, unsigned int y) ;
00038     void lf() ;
00039     void cr() ;
00040     void font_size(unsigned char m) ; // 3900 only
00041     void char_ext(unsigned char x, unsigned char y) ;
00042 
00043 protected:
00044     virtual int _putc(int c) ;
00045     virtual int _getc() ;
00046 
00047     void write_byte(unsigned char value) ;
00048 
00049     DigitalOut _rd, _wr ;
00050     BusOut _d ;
00051 } ;
00052 
00053 #endif // __MBED_KT_VFD_H_