![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Newhaven 320x240 LCD
newhaven.h
- Committer:
- pbevans89
- Date:
- 2011-02-27
- Revision:
- 1:fa44aeffcfd6
- Parent:
- 0:c8893901ef8a
- Child:
- 2:2058e2f79157
File content as of revision 1:fa44aeffcfd6:
/* mbed Newhaven LCD Library, for the NHD-320240WG model * Copyright (c) 2011, Paul Evans * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "mbed.h" class NHLCD { public: /* Creates a Newhaven LCD interface using several DigitalOut pins and a 8-bit BusInOut * * @param PIN_E Operation enable signal * @param PIN_RW Read/Write select signal (1 = read, 0 = write) * @param PIN_A0 Register select signal (1 = data, 0 = command) * @param PIN_CS Active LOW chip select * @param PIN_RST Active LOW reset signal * @param BUSLCD Bi-directional 8-bit data bus */ NHLCD(PinName PIN_E,PinName PIN_RW,PinName PIN_A0,PinName PIN_CS,PinName PIN_RST, BusInOut *BUSLCD); void Init(); void comm_out(unsigned char j); void data_out(unsigned char j); void clearScreen(); void text(char* text, char row, char col); void setPixel(int row, int col); private: DigitalOut E,RW,A0,CS,RST; BusInOut *LCD_PORT; }; void delay(unsigned int n); void delay1(unsigned int n);