Simon Ford / Mbed 2 deprecated displays

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MobileLCD.h Source File

MobileLCD.h

00001 /* mbed MobileLCD (Sparkfun Nokia) Display Library
00002  * Copyright (c) 2007-2009 sford
00003  * Released under the MIT License: http://mbed.org/license/mit
00004  *
00005  * Implements a Graphics display on the Nokia LCD from sparkfun
00006  */
00007 
00008 #ifndef MBED_MOBILELCD_H
00009 #define MBED_MOBILELCD_H
00010 
00011 // example of simplest vs. more performant port
00012 //  if not defined, only pixel() is implemented (slower, but simpler implementation)
00013 //  if defined, window() and putp() are also specialised, as well as pixel()
00014 #define MBED_MOBILELCD_FASTER
00015  
00016 #include "GraphicsDisplay.h"
00017 
00018 class MobileLCD : public GraphicsDisplay {
00019 
00020 public:
00021 
00022     MobileLCD(PinName mosi, PinName sclk, PinName cs, PinName rst);
00023 
00024     virtual void pixel(int x, int y, int colour);
00025     virtual int width();
00026     virtual int height();
00027 
00028 #ifdef MBED_MOBILELCD_FASTER
00029     virtual void window(int x, int y, int w, int h);
00030     virtual void putp(int colour);
00031 #endif
00032     
00033 protected:
00034 
00035     void command(int value);
00036     void data(int value);
00037         
00038     SPI _spi;
00039     DigitalOut _cs; 
00040     DigitalOut _rst;
00041     
00042 };
00043 
00044 #endif