YX ZHANG
/
ChnLCD12864
ST7920 based Chinese LCD driver
chn12864.h@0:7749526f3bdf, 2017-07-22 (annotated)
- Committer:
- zhangyx
- Date:
- Sat Jul 22 04:09:51 2017 +0000
- Revision:
- 0:7749526f3bdf
ST7920 based Chinese LCD driver
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
zhangyx | 0:7749526f3bdf | 1 | #ifndef _12864_H__ |
zhangyx | 0:7749526f3bdf | 2 | #define _12864_H__ |
zhangyx | 0:7749526f3bdf | 3 | |
zhangyx | 0:7749526f3bdf | 4 | #include "mbed.h" |
zhangyx | 0:7749526f3bdf | 5 | |
zhangyx | 0:7749526f3bdf | 6 | class ChnLCD12864 : public Stream { |
zhangyx | 0:7749526f3bdf | 7 | DigitalOut _sid, _sck, _cs; |
zhangyx | 0:7749526f3bdf | 8 | uint8_t _column, _row; |
zhangyx | 0:7749526f3bdf | 9 | |
zhangyx | 0:7749526f3bdf | 10 | void Send_Byte(uint8_t bbyte); |
zhangyx | 0:7749526f3bdf | 11 | void Write_Char(uint8_t start, uint8_t ddata); |
zhangyx | 0:7749526f3bdf | 12 | public: |
zhangyx | 0:7749526f3bdf | 13 | ChnLCD12864(PinName sid, PinName sck, PinName cs); |
zhangyx | 0:7749526f3bdf | 14 | void locate( uint8_t col, uint8_t row ); |
zhangyx | 0:7749526f3bdf | 15 | void cls(void); |
zhangyx | 0:7749526f3bdf | 16 | void Write_Number(uint8_t s); |
zhangyx | 0:7749526f3bdf | 17 | void Write_String(uint8_t X, uint8_t Y, char *s); |
zhangyx | 0:7749526f3bdf | 18 | void Write_String_Length(uint8_t X, uint8_t Y, char *s, int length); |
zhangyx | 0:7749526f3bdf | 19 | void Display_Img(uint8_t const *img); |
zhangyx | 0:7749526f3bdf | 20 | protected: |
zhangyx | 0:7749526f3bdf | 21 | |
zhangyx | 0:7749526f3bdf | 22 | // Stream implementation functions |
zhangyx | 0:7749526f3bdf | 23 | virtual int _putc(int value); |
zhangyx | 0:7749526f3bdf | 24 | virtual int _getc(){return -1;} |
zhangyx | 0:7749526f3bdf | 25 | }; |
zhangyx | 0:7749526f3bdf | 26 | #endif |