graphlcd-base/glcddrivers/picctl.h
changeset 5 37602e25a04a
child 8 5fa05abec614
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/graphlcd-base/glcddrivers/picctl.h	Wed Feb 06 17:37:50 2008 +0000
     1.3 @@ -0,0 +1,68 @@
     1.4 +/*
     1.5 + * GraphLCD driver library
     1.6 + *
     1.7 + * picctl.c  -  PIC controlled LCD driver class
     1.8 + *
     1.9 + * This file is released under the GNU General Public License. Refer
    1.10 + * to the COPYING file distributed with this package.
    1.11 + *
    1.12 + * Codebase by Andreas Regel <andreas.regel AT powarman.de>
    1.13 + * (c) 2007 Carsten Presser
    1.14 + */
    1.15 +
    1.16 +#ifndef _GLCDDRIVERS_PICCTL_H_
    1.17 +#define _GLCDDRIVERS_PICCTL_H_
    1.18 +
    1.19 +#include "driver.h"
    1.20 +
    1.21 +namespace GLCD
    1.22 +{
    1.23 +
    1.24 +class cDriverConfig;
    1.25 +class cSerialPort;
    1.26 +
    1.27 +class cDriverPICCtl : public cDriver
    1.28 +{
    1.29 +private:
    1.30 +    cSerialPort * port;
    1.31 +    unsigned char ** newLCD; // wanted state
    1.32 +    unsigned char ** oldLCD; // current state
    1.33 +    cDriverConfig * config;
    1.34 +    cDriverConfig * oldConfig;
    1.35 +    int refreshCounter;
    1.36 +    bool ack_flag;
    1.37 +
    1.38 +    int WaitForAck(void);
    1.39 +    void CmdDispClearScreen(void);
    1.40 +    void CmdSetMode(uint8_t mode);
    1.41 +    void CmdDispSetManaged(void);
    1.42 +    void CmdDispSetUnManaged(void);
    1.43 +    void CmdDispSetBrightness(uint8_t percent);
    1.44 +    void CmdDispSetColData(uint8_t yoffset, uint8_t xoffset, uint8_t length, uint8_t * data);
    1.45 +
    1.46 +    int CheckSetup();
    1.47 +
    1.48 +    static void SignalHandler(int signal);
    1.49 +
    1.50 +// singleton
    1.51 +    static cDriverPICCtl* instance;		// die EINE instant
    1.52 +    cDriverPICCtl(cDriverConfig * config);	// Konstruktor
    1.53 +
    1.54 +public:
    1.55 +    virtual int Init();
    1.56 +    virtual int DeInit();
    1.57 +
    1.58 +    virtual void Clear();
    1.59 +    virtual void Set8Pixels(int x, int y, unsigned char data);
    1.60 +    virtual void Refresh(bool refreshAll = false);
    1.61 +    virtual void SetBrightness(unsigned int percent);
    1.62 +    virtual void SetClock(unsigned int percent);
    1.63 +
    1.64 +// singleton
    1.65 +    virtual ~cDriverPICCtl();			// Destruktor
    1.66 +    static cDriverPICCtl* getInstance(cDriverConfig * config);
    1.67 +};
    1.68 +
    1.69 +} // end of namespace
    1.70 +
    1.71 +#endif