#ifndef FLASH_DEFINES_H_
#define FLASH_DEFINES_H_

#define TMS470M
//#define CONST_FREQ 8                                 // Value is half of HCLK,
												      // Run from Oscillator, HCLK should be 16MHz

#include "flash470.h"

typedef struct Sectors
{ void * start;
  uint32 length;  // number of 32-bit words
  FLASH_CORE bank;
  uint32 sectorNumber;
  uint32 FlashBaseAddress;
} SECTORS;

typedef struct Banks
{ void * start;
  uint32 length;  // number of bytes
  uint32 bankNumber;
  uint32 FlashBaseAddress;
  uint32 psa;
} BANKS;


#ifdef TMS470M
#define F035
#define NUMBEROFSECTORS 15
#define NUMBEROFBANKS 2
#define NUMBEROFECC_PARITYBANKS 2

const SECTORS sector[NUMBEROFSECTORS]=
{
  (void *)0x00000000, 0x04000, FLASH_CORE0, 0, 0xfff87000,
  (void *)0x00004000, 0x04000, FLASH_CORE0, 1, 0xfff87000,
  (void *)0x00008000, 0x08000, FLASH_CORE0, 2, 0xfff87000,
  (void *)0x00010000, 0x10000, FLASH_CORE0, 3, 0xfff87000,
  (void *)0x00020000, 0x10000, FLASH_CORE0, 4, 0xfff87000,
  (void *)0x00030000, 0x10000, FLASH_CORE0, 5, 0xfff87000,
  (void *)0x00040000, 0x10000, FLASH_CORE0, 6, 0xfff87000,
  (void *)0x00050000, 0x10000, FLASH_CORE0, 7, 0xfff87000,
  (void *)0x00060000, 0x10000, FLASH_CORE0, 8, 0xfff87000,
  (void *)0x00070000, 0x10000, FLASH_CORE0, 9, 0xfff87000,
  (void *)0x00080000, 0x04000, FLASH_CORE1, 0, 0xfff87000,
  (void *)0x00084000, 0x04000, FLASH_CORE1, 1, 0xfff87000,
  (void *)0x00088000, 0x04000, FLASH_CORE1, 2, 0xfff87000,
  (void *)0x0008C000, 0x04000, FLASH_CORE1, 3, 0xfff87000,
  (void *)0x00090000, 0x10000, FLASH_CORE1, 4, 0xfff87000
};


const BANKS bank[NUMBEROFBANKS]=
{
  (void *) 0x00000000, 0x80000, 0, 0xfff87000, 0x00000000,
  (void *) 0x00080000, 0x20000, 1, 0xfff87000, 0x00000000
};


const BANKS ecc_parity[NUMBEROFECC_PARITYBANKS]=
{
  (void *) 0x00400000, 0x40000, 0, 0xfff87000, 0x00000000,
  (void *) 0x00440000, 0x10000, 1, 0xfff87000, 0x00000000
};


#endif   /* Antares */

#endif /* FLASH_DEFINES_H_ */
