//-----------------------------------------------------------------------------
///
/// \brief  QSPI
///
///         Blah blah blub
///
/// \date   20220707
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//-----------------------------------------------------------------------------


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


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

#define LEPTO_LOG_DEBUG_ASSERT

#include <biwak/biwak.h>         // exception
#include <biwak/sd.hpp>
#include <biwak/handler.h>
#include <biwak/systick.h>       // usleep
#include <biwak/linux/sd.hpp>

#include <lepto/log.h>

//---Implementation------------------------------------------------------------


CSd::CSd( const SSdConfig &_configData)
   //:eSpi(_eSpi)
   :configData(_configData)
   ,m_gpioCk(configData.eGpioPeripheralCk, configData.eGpioPinCk, gpioModeSD, configData.altFunc)
   ,m_gpioCmd(configData.eGpioPeripheralCmd, configData.eGpioPinCmd, gpioModeSD, configData.altFunc)
   ,m_gpioD0(configData.eGpioPeripheralD0, configData.eGpioPinD0, gpioModeSD, configData.altFunc)
   ,m_gpioD1(configData.eGpioPeripheralD1, configData.eGpioPinD1, gpioModeSD, configData.altFunc)
   ,m_gpioD2(configData.eGpioPeripheralD2, configData.eGpioPinD2, gpioModeSD, configData.altFunc)
   ,m_gpioD3(configData.eGpioPeripheralD3, configData.eGpioPinD3, gpioModeSD, configData.altFunc)
{
   //m_pHandler = new SD_HandleTypeDef;
   init();
}


CSd::~CSd()
{
}


int CSd::init()
{
   int sta=0;
   return(sta);
}


void CSd::info()
{
   return;
}


int CSd::read(void *data, int addr, size_t blocks) const
{
   return( -1 );
}


int CSd::write(const void *data, int addr, size_t blocks) const
{
   return( -1 );
}


int CSd::erase(int addr)
{
   return( -1 );
}


int CSd::errorCode()
{
   return(-3);
}


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