author | root@rika |
Thu, 23 Apr 2009 19:10:12 +0200 | |
changeset 30 | 7fd00015f62f |
parent 8 | 5fa05abec614 |
permissions | -rw-r--r-- |
root@5 | 1 |
/* |
root@5 | 2 |
* GraphLCD driver library |
root@5 | 3 |
* |
root@5 | 4 |
* picctl.c - PIC controlled LCD driver class |
root@5 | 5 |
* |
root@5 | 6 |
* This file is released under the GNU General Public License. Refer |
root@5 | 7 |
* to the COPYING file distributed with this package. |
root@5 | 8 |
* |
root@5 | 9 |
* Codebase by Andreas Regel <andreas.regel AT powarman.de> |
root@5 | 10 |
* (c) 2007 Carsten Presser |
root@5 | 11 |
*/ |
root@5 | 12 |
|
root@5 | 13 |
#ifndef _GLCDDRIVERS_PICCTL_H_ |
root@5 | 14 |
#define _GLCDDRIVERS_PICCTL_H_ |
root@5 | 15 |
|
root@5 | 16 |
#include "driver.h" |
root@5 | 17 |
|
root@5 | 18 |
namespace GLCD |
root@5 | 19 |
{ |
root@5 | 20 |
|
root@5 | 21 |
class cDriverConfig; |
root@5 | 22 |
class cSerialPort; |
root@5 | 23 |
|
root@5 | 24 |
class cDriverPICCtl : public cDriver |
root@5 | 25 |
{ |
root@5 | 26 |
private: |
root@5 | 27 |
cSerialPort * port; |
root@5 | 28 |
unsigned char ** newLCD; // wanted state |
root@5 | 29 |
unsigned char ** oldLCD; // current state |
root@5 | 30 |
cDriverConfig * config; |
root@5 | 31 |
cDriverConfig * oldConfig; |
root@5 | 32 |
|
root@5 | 33 |
int WaitForAck(void); |
root@5 | 34 |
void CmdDispClearScreen(void); |
root@5 | 35 |
void CmdSetMode(uint8_t mode); |
root@5 | 36 |
void CmdDispSetManaged(void); |
root@5 | 37 |
void CmdDispSetUnManaged(void); |
root@5 | 38 |
void CmdDispSetBrightness(uint8_t percent); |
root@5 | 39 |
void CmdDispSetColData(uint8_t yoffset, uint8_t xoffset, uint8_t length, uint8_t * data); |
root@30 | 40 |
int CheckSetup(); |
cpresser@8 | 41 |
void DecodeCmd(uint8_t * cmd, uint8_t len); |
root@30 | 42 |
void InputHandler(); |
root@5 | 43 |
|
root@30 | 44 |
uint8_t buf[255]; |
root@30 | 45 |
uint8_t buf_pos; |
root@30 | 46 |
uint8_t buf_cmd_start; |
root@30 | 47 |
bool buf_flag_escape; |
root@30 | 48 |
int keys[255]; |
root@30 | 49 |
uint8_t keys_pos; |
root@30 | 50 |
uint8_t keys_pos_; |
root@30 | 51 |
|
root@30 | 52 |
int refreshCounter; |
root@30 | 53 |
bool ack_flag; |
root@5 | 54 |
|
root@5 | 55 |
|
root@5 | 56 |
public: |
root@5 | 57 |
virtual int Init(); |
root@5 | 58 |
virtual int DeInit(); |
root@5 | 59 |
|
root@5 | 60 |
virtual void Clear(); |
root@5 | 61 |
virtual void Set8Pixels(int x, int y, unsigned char data); |
root@5 | 62 |
virtual void Refresh(bool refreshAll = false); |
root@5 | 63 |
virtual void SetBrightness(unsigned int percent); |
root@30 | 64 |
virtual int GetKey(); |
root@30 | 65 |
virtual bool HasKeys(); |
root@5 | 66 |
|
root@30 | 67 |
cDriverPICCtl(cDriverConfig * config); // Konstruktor |
root@5 | 68 |
virtual ~cDriverPICCtl(); // Destruktor |
root@5 | 69 |
}; |
root@5 | 70 |
|
root@5 | 71 |
} // end of namespace |
root@5 | 72 |
|
root@5 | 73 |
#endif |