#ifndef BIWAK_EEPROM_INTERN_H_
#define BIWAK_EEPROM_INTERN_H_
//----------------------------------------------------------------------------
///
/// \brief  Intern EEPROM
///
///         See implementation files for further information.
//
/// \date   20211214
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//----------------------------------------------------------------------------


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

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

#include <lepto/lepto.h>      // address_t
#include <biwak/flash.h>      // address_t
//#include <HALWrapper/stm32_eeprom.h>
//#include <HALWrapper/stm32_flash.h>


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



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


class CEepromIntern
         :public CFlash
{

   private:

   public:
      CEepromIntern( );
      void init();
      ~CEepromIntern();

      virtual int writeData(address_t address, const void *data, int size) override;
      virtual int readData(address_t address, void *data, int size) override;
      virtual int erasePage(address_t page, int count=1) override;
      /*
      virtual int erasePageSize() const override
      {
         // The page size is actually '1', but to avoid imense calls of
         // erasePage by CFlash, '0x10' is assumed
         return(2);
      };
      */
      void lock() const;
};


//---fin----------------------------------------------------------------------
#endif // ? ! BIWAK_EEPROM_INTERN_H_
