#ifndef _EADISPLAY_H_
#define _EADISPLAY_H_
//----------------------------------------------------------------------------
///
/// \brief  "Electronic Assembly" Display
///
///         See implementation files for further information.
///
/// \date   20141217
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//----------------------------------------------------------------------------


//---Includes-----------------------------------------------------------------


//---Own------------------------------

#include <biwak/output.h>

//---Declaration--------------------------------------------------------------
typedef COutput COutputArray[];

class CEaDisplay
{
   private:
      COutput *output[4];
      COutput &outRs;
      COutput &outEnable;
      int yPos, xPos;

      static const int byteDelay;
      static const int csEnableDelay;
      static const int csDisableDelay;
      static const int busDelay;
      static const int clearDelay;

   public:

      CEaDisplay( COutput *_output[4], COutput &_outRs, COutput &_outEnable);
      /*
       * CEaDisplay( int dumm )
         :output( {COutput(), COutput(), COutput(), COutput(),} )
      {};
      */
      ~CEaDisplay();
      void reset();
      void sendNibble (uint32_t data);
      void writeIns (uint32_t data);
      void writeData (uint32_t data);
      void CheckBusy();
      void putString(const char *string);
      void putChar(const char ch);
      void gotoxy(int x, int y);
      int width()
      {
         return(64);
      }
      void enableCursor(bool enable)
      {
         int value=0xF;
         value&=~3;
         value|=enable?3:0;
         writeIns(value);
      }

      /*
      COutput &getOutput()
      {
         return(output);
      }
      */
};


//---fin----------------------------------------------------------------------
#endif // ? ! _EADISPLAY_H_
