nuchoさんのNokiaライブラリ( NokiaLCD_With_JapaneseFont ) の NokiaLCD.cpp _putp関数をカスタマイズしました
Dependents: NokiaLCD spxml_WeatherLCD
Fork of NokiaLCD_With_JapaneseFont by
Revision 1:c505894797b3, committed 2014-07-13
- Comitter:
- sunifu
- Date:
- Sun Jul 13 11:44:38 2014 +0000
- Parent:
- 0:839ab88da656
- Commit message:
- 2014.7.13
Changed in this revision
NokiaLCD.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/NokiaLCD.cpp Tue Oct 19 23:49:09 2010 +0000 +++ b/NokiaLCD.cpp Sun Jul 13 11:44:38 2014 +0000 @@ -126,6 +126,7 @@ wait_ms(2); command(0x29);//DISPON command(0x03);//BSTRON + break; } @@ -172,12 +173,28 @@ } } -void NokiaLCD::_putp(int colour) { - int gr = ((colour >> 20) & 0x0F) - | ((colour >> 8 ) & 0xF0); - int nb = ((colour >> 4 ) & 0x0F); - data(nb); - data(gr); +void NokiaLCD::_putp(int colour){ + + switch (_type) + { + case LCD6100: + case LCD3300: + int gr = ((colour >> 20) & 0x0F) + | ((colour >> 8 ) & 0xF0); + int nb = ((colour >> 4 ) & 0x0F); + data(nb); + data(gr); + break; + + case PCF8833: + int rg = ((colour >> 16) & 0xF8) + | ((colour >> 13 ) & 0x07); + int gb = ((colour >> 5 ) & 0xE0) + | ((colour >> 3 ) & 0x1f); + data(rg); + data(gb); + break; + } }