373a8c32b2
git-svn-id: file:///srv/dev-disk-by-uuid-17e88007-4d0c-45e0-8757-cacfcc458630/repositories/svn/Diplomarbeit@55 9fe90eed-be63-e94b-8204-d34ff4c2ff93
93 lines
3.5 KiB
C
93 lines
3.5 KiB
C
/* ---------------------------------------------------------------------------
|
|
* InternalFlash.h - v0.1 (c) 2008 Micro-key bv
|
|
* ---------------------------------------------------------------------------
|
|
* Micro-key bv
|
|
* Industrieweg 28, 9804 TG Noordhorn
|
|
* Postbus 92, 9800 AB Zuidhorn
|
|
* The Netherlands
|
|
* Tel: +31 594 503020
|
|
* Fax: +31 594 505825
|
|
* Email: support@microkey.nl
|
|
* Web: www.microkey.nl
|
|
* ---------------------------------------------------------------------------
|
|
* Description:
|
|
* ---------------------------------------------------------------------------
|
|
* Version(s): 0.1, Feb 11, 2008, FSc
|
|
* Creation.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
#ifndef __INTERNALFLASH_H__
|
|
#define __INTERNALFLASH_H__
|
|
/** \file InternalFlash.h
|
|
\brief
|
|
*/
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* System include files.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Application include files.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Constant and macro definitions.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
typedef enum
|
|
{
|
|
CMD_SUCCESS = 0,
|
|
INVALID_COMMAND = 1,
|
|
SRC_ADDR_ERROR = 2,
|
|
DST_ADDR_ERROR = 3,
|
|
SRC_ADDR_NOT_MAPPED = 4,
|
|
DST_ADDR_NOT_MAPPED = 5,
|
|
COUNT_ERROR = 6,
|
|
INVALID_SECTOR = 7,
|
|
SECTOR_NOT_BLANK = 8,
|
|
SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION = 9,
|
|
COMPARE_ERROR = 10,
|
|
BUSY = 11
|
|
} iflashresult;
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Type definitions.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Variable declarations.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Function declarations.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
|
|
/** \brief Initialises the internal flash module */
|
|
void iflashInit();
|
|
|
|
/** \brief Prepares the flash for erasing and programming (must be called before these actions) */
|
|
iflashresult iflashPrepare(UINT8 beginSector, UINT8 endSector);
|
|
|
|
/** \brief Erases one sector on the internal flash */
|
|
iflashresult iflashErase( UINT8 sector );
|
|
|
|
/** \brief Programs some data on the flash */
|
|
iflashresult iflashProgram( UINT32 address, UINT16 dataLength, UINT8 *data);
|
|
|
|
/** \brief Compares the data with the data on the internal flash on location "address" */
|
|
iflashresult iflashVerify( UINT32 address, UINT16 dataLength, UINT8 *data);
|
|
|
|
/** \brief This command is used to read the part identification number. */
|
|
UINT32 iflashReadPartId();
|
|
|
|
/** \brief This command is used to read the boot code version number. */
|
|
UINT32 iflashReadBootcodeVersionNr();
|
|
|
|
|
|
#endif /* __INTERNALFLASH_H__ */
|