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.
Fork of LCD4884 by
LCD4884.h@4:5977fe753a55, 2017-12-11 (annotated)
- Committer:
- Pinmanee
- Date:
- Mon Dec 11 15:10:01 2017 +0000
- Revision:
- 4:5977fe753a55
- Parent:
- 1:baf91b6482eb
LCD that can show graph
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
COX | 0:28f3c9274ea7 | 1 | /* |
COX | 0:28f3c9274ea7 | 2 | Modified by COX |
COX | 0:28f3c9274ea7 | 3 | version 0.1 |
COX | 0:28f3c9274ea7 | 4 | |
COX | 0:28f3c9274ea7 | 5 | Editor : COX |
COX | 0:28f3c9274ea7 | 6 | Date : 06.03.2013 |
COX | 0:28f3c9274ea7 | 7 | |
COX | 0:28f3c9274ea7 | 8 | * |
COX | 0:28f3c9274ea7 | 9 | * Update DFRobot source to work on FRDM KL25Z |
COX | 0:28f3c9274ea7 | 10 | * |
COX | 0:28f3c9274ea7 | 11 | */ |
COX | 0:28f3c9274ea7 | 12 | |
COX | 0:28f3c9274ea7 | 13 | #ifndef LCD4884_h |
COX | 0:28f3c9274ea7 | 14 | #define LCD4884_h |
COX | 0:28f3c9274ea7 | 15 | |
COX | 0:28f3c9274ea7 | 16 | #include "mbed.h" |
COX | 0:28f3c9274ea7 | 17 | |
COX | 0:28f3c9274ea7 | 18 | // SPI Interface --- (on arduino Arduino Digital Pin 2,3,4,5,6) |
Pinmanee | 1:baf91b6482eb | 19 | #define SPI_SCK D2 //Serial Clock(Master Output) |
Pinmanee | 1:baf91b6482eb | 20 | #define SPI_MOSI D3 //Master Output,Slave Input |
Pinmanee | 1:baf91b6482eb | 21 | #define LCD_DC D4 //Data/Command(command active low) |
Pinmanee | 1:baf91b6482eb | 22 | #define SPI_CS D5 //Chip Select,Slave Transmit Enable(active low,Master Output) |
Pinmanee | 1:baf91b6482eb | 23 | #define LCD_RST D6 //One Reset button |
Pinmanee | 1:baf91b6482eb | 24 | #define LCD_BL D7 //PWM Backlit control (Arduino DIO Pin 7) |
COX | 0:28f3c9274ea7 | 25 | |
COX | 0:28f3c9274ea7 | 26 | |
COX | 0:28f3c9274ea7 | 27 | //display mode -- normal / highlight |
COX | 0:28f3c9274ea7 | 28 | #define MENU_NORMAL 0 |
COX | 0:28f3c9274ea7 | 29 | #define MENU_HIGHLIGHT 1 |
COX | 0:28f3c9274ea7 | 30 | #define OFF 0 |
COX | 0:28f3c9274ea7 | 31 | #define ON 1 |
COX | 0:28f3c9274ea7 | 32 | #define LOW 0 |
COX | 0:28f3c9274ea7 | 33 | #define HIGH 1 |
COX | 0:28f3c9274ea7 | 34 | #define ONE_US 0.000001 |
COX | 0:28f3c9274ea7 | 35 | #define LCD_INITIAL_BRIGHTNESS 1 |
COX | 0:28f3c9274ea7 | 36 | |
COX | 0:28f3c9274ea7 | 37 | namespace mbed { |
COX | 0:28f3c9274ea7 | 38 | |
COX | 0:28f3c9274ea7 | 39 | class LCD4884 |
COX | 0:28f3c9274ea7 | 40 | { |
COX | 0:28f3c9274ea7 | 41 | public: |
COX | 0:28f3c9274ea7 | 42 | LCD4884(); |
COX | 0:28f3c9274ea7 | 43 | void LCD_init(void); |
COX | 0:28f3c9274ea7 | 44 | void backlight(float dat); |
COX | 0:28f3c9274ea7 | 45 | void LCD_write_byte(unsigned char dat, unsigned char dat_type); |
COX | 0:28f3c9274ea7 | 46 | void LCD_draw_bmp_pixel(unsigned char X,unsigned char Y,unsigned char *map,unsigned char Pix_x,unsigned char Pix_y); |
COX | 0:28f3c9274ea7 | 47 | void LCD_write_string(unsigned char X,unsigned char Y,char *s, char mode); |
COX | 0:28f3c9274ea7 | 48 | void LCD_prop_write_string(unsigned char X,unsigned char Y,char *s, char mode); |
COX | 0:28f3c9274ea7 | 49 | void LCD_write_chinese(unsigned char X, unsigned char Y,unsigned char *c,unsigned char ch_with,unsigned char num,unsigned char line,unsigned char row); |
Pinmanee | 1:baf91b6482eb | 50 | void LCD_write_string_big( unsigned char X,unsigned char Y, char *string, char mode ); |
COX | 0:28f3c9274ea7 | 51 | void LCD_write_char_big (unsigned char X,unsigned char Y, unsigned char ch, char mode); |
COX | 0:28f3c9274ea7 | 52 | void LCD_write_char(unsigned char c, char mode); |
COX | 0:28f3c9274ea7 | 53 | unsigned char LCD_prop_write_char(unsigned char c, char mode); |
COX | 0:28f3c9274ea7 | 54 | void LCD_set_XY(unsigned char X, unsigned char Y); |
COX | 0:28f3c9274ea7 | 55 | void LCD_clear(void); |
COX | 0:28f3c9274ea7 | 56 | }; |
COX | 0:28f3c9274ea7 | 57 | } |
COX | 0:28f3c9274ea7 | 58 | extern LCD4884 lcd; |
COX | 0:28f3c9274ea7 | 59 | |
COX | 0:28f3c9274ea7 | 60 | #endif |
COX | 0:28f3c9274ea7 | 61 |