library

Dependents:   test test

Committer:
toiy01344
Date:
Fri Dec 08 10:15:02 2017 +0000
Revision:
0:bf9618815a4a
LCD4884

Who changed what in which revision?

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