graphlcd-base/glcddrivers/gu256x64-3900.h
changeset 4 df6a40031aa5
equal deleted inserted replaced
3:d0e62fc47285 4:df6a40031aa5
       
     1 /*
       
     2  * GraphLCD driver library
       
     3  *
       
     4  * gu256x64-3900.h  -  8-bit driver module for Noritake GU256X64x-3900
       
     5  *                     VFD displays. The VFD is either operating in
       
     6  *                     8-bit mode connected to a single PC parallel
       
     7  *                     port or in serial mode connected to a single PC
       
     8  *                     serial port.
       
     9  *
       
    10  * based on:
       
    11  *   gu256x64-372 driver module for graphlcd
       
    12  *     (c) 2004 Andreas 'randy' Weinberger <randy AT smue.org>
       
    13  *   gu140x32f driver module for graphlcd
       
    14  *     (c) 2003 Andreas Brachold <vdr04 AT deltab.de>
       
    15  *   HD61830 device
       
    16  *     (c) 2001-2003 by Carsten Siebholz <c.siebholz AT t-online.de>
       
    17  *   lcdproc 0.4 driver hd44780-ext8bit
       
    18  *     (c) 1999, 1995 Benjamin Tse <blt AT comports.com>
       
    19  *
       
    20  * This file is released under the GNU General Public License. Refer
       
    21  * to the COPYING file distributed with this package.
       
    22  *
       
    23  * (c) 2004 Ralf Mueller (ralf AT bj-ig.de)
       
    24  */
       
    25 
       
    26 #ifndef _GLCDDRIVERS_GU256X64_3900_H_
       
    27 #define _GLCDDRIVERS_GU256X64_3900_H_
       
    28 
       
    29 #include "driver.h"
       
    30 
       
    31 namespace GLCD
       
    32 {
       
    33 
       
    34 class cDriverConfig;
       
    35 class cParallelPort;
       
    36 
       
    37 class cDriverGU256X64_3900 : public cDriver
       
    38 {
       
    39     cParallelPort * port;
       
    40     int portFd;
       
    41 
       
    42     cDriverConfig * config;
       
    43     cDriverConfig * oldConfig;
       
    44 
       
    45     int m_iSizeYb;
       
    46     int m_nRefreshCounter;
       
    47     int interface;
       
    48     bool useDMA;
       
    49     unsigned char readyMask;
       
    50     unsigned char readyHi;
       
    51 
       
    52     unsigned char ** m_pDrawMem; // the draw "memory"
       
    53     unsigned char ** m_pVFDMem; // the double buffed display "memory"
       
    54 
       
    55     long m_nTimingAdjustCmd;
       
    56     bool m_bSleepIsInit;
       
    57 
       
    58     int CheckSetup();
       
    59 
       
    60 protected:
       
    61     void ClearVFDMem();
       
    62     void SetPixel(int x, int y);
       
    63     int InitSerialPort();
       
    64     int InitParallelPort();
       
    65     void InitNormalDisplay();
       
    66     void InitDMADisplay();
       
    67 
       
    68     void WriteSerial(unsigned char data);
       
    69     void WriteParallel(unsigned char data);
       
    70     void Write(unsigned char data);
       
    71 public:
       
    72     cDriverGU256X64_3900(cDriverConfig * config);
       
    73     virtual ~cDriverGU256X64_3900();
       
    74 
       
    75     virtual int Init();
       
    76     virtual int DeInit();
       
    77 
       
    78     virtual void Clear();
       
    79     virtual void Set8Pixels(int x, int y, unsigned char data);
       
    80     virtual void Refresh(bool refreshAll = false);
       
    81 
       
    82     virtual void SetBrightness(unsigned int percent);
       
    83 };
       
    84 
       
    85 } // end of namespace
       
    86 
       
    87 #endif