#ifndef _TSC_H_
#define _TSC_H_
//----------------------------------------------------------------------------
///
/// \brief  TSC
///
///         See implementation files for further information.
//
/// \date   20181020
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//----------------------------------------------------------------------------


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


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

#if defined MCU_PLATFORM_STM32
   #include <HALWrapper/stm32_tsc.h>
#endif

#if ! defined DAC_CHANNEL_1
   #define DAC_HandleTypeDef    void
#endif

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


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



//---Declaration--------------------------------------------------------------

#if ! defined (STM32F4)

class CTsc
      //:public CGpio
{
   private:
      TSC_HandleTypeDef *m_pHandler;
      CGpio gpioCap;
      CGpio gpioIo;

      //ETsc eTsc;
   public:

      CTsc( EGpioPeripheral, EGpioPin, EGpioPeripheral, EGpioPin
            //EDac _eDac
            /*, EGpioPeripheral _eGpioPeripheral1, EGpioPin _eGpioPin1
                  , CDmaChannel *dmaChannel1, ETimer _eTimer1
                  , EGpioPeripheral _eGpioPeripheral2, EGpioPin _eGpioPin2
                  , CDmaChannel *dmaChannel2, ETimer _eTimer2 */
            );
      void init();
      ~CTsc();

      TSC_HandleTypeDef *getHandler()
      {
         return(m_pHandler);
      };
      uint32_t getValue();
      uint32_t getStatus();
      void poll();
      void aquire();
};

#endif

//---fin----------------------------------------------------------------------
#endif // ? ! _TSC_H_
