LCD4884
Dependents: 15A-ClassProjectFinal_masterfull-pae-za-leng
Fork of LCD4884 by
LCD4884.h@0:28f3c9274ea7, 2013-03-09 (annotated)
- Committer:
- COX
- Date:
- Sat Mar 09 21:07:35 2013 +0000
- Revision:
- 0:28f3c9274ea7
- Child:
- 1:480f22b7e9ae
draft...; first working version;
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) |
COX | 0:28f3c9274ea7 | 19 | #define SPI_SCK PTD4 //Serial Clock(Master Output) |
COX | 0:28f3c9274ea7 | 20 | #define SPI_MOSI PTA12 //Master Output,Slave Input |
COX | 0:28f3c9274ea7 | 21 | #define LCD_DC PTA4 //Data/Command(command active low) |
COX | 0:28f3c9274ea7 | 22 | #define SPI_CS PTA5 //Chip Select,Slave Transmit Enable(active low,Master Output) |
COX | 0:28f3c9274ea7 | 23 | #define LCD_RST PTC8 //One Reset button |
COX | 0:28f3c9274ea7 | 24 | #define LCD_BL PTC9 //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); |
COX | 0:28f3c9274ea7 | 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 |