Library for Nuelectronics Nokia 3310/5110 LCD Display and joystick.

Dependents:   LEDFun NetTester

Fork of N3310LCD by Andrew Lindsay

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers N3310SPIConfig.h Source File

N3310SPIConfig.h

00001 /**
00002  * @section DESCRIPTION
00003  * N3310LCD. A program to interface mbed with the nuelectronics
00004  * Nokia 3310 LCD shield from www.nuelectronics.com. Ported from
00005  * the nuelectronics Arduino code.
00006  *
00007  * @section LICENSE
00008  *
00009  * Copyright (C) <2009> Petras Saduikis <petras@petras.co.uk>
00010  *
00011  * Converted to a mbed library by Andrew D. Lindsay
00012  *
00013  * This file is part of N3310LCD.
00014  *
00015  * N3310LCD is free software: you can redistribute it and/or modify
00016  * it under the terms of the GNU General Public License as published by
00017  * the Free Software Foundation, either version 3 of the License, or
00018  * (at your option) any later version.
00019  *
00020  * N3310LCD is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  * GNU General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU General Public License
00026  * along with N3310LCD.  If not, see <http://www.gnu.org/licenses/>.
00027  */
00028 
00029 #ifndef N3310SPICONFIG_H
00030 #define N3310SPICONFIG_H
00031 
00032 #include <mbed.h>
00033 
00034 class N3310SPIPort
00035 {
00036 public:
00037     static const PinName MOSI;       // Master Out Slave In
00038     static const PinName MISO;       // Master In Slave Out
00039     static const PinName SCK;        // SPI clock
00040     static const PinName CE;         // Chip Enable (aka Chip Select)
00041     static const PinName LCD_RST;    // LCD reset
00042     static const PinName DAT_CMD;    // indicates if the SPI write is command or date
00043     static const PinName BL_ON;      // Back Light On
00044 
00045     static const PinName AD0;   // analog in for joystick
00046 };
00047 
00048 // NOTE pins have been chosen not to conflict with any I2C usage.
00049 // MOSI = p5, MISO = p6, SCK = p7 is also an option
00050 const PinName N3310SPIPort::MOSI = p11;
00051 const PinName N3310SPIPort::MISO = p12;   // not used for 3310
00052 const PinName N3310SPIPort::SCK = p13;
00053 
00054 const PinName N3310SPIPort::CE = p10;       // was p21;
00055 const PinName N3310SPIPort::LCD_RST = p9;   // was p22;
00056 const PinName N3310SPIPort::DAT_CMD = p8;   // was p23;
00057 const PinName N3310SPIPort::BL_ON = p24;
00058 
00059 const PinName N3310SPIPort::AD0 = p20;    // joystick analog
00060 
00061 /************************************************
00062 * 
00063 * Nokia 3310 LCD Shield Pins
00064 * NOTE: the LCD shield must be powered from a 3.3V supply in order
00065 * for the joystick to be read correctly by the mbed analog in
00066 * (which operates on a range of 0 - 3.3V).
00067 *
00068 * Connector J3:
00069 * p13: SCK
00070 * p12: MISO (not used)
00071 * p11: MOSI
00072 * p10: CE
00073 * p9: LCD_RST
00074 * p8: DAT_CMD
00075 *
00076 * Connector J1:
00077 * p7: BL_ON
00078 *
00079 * Connector J2:
00080 * p1 : AD0
00081 *
00082 **************************************************/
00083 
00084 #endif