//-----------------------------------------------------------------------------
///
/// \brief  Generic spi flash
///
///         Using Microchip SST25VF016B
///
/// \date   20160717
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//-----------------------------------------------------------------------------


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


//---General--------------------------


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

#include <biwak/spi_slave.h>
#include <biwak/flash_spi.hpp>
#include <biwak/biwak.h>
#include <lepto/log.h>
#include <string.h>           // memcpy
#include <arpa/inet.h>        // htons


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


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


/*    Manufacturer: 0xBF   SST
 *                               0x49     SST25VF010A 1MBit, Byte-AAI-program-only
 *                               0x41     SST25VF016B 16MBit, Word-AAI-program-only
 */

/// \brief  Le contructeur
///
CFlashSpi::CFlashSpi( CSpi &_spi, EGpioPeripheral eGpioPeripheralCS, EGpioPin eGpioPinCS )
   :CFlash( 0, 2*1024*1024 )
{
   
}


/// \brief  Le contructeur
///
CFlashSpi::CFlashSpi( ):CFlash( 0, 0 )
{
}


CFlashSpi::~CFlashSpi()
{
   return;
}


int CFlashSpi::readId()
{
   return(0x55667788);
}


int CFlashSpi::readJId()
{
   return(0x12345678);
}


int CFlashSpi::erasePage(address_t addr, int count /*=1*/ )
{
   return(0);
}

int CFlashSpi::readData(address_t addr, void *data, int size)
{

   return(0);
}

int CFlashSpi::writeByte(int addr, uint8_t data)
{

   return(0);
}


int CFlashSpi::eraseChip()
{
   return(0);
}


int CFlashSpi::writeData(address_t addr, const void *data, int size)
{
   int ret=0;
   return(ret);
}


int CFlashSpi::waitForReady()
{
   return(-1);
}


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