Digital_project 57340500039 57340500070
Dependencies: mbed
Fork of Digital_project by
Diff: LCD4884.h
- Revision:
- 0:4585326daab4
- Child:
- 1:a4c852d25ead
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LCD4884.h Mon Dec 07 16:05:23 2015 +0000 @@ -0,0 +1,56 @@ +/* +Modified by COX +version 0.1 + +Editor : COX +Date : 06.03.2013 + +* +* Update DFRobot source to work on FRDM KL25Z +* +*/ + +#ifndef LCD4884_h +#define LCD4884_h + +#include "mbed.h" + +// SPI Interface --- (on arduino Arduino Digital Pin 2,3,4,5,6) +#define SPI_SCK D2 //Serial Clock(Master Output) +#define SPI_MOSI D3 //Master Output,Slave Input +#define LCD_DC D4 //Data/Command(command active low) +#define SPI_CS D5 //Chip Select,Slave Transmit Enable(active low,Master Output) +#define LCD_RST D6 //One Reset button +#define LCD_BL D7 //PWM Backlit control (Arduino DIO Pin 7) + + +//display mode -- normal / highlight +#define MENU_NORMAL 0 +#define MENU_HIGHLIGHT 1 +#define OFF 0 +#define ON 1 +#define LOW 0 +#define HIGH 1 +#define ONE_US 0.000001 +#define LCD_INITIAL_BRIGHTNESS 1 + +namespace mbed { + +class LCD4884 + { + public: + LCD4884(); + void LCD_init(void); + void LCD_write_byte(unsigned char dat, unsigned char dat_type); + void LCD_write_char(unsigned char c, char mode); + void backlight(float dat); + void LCD_set_XY(unsigned char X, unsigned char Y); + void LCD_write_string(unsigned char X,unsigned char Y,char *s, char mode); // *s can be input as "<your string>" + void LCD_clear(void); // blank the screen + void LCD_pixel(unsigned char X, unsigned char Y, char mode); //X,Y = x,y coodinate, mode : MENU_NORMAL = off/ others = on + }; +} +extern LCD4884 lcd; + +#endif + \ No newline at end of file