graphlcd-base/glcddrivers/picctl.h
changeset 5 37602e25a04a
child 8 5fa05abec614
equal deleted inserted replaced
4:df6a40031aa5 5:37602e25a04a
       
     1 /*
       
     2  * GraphLCD driver library
       
     3  *
       
     4  * picctl.c  -  PIC controlled LCD driver class
       
     5  *
       
     6  * This file is released under the GNU General Public License. Refer
       
     7  * to the COPYING file distributed with this package.
       
     8  *
       
     9  * Codebase by Andreas Regel <andreas.regel AT powarman.de>
       
    10  * (c) 2007 Carsten Presser
       
    11  */
       
    12 
       
    13 #ifndef _GLCDDRIVERS_PICCTL_H_
       
    14 #define _GLCDDRIVERS_PICCTL_H_
       
    15 
       
    16 #include "driver.h"
       
    17 
       
    18 namespace GLCD
       
    19 {
       
    20 
       
    21 class cDriverConfig;
       
    22 class cSerialPort;
       
    23 
       
    24 class cDriverPICCtl : public cDriver
       
    25 {
       
    26 private:
       
    27     cSerialPort * port;
       
    28     unsigned char ** newLCD; // wanted state
       
    29     unsigned char ** oldLCD; // current state
       
    30     cDriverConfig * config;
       
    31     cDriverConfig * oldConfig;
       
    32     int refreshCounter;
       
    33     bool ack_flag;
       
    34 
       
    35     int WaitForAck(void);
       
    36     void CmdDispClearScreen(void);
       
    37     void CmdSetMode(uint8_t mode);
       
    38     void CmdDispSetManaged(void);
       
    39     void CmdDispSetUnManaged(void);
       
    40     void CmdDispSetBrightness(uint8_t percent);
       
    41     void CmdDispSetColData(uint8_t yoffset, uint8_t xoffset, uint8_t length, uint8_t * data);
       
    42 
       
    43     int CheckSetup();
       
    44 
       
    45     static void SignalHandler(int signal);
       
    46 
       
    47 // singleton
       
    48     static cDriverPICCtl* instance;		// die EINE instant
       
    49     cDriverPICCtl(cDriverConfig * config);	// Konstruktor
       
    50 
       
    51 public:
       
    52     virtual int Init();
       
    53     virtual int DeInit();
       
    54 
       
    55     virtual void Clear();
       
    56     virtual void Set8Pixels(int x, int y, unsigned char data);
       
    57     virtual void Refresh(bool refreshAll = false);
       
    58     virtual void SetBrightness(unsigned int percent);
       
    59     virtual void SetClock(unsigned int percent);
       
    60 
       
    61 // singleton
       
    62     virtual ~cDriverPICCtl();			// Destruktor
       
    63     static cDriverPICCtl* getInstance(cDriverConfig * config);
       
    64 };
       
    65 
       
    66 } // end of namespace
       
    67 
       
    68 #endif