From ba78bd9ba834260d035a9830726afc34fdad2a15 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 18 Oct 2009 23:32:54 +0200 Subject: import firmware from LEGO v1.05 --- AT91SAM7S256/Source/c_loader.iom | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 AT91SAM7S256/Source/c_loader.iom (limited to 'AT91SAM7S256/Source/c_loader.iom') diff --git a/AT91SAM7S256/Source/c_loader.iom b/AT91SAM7S256/Source/c_loader.iom new file mode 100644 index 0000000..8a86e2d --- /dev/null +++ b/AT91SAM7S256/Source/c_loader.iom @@ -0,0 +1,83 @@ +// +// Date init 14.12.2004 +// +// Revision date $Date:: 28-03-07 14:54 $ +// +// Filename $Workfile:: c_loader.iom $ +// +// Version $Revision:: 45 $ +// +// Archive $Archive:: /LMS2006/Sys01/Main/Firmware/Source/c_loader.i $ +// +// Platform C +// + +#ifndef CLOADER_IOM +#define CLOADER_IOM + +#define pMapLoader ((IOMAPLOADER*)(pHeaders[ENTRY_LOADER]->pIOMap)) + +//Version numbers are two bytes, MAJOR.MINOR (big-endian) +//For example, version 1.5 would be 0x0105 +//If these switch to little-endian, be sure to update +//definition and usages of VM_OLDEST_COMPATIBLE_VERSION, too! +#define FIRMWAREVERSION 0x0105 //1.05 +#define PROTOCOLVERSION 0x017C //1.124 + +enum +{ + OPENREAD = 0x80, + OPENWRITE = 0x81, + READ = 0x82, + WRITE = 0x83, + CLOSE = 0x84, + DELETE = 0x85, + FINDFIRST = 0x86, + FINDNEXT = 0x87, + VERSIONS = 0x88, + OPENWRITELINEAR = 0x89, + OPENREADLINEAR = 0x8A, + OPENWRITEDATA = 0x8B, + OPENAPPENDDATA = 0x8C, + FINDFIRSTMODULE = 0x90, + FINDNEXTMODULE = 0x91, + CLOSEMODHANDLE = 0x92, + IOMAPREAD = 0x94, + IOMAPWRITE = 0x95, + BOOTCMD = 0x97, /* external command only */ + SETBRICKNAME = 0x98, + BTGETADR = 0x9A, + DEVICEINFO = 0x9B, + DELETEUSERFLASH = 0xA0, + POLLCMDLEN = 0xA1, + POLLCMD = 0xA2, + RENAMEFILE = 0xA3, + BTFACTORYRESET = 0xA4 + +}; + +typedef UWORD LOADER_STATUS; + +//Mask out handle byte of Loader status word for error code checks +#define LOADER_ERR(StatusWord) ((StatusWord & 0xFF00)) + +//Byte value of error half of Loader status word +#define LOADER_ERR_BYTE(StatusWord) ((UBYTE)((StatusWord & 0xFF00) >> 8)) + +//Value of handle inside Loader status word +#define LOADER_HANDLE(StatusWord) ((UBYTE)(StatusWord)) + +//Pointer to lower byte of Loader status word +#define LOADER_HANDLE_P(StatusWord) ((UBYTE*)(&StatusWord)) + +typedef struct +{ + UWORD (*pFunc)(UBYTE, UBYTE *, UBYTE *, ULONG *); + ULONG FreeUserFlash; +}IOMAPLOADER; + + +#endif + + + -- cgit v1.2.3