#ifndef CAMPO_LAYOUTS_V4_H
#define CAMPO_LAYOUTS_V4_H
//----------------------------------------------------------------------------
///
/// \brief  Campo layouts
///
///         EEPROM layouts for various boards
//
/// \date   20211214
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//----------------------------------------------------------------------------


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

#include <stdint.h>

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


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


namespace V4{};
#if ! defined( BOARDINFO_LAYOUT_MINOR )

   #define BOARDINFO_LAYOUT_MAJOR     4
   #define BOARDINFO_LAYOUT_MINOR     0
   using namespace V4;

#endif


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


namespace V4{

struct SEepromBoardInfo
{
   struct
   {
      char magic;                   // 0x0: 'H'
      uint16_t articleId;           // 0x1
      uint8_t  boardCode;           // 0x3
   }__attribute ((packed)) main;

   struct
   {
      char major;                   // 0x4
      char minor;                   // 0x5
      char patch;                   // 0x6: actually patched with flying wires
      char variant;                 // 0x7: Valid Solder options; The used BOM/Patch
   }__attribute ((packed)) version;

   struct
   {
      uint32_t serialNumber;        // 0x8
      uint16_t dateYear;            // 0xC
      uint8_t dateMonth;            // 0xE
      uint8_t dateDay;              // 0xF
   }__attribute ((packed)) production;

   struct
   {
      uint16_t variant;              // 0x10: For single-PCB-products; e.g. Miniminutnik 'Corona'
      uint16_t reserved1;            // 0x12
   }__attribute ((packed)) product;
                                     // 0x14

} __attribute ((packed));

} // V4

//---fin----------------------------------------------------------------------
#endif // ? ! CAMPO_LAYOUTS_V4_H
