/*
 * flashUtilities.h
 *
 *  Created on: 21.4.2010
 *      Author: hudo
 */

#ifndef FLASHUTILITIES_H_
#define FLASHUTILITIES_H_
/*********************************DEFINITIONS*********************************/

#define FLASH_PROGRAM_ADDR(x) \
  (*(volatile unsigned long *)(void *)(&__IPSBAR[(0x04000000 + (x))]))

#define FLASH_READ_ADDR(x) \
  (*(volatile unsigned long *)(void *) x)
#define	WRITELONGWORD	0x20
#define	PAGEERASE		0x40
#define TESTADDRESS		0x6000

vuint8 flashsemaphore = 1;

/*****************************FUNCTION PROTOTYPES*****************************/
void CFMinit(void);
void CFMrom2ram(uint32 address,uint32 value, uint32 command);
void CFMcommand(uint32 address, uint32 value, uint32 command);
void CFMcommandEND(void);

#endif /* FLASHUTILITIES_H_ */
