//-----------------------------------------------------------------------------
///
/// \brief  Shift register; Piso or Sipo
///
///         See implementation for further details
///
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//-----------------------------------------------------------------------------


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


#include <biwak/biwak.h>
#include <biwak/gpio.hpp>
#include <biwak/output.hpp>


//---Defines------------------------------------------------------------------


//---Declarations-------------------------------------------------------------


class CShift
{
   private:
      COutput gpioClk;
      CGpio gpioData;
      COutput gpioStore;
      int   bitCount;
      int   data;

   public:
      CShift( EGpioPeripheral peripheralClk, EGpioPin pinClk,
              EGpioPeripheral peripheralData, EGpioPin pinData,
              EGpioPeripheral peripheralStore, EGpioPin pinStore,
              int _bitCount = 32
              );

      void setPinOutput(int index, bool value = true, bool doFlush = true);
      void setBitCount(int _bitCount){
         bitCount=_bitCount;
         return;
      };
      void setOutput(int data);
      void flush(int index, bool value);

};


//---fin----------------------------------------------------------------------
