Base LCDPanel based, required for all LCDPanel drivers
Diff: LCDPanel.h
- Revision:
- 2:ab4040a7e8c9
- Parent:
- 1:073d4f161f23
--- a/LCDPanel.h Fri Mar 09 01:49:18 2012 +0000 +++ b/LCDPanel.h Sun Mar 11 01:33:10 2012 +0000 @@ -1,7 +1,29 @@ -/* -Placeholder for Copyright notice, etc - -Author: silviogissi +/* LCDPanel base library for LCD/TFT Panels + * Copyright (c) 2012, Silvio Gissi + * + * License: + * + * 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. + * + * Author: Silvio Gissi + * Version: 0.1 Alfa + * */ #ifndef LCDPANEL_BASE_H @@ -14,10 +36,11 @@ public: LCDPanel(unsigned int width, unsigned int height, PinName cs); - virtual void fill(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, unsigned int color); - virtual void fill(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, const unsigned int* color); - virtual void set_pixel(unsigned int x, unsigned int y, unsigned int color); + virtual void fill(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, uint16_t color); + virtual void fill(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, const uint16_t* color); + virtual void set_pixel(unsigned int x, unsigned int y, uint16_t color); + inline void clear() { fill(0,0,_xmax,_ymax,(uint16_t)0x0000); } inline unsigned int height() { return _ymax+1; } inline unsigned int width() { return _xmax+1; } @@ -33,8 +56,9 @@ CsTransaction(LCDPanel *panel) : p(panel) { p->_cs=0; } ~CsTransaction() { p->_cs=1; } }; - - virtual void pixel(unsigned int color)=0; + virtual void command(unsigned int command,unsigned int size=0,...)=0; + virtual void data(unsigned int size,...)=0; + virtual void pixel(uint16_t color)=0; virtual void window(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2)=0; };