TFTLCD with FastIO
Fork of TFTLCD by
Revision 30:1e9905bdfd15, committed 2015-07-30
- Comitter:
- nameless129
- Date:
- Thu Jul 30 02:35:08 2015 +0000
- Parent:
- 29:e7f8294ab7f7
- Commit message:
- change:use FastIO
Changed in this revision
ili9328.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r e7f8294ab7f7 -r 1e9905bdfd15 ili9328.cpp --- a/ili9328.cpp Fri Jul 24 11:04:56 2015 +0000 +++ b/ili9328.cpp Thu Jul 30 02:35:08 2015 +0000 @@ -21,6 +21,16 @@ *********************************************************************/ #include "ili9328.h" #include "helpers.h" +#include "FastIO.h" + +FastOut<P1_28> _D0; +FastOut<P2_3> _D1; +FastOut<P1_18> _D2; +FastOut<P1_24> _D3; +FastOut<P1_19> _D4; +FastOut<P1_26> _D5; +FastOut<P1_27> _D6; +FastOut<P1_25> _D7; ILI9328_LCD::ILI9328_LCD( PinName CS, PinName RESET, PinName RS, PinName WR, BusOut* DATA_PORT, PinName BL, PinName RD, backlight_t blType, float defaultBackLightLevel ) : LCD( 240, 320, CS, RS, RESET, BL, blType, defaultBackLightLevel ), _lcd_pin_wr( WR ) @@ -170,18 +180,58 @@ void ILI9328_LCD::WriteCmd( unsigned short cmd ) { _lcd_pin_rs = LOW; - _lcd_port->write( 0 ); +// _lcd_port->write( 0 ); + + _D0 = 0; + _D1 = 0; + _D2 = 0; + _D3 = 0; + _D4 = 0; + _D5 = 0; + _D6 = 0; + _D7 = 0; + pulseLow( _lcd_pin_wr ); - _lcd_port->write( cmd ); +// _lcd_port->write( cmd ); + + _D0 = cmd&0x01; + _D1 = cmd&0x02; + _D2 = cmd&0x04; + _D3 = cmd&0x08; + _D4 = cmd&0x10; + _D5 = cmd&0x20; + _D6 = cmd&0x40; + _D7 = cmd&0x80; + pulseLow( _lcd_pin_wr ); } //fix to 8bit mode void ILI9328_LCD::WriteData( unsigned short data ) { _lcd_pin_rs = HIGH; - _lcd_port->write( data>>8 ); +// _lcd_port->write( data>>8 ); + + _D0 = data&0x0100; + _D1 = data&0x0200; + _D2 = data&0x0400; + _D3 = data&0x0800; + _D4 = data&0x1000; + _D5 = data&0x2000; + _D6 = data&0x4000; + _D7 = data&0x8000; + pulseLow( _lcd_pin_wr ); - _lcd_port->write( data&0xff ); +// _lcd_port->write( data&0xff ); + + _D0 = data&0x01; + _D1 = data&0x02; + _D2 = data&0x04; + _D3 = data&0x08; + _D4 = data&0x10; + _D5 = data&0x20; + _D6 = data&0x40; + _D7 = data&0x80; + pulseLow( _lcd_pin_wr ); }