#ifndef FLASH_H
#define FLASH_H

/*!
  \file
  \brief ターゲット側の書き込みプログラム

  \author Satofumi KAMIMURA

  $Id: flash.h 1106 2009-07-01 22:50:20Z satofumi $
*/

extern int flash_data(unsigned long addr, const char *data);


#define FLMCR1_ADDR 0xffff8580
#define WDT_TCSR_ADDR 0xffff8610
#define WDT_RSTCSR_ADDR 0xffff8612
#define WDT_RESET 0x5a5f
#define WDT_573u 0xa579
#define WDT_STOP 0xa55f
#define WAIT_200u 800
#define WAIT_50u 200
#define WAIT_10u 40
#define WAIT_4u 16
#define WAIT_2u 8
#define WRITE_TIMES 1000

#define FLM (*(volatile struct st_flm *)FLMCR1_ADDR)
#define WDT_TCSR_WORD (*(volatile short *)WDT_TCSR_ADDR)
#define WDT_RSTCSR_WORD (*(volatile short *)WDT_RSTCSR_ADDR)

#endif /* !FLASH_H */
