2017/07/03
Diff: kt_vfd.h
- Revision:
- 1:e1e942d03093
- Parent:
- 0:94347d9bbcf4
--- a/kt_vfd.h Mon Jul 03 14:14:06 2017 +0000 +++ b/kt_vfd.h Tue Jul 11 23:41:56 2017 +0000 @@ -1,14 +1,26 @@ /** * @bref VFD class definition - * for GU140X16G-7040 + * for GU256X128C-3900 */ #ifndef __MBED_KT_VFD_H_ #define __MBED_KT_VFD_H_ -enum { // writing mode - MD1 = 0x01, - MD2, - MD3 +enum { // write mode + CURRENT = 0x00, + ALL = 0x01 +} ; + +enum { // display mode + MODE1 = 0x01, // overwrite + MODE2, // horizontal scroll + MODE3 // vertical scroll +} ; + +enum { // font size: 3900 only + FONT_SMALL = 0x01, + FONT_MEDIUM = 0x02, + FONT_LARGE = 0x03, + FONT_HUGE = 0x04 } ; class KT_VFD : public Stream @@ -17,17 +29,22 @@ KT_VFD(PinName rd, PinName wr, PinName d0, PinName d1, PinName d2, PinName d3, PinName d4, PinName d5, PinName d6, PinName d7) ; - void mode(unsigned char mode) ; + void write_mode(unsigned char mode) ; + void disp_mode(unsigned char mode) ; + void scroll_speed(unsigned char n) ; + void scroll_act(unsigned int w, unsigned int c, unsigned char s) ; void cls() ; void locate(unsigned int x, unsigned int y) ; void lf() ; void cr() ; + void font_size(unsigned char m) ; // 3900 only + void char_ext(unsigned char x, unsigned char y) ; protected: virtual int _putc(int c) ; virtual int _getc() ; - void writeByte(unsigned char value) ; + void write_byte(unsigned char value) ; DigitalOut _rd, _wr ; BusOut _d ;