fixed compiler warnings

Fork of TextLCD by Wim Huiskamp

Revision:
43:7f31a3a5e648
Parent:
42:7f270955a6b1
--- a/TextLCD.cpp	Sun Apr 30 14:53:35 2017 +0000
+++ b/TextLCD.cpp	Sun Apr 30 16:05:28 2017 +0000
@@ -574,35 +574,38 @@
           break; // case ST7070 Controller
          
       case SSD1803_3V3:
-          // SSD1803 controller: Initialise Voltage booster for VLCD. VDD=3V3
+          // changes have been made according to the register description of SSD1803 Rev 2.0
+          // http://www.lcd-module.de/fileadmin/eng/pdf/zubehoer/ssd1803_2_0.pdf
+          // SSD1803 controller: Initialize Voltage booster for VLCD. VDD=3V3
           // Note: supports 1,2, 3 or 4 lines
 //      case SSD1803_5V:
           // SSD1803 controller: No Voltage booster for VLCD. VDD=5V
                     
-          // Initialise Display configuration
+          // Initialize Display configuration
           switch (_type) {
             case LCD8x1:         //8x1 is a regular 1 line display
             case LCD8x2B:        //8x2D is a special case of 16x1
 //            case LCD12x1:                                
             case LCD16x1:   
             case LCD24x1:                                                                         
-              _function = 0x00;     //  Set function 0 0 1 DL N DH RE(0) IS 
-                                    //  Saved to allow switch between Instruction sets at later time
-                                    //    DL=0 4-bit Databus,
-                                    //         Note: 4 bit mode is ignored for native SPI and I2C devices
-                                    //     N=0 1 Line / 3 Line
-                                    //    DH=0 Double Height disable 
-                                    //    IS=0
+              _function = 0x20;     // Set function 0 0 1 DL N RE(0) DH REV
+                                    //   Saved to allow switch between Instruction sets at later time
+                                    //   DL=0 4-bit data bus,
+                                    //     Note: 4 bit mode is ignored for native SPI and I2C devices
+                                    //   N=0 1 Line / 3 Line
+                                    //   DH=0 Double Height disable 
+                                    //   REV=0 Reverse off, special feature of SSD1803
           
-              _function_1 = 0x02;   // Set function, 0 0 1 DL N BE RE(1) REV
-                                    //  Saved to allow switch between Instruction sets at later time
-                                    //    DL=0 4-bit Databus,
-                                    //         Note: 4 bit mode is ignored for native SPI and I2C devices
-                                    //     N=0 1 Line / 3 Line
-                                    //    BE=0 Blink Enable off, special feature of SSD1803
-                                    //   REV=0 Reverse off, special feature of SSD1803            
+              _function_1 = 0x24;   // Set function, 0 0 1 DL N RE(1) BE 0
+                                    //   Saved to allow switch between Instruction sets at later time
+                                    //   DL=0 4-bit data bus,
+                                    //     Note: 4 bit mode is ignored for native SPI and I2C devices
+                                    //   N=0 1 Line / 3 Line
+                                    //   BE=0 Blink Enable off, special feature of SSD1803
                         
-              _lines = 0x00;        // Ext function set 0 0 0 0 1 FW BW NW 
+              _lines = 0x08;        // Ext function set 0 0 0 0 1 FW BW NW 
+                                    //    FW=0 6-dot font width off
+                                    //    BW=0 Black/White inversion at cursor position off
                                     //    NW=0 1-Line LCD (N=0)
               break;  
 
@@ -611,46 +614,48 @@
             case LCD16x3D:          // Special mode for KS0078
 //            case LCD16x3D1:           // Special mode for SSD1803
 //            case LCD20x3D:            // Special mode for SSD1803
-              _function = 0x00;     //  Set function 0 0 1 DL N DH RE(0) IS 
-                                    //  Saved to allow switch between Instruction sets at later time
-                                    //    DL=0 4-bit Databus,
-                                    //         Note: 4 bit mode is ignored for native SPI and I2C devices
-                                    //     N=0 1 Line / 3 Line
-                                    //    DH=0 Double Height disable 
-                                    //    IS=0
+              _function = 0x20;     // Set function 0 0 1 DL N RE(0) DH REV
+                                    //   Saved to allow switch between Instruction sets at later time
+                                    //   DL=0 4-bit data bus,
+                                    //     Note: 4 bit mode is ignored for native SPI and I2C devices
+                                    //   N=0 1 Line / 3 Line
+                                    //   DH=0 Double Height disable 
+                                    //   REV=0 Reverse off, special feature of SSD1803
           
-              _function_1 = 0x02;   // Set function, 0 0 1 DL N BE RE(1) REV
-                                    //  Saved to allow switch between Instruction sets at later time
-                                    //    DL=0 4-bit Databus,
-                                    //         Note: 4 bit mode is ignored for native SPI and I2C devices
-                                    //     N=0 1 Line / 3 Line
-                                    //    BE=0 Blink Enable off, special feature of SSD1803
-                                    //   REV=0 Reverse off, special feature of SSD1803            
+              _function_1 = 0x24;   // Set function, 0 0 1 DL N RE(1) BE 0
+                                    //   Saved to allow switch between Instruction sets at later time
+                                    //   DL=0 4-bit data bus,
+                                    //     Note: 4 bit mode is ignored for native SPI and I2C devices
+                                    //   N=0 1 Line / 3 Line
+                                    //   BE=0 Blink Enable off, special feature of SSD1803
                         
-              _lines = 0x00;        // Ext function set 0 0 0 0 1 FW BW NW 
-                                    //    NW=1 3-Line LCD (N=0)
+              _lines = 0x08;        // Ext function set 0 0 0 0 1 FW BW NW 
+                                    //    FW=0 6-dot font width off
+                                    //    BW=0 Black/White inversion at cursor position off
+                                    //    NW=0 1-Line LCD (N=0)
               break;  
 
 //            case LCD10x2D:          // Special mode for SSD1803, 4-line mode but switch to double height font
             case LCD10x4D:          // Special mode for SSD1803
-            case LCD20x4D:          // Special mode for SSD1803
-              _function = 0x08;     //  Set function 0 0 1 DL N DH RE(0) IS 
-                                    //  Saved to allow switch between Instruction sets at later time
-                                    //    DL=0 4-bit Databus,
-                                    //         Note: 4 bit mode is ignored for native SPI and I2C devices
-                                    //     N=1 4 Line
-                                    //    DH=0 Double Height disable 
-                                    //    IS=0
+            case LCD20x4D:          // Special mode for SSD1803 (register description according to SSD1803 Rev 2.0)
+              _function = 0x28;     // Set function 0 0 1 DL N RE(0) DH REV
+                                    //   Saved to allow switch between Instruction sets at later time
+                                    //   DL=0 4-bit data bus,
+                                    //     Note: 4 bit mode is ignored for native SPI and I2C devices
+                                    //   N=1 4 Line mode when NW=1
+                                    //   DH=0 Double Height disable 
+                                    //   REV=0 Reverse off, special feature of SSD1803
           
-              _function_1 = 0x0A;   // Set function, 0 0 1 DL N BE RE(1) REV
+              _function_1 = 0x2C;   // Set function, 0 0 1 DL N RE(1) BE 0
                                     //  Saved to allow switch between Instruction sets at later time
-                                    //    DL=0 4-bit Databus,
+                                    //    DL=0 4-bit data bus,
                                     //         Note: 4 bit mode is ignored for native SPI and I2C devices
-                                    //     N=1 4 Line
+                                    //    N=1 4 Line
                                     //    BE=0 Blink Enable off, special feature of SSD1803
-                                    //   REV=0 Reverse off, special feature of SSD1803            
                         
-              _lines = 0x01;        // Ext function set 0 0 0 0 1 FW BW NW 
+              _lines = 0x09;        // Ext function set 0 0 0 0 1 FW BW NW 
+                                    //    FW=0 6-dot font width off
+                                    //    BW=0 Black/White inversion at cursor position off
                                     //    NW=1 4-Line LCD (N=1)
               break;  
 
@@ -660,27 +665,27 @@
               break;  
 
             default:
-              // All other LCD types are initialised as 2 Line displays (including LCD16x1C and LCD40x4)       
-              _function = 0x08;     //  Set function 0 0 1 DL N DH RE(0) IS 
-                                    //  Saved to allow switch between Instruction sets at later time
-                                    //    DL=0 4-bit Databus,
-                                    //         Note: 4 bit mode is ignored for native SPI and I2C devices
-                                    //     N=1 2 line / 4 Line
-                                    //    DH=0 Double Height disable 
-                                    //    RE=0
-                                    //    IS=0
-          
-              _function_1 = 0x0A;   // Set function, 0 0 1 DL N BE RE(1) REV
-                                    //  Saved to allow switch between Instruction sets at later time
-                                    //    DL=0 4-bit Databus,
-                                    //         Note: 4 bit mode is ignored for native SPI and I2C devices
-                                    //     N=1 2 line / 4 Line
-                                    //    BE=0 Blink Enable off, special feature of SSD1803
-                                    //    RE=1
-                                    //   REV=0 Reverse off, special feature of SSD1803            
+              // All other LCD types are Initialized as 2 Line displays (including LCD16x1C and LCD40x4)       
+              _function = 0x28;     // Set function 0 0 1 DL N RE(0) DH REV
+                                    //   Saved to allow switch between Instruction sets at later time
+                                    //   DL=0 4-bit data bus,
+                                    //     Note: 4 bit mode is ignored for native SPI and I2C devices
+                                    //   N=1 4 Line mode when NW=1
+                                    //   DH=0 Double Height disable 
+                                    //   REV=0 Reverse off, special feature of SSD1803
+
+              _function_1 = 0x2C;   // Set function, 0 0 1 DL N RE(1) BE 0
+                                    //   Saved to allow switch between Instruction sets at later time
+                                    //   DL=0 4-bit data bus,
+                                    //     Note: 4 bit mode is ignored for native SPI and I2C devices
+                                    //   N=1 2 line / 4 Line
+                                    //   BE=0 Blink Enable off, special feature of SSD1803
                         
-              _lines = 0x00;        // Ext function set 0 0 0 0 1 FW BW NW 
+              _lines = 0x08;        // Ext function set 0 0 0 0 1 FW BW NW 
+                                    //    FW=0 6-dot font width off
+                                    //    BW=0 Black/White inversion at cursor position off
                                     //    NW=0 2-Line LCD (N=1)
+
               break;                
           } // switch type