Paul Staron / Mbed 2 deprecated DCF77Clock_Nokia

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MobileLCD.h Source File

MobileLCD.h

00001 /* mbed Library - Nokia LCD Labelled "X3"
00002 * This is using the Philips PCF8833 controller
00003  * Copyright (c) 2009 P.R.Green
00004  */
00005 
00006 #ifndef MBED_MOBILELCD_H
00007 #define MBED_MOBILELCD_H
00008 
00009 //Colours in RGB 5:6:5 16bit mode
00010 #define BLACK       0x0000
00011 #define RED         0xF800
00012 #define GREEN       0x07E0 
00013 #define BLUE        0x001F
00014 #define WHITE       0xFFFF
00015 #define YELLOW      0xFF00
00016 #define MAGENTA     0xF0F0
00017 #define CYAN        0x05FC
00018 
00019 #include "mbed.h"
00020 
00021 
00022 namespace mbed {
00023 
00024 /* Class: MobileLCD
00025  *  An abstraction of the 130x130 Nokia Mobile labelled "X3" phone screen
00026  *
00027  * Example:
00028  * >
00029  * > #include "mbed.h"
00030  * > #include "MobileLCD.h"
00031  * >
00032  * > MobileLCD lcd(p5,p6,p7,p8,p9);
00033  * > 
00034  * > int main() {
00035  * >     lcd.printf("Hello World!");
00036  * > }
00037  */
00038 
00039 class MobileLCD : public Stream {
00040 
00041 public:
00042     /* Constructor: MobileLCD
00043      *  Create and object for the Mobile LCD, using SPI and two DigitalOuts
00044      *
00045      * Variables:
00046      *  mosi - SPI data out
00047      *  miso - SPI data in, not used
00048      *  clk  - SPI clock
00049      *  cs   - Chip Select
00050      *  rst  - reset
00051      */
00052 
00053     MobileLCD(PinName mosi, PinName miso, PinName clk, PinName cs, PinName rst);
00054 
00055     virtual void reset();
00056     virtual void _select();
00057     virtual void _deselect();
00058     virtual void _window(int x, int y, int width, int height);
00059     virtual void _putp(int colour);
00060     //virtual void orientation();
00061 
00062      void command(int value);
00063      void data(int value);
00064      void foreground(int v);
00065      void background(int v);
00066      /* Function: locate
00067       *  Set the text cursor to location x,y
00068       *
00069       * Variables:
00070       *  x - An integer setting the column position
00071       *  y - An integer setting the row position
00072       */
00073      void locate(int column, int row);
00074      /* Function: newline
00075       *  Set the text cursor to the start of the next line
00076       */
00077      void newline();
00078      virtual int _putc(int c);
00079      virtual int _getc() { return 0; }
00080     SPI _spi;
00081     DigitalOut _rst;
00082     DigitalOut _cs;    
00083     void bitblit(int x, int y, int width, int height, const char* bitstream);
00084     void fill(int x, int y, int width, int height, int colour);
00085     void blit(int x, int y, int width, int height, const int* colour);
00086     /* Function: cls
00087      *  Clear the screen
00088      */
00089     void cls();
00090     int width();
00091     int height();
00092     int columns();
00093     int rows();
00094     void putp(int v);
00095     void window(int x, int y, int width, int height);
00096     void pixel(int x, int y, int colour);
00097     int _row, _column, _rows, _columns, _foreground, _background, _width, _height;
00098 };
00099 
00100 }
00101 
00102 #endif
00103     
00104