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.
Dependencies: mbed
Fork of Digital_project by
LCD4884.h
- Committer:
- 57340500039
- Date:
- 2015-12-07
- Revision:
- 1:a4c852d25ead
- Parent:
- 0:4585326daab4
- Child:
- 2:6b2526c99e5c
File content as of revision 1:a4c852d25ead:
/*
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); //X,Y = x,y coodinate, mode : MENU_NORMAL = off/ others = on
};
}
extern LCD4884 lcd;
#endif
