Library for Nuelectronics Nokia 3310/5110 LCD Display and joystick.
Dependents: N3310LCD_Demo FRDM_N3110LCD
Diff: N3310SPIConfig.h
- Revision:
- 0:7efa6655d94b
- Child:
- 1:51961974fe55
diff -r 000000000000 -r 7efa6655d94b N3310SPIConfig.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/N3310SPIConfig.h Sun Mar 10 18:15:25 2013 +0000 @@ -0,0 +1,82 @@ +/* +* N3310LCD. A program to interface mbed with the nuelectronics +* Nokia 3310 LCD shield from www.nuelectronics.com. Ported from +* the nuelectronics Arduino code. +* +* Copyright (C) <2009> Petras Saduikis <petras@petras.co.uk> +* +* Converted to a mbed library by Andrew D. Lindsay +* +* This file is part of N3310LCD. +* +* N3310LCD is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* N3310LCD is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with N3310LCD. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef SNATCH59_N3310SPICONFIG_H +#define SNATCH59_N3310SPICONFIG_H + +#include <mbed.h> + +class N3310SPIPort +{ +public: + static const PinName MOSI; // Master Out Slave In + static const PinName MISO; // Master In Slave Out + static const PinName SCK; // SPI clock + static const PinName CE; // Chip Enable (aka Chip Select) + static const PinName LCD_RST; // LCD reset + static const PinName DAT_CMD; // indicates if the SPI write is command or date + static const PinName BL_ON; // Back Light On + + static const PinName AD0; // analog in for joystick +}; + +// NOTE pins have been chosen not to conflict with any I2C usage. +// MOSI = p5, MISO = p6, SCK = p7 is also an option +const PinName N3310SPIPort::MOSI = PTD2; +const PinName N3310SPIPort::MISO = PTD3; // not used for 3310 +const PinName N3310SPIPort::SCK = PTD1; + +//const PinName N3310SPIPort::CE = PTC8; // Alternative test display with CE on pin 6 instead of 10 +const PinName N3310SPIPort::CE = PTD0; +const PinName N3310SPIPort::LCD_RST = PTD5; +const PinName N3310SPIPort::DAT_CMD = PTA13; +const PinName N3310SPIPort::BL_ON = PTC9; + +const PinName N3310SPIPort::AD0 = PTB0; // joystick analog + +/************************************************ +* +* Nokia 3310 LCD Shield Pins +* NOTE: the LCD shield must be powered from a 3.3V supply in order +* for the joystick to be read correctly by the mbed analog in +* (which operates on a range of 0 - 3.3V). +* +* Connector J3: +* p13: SCK +* p12: MISO (not used) +* p11: MOSI +* p10: CE +* p9: LCD_RST +* p8: DAT_CMD +* +* Connector J1: +* p7: BL_ON +* +* Connector J2: +* p1 : AD0 +* +**************************************************/ + +#endif \ No newline at end of file