PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)
Fork of PokittoLib by
iap.h
00001 #ifndef IAP_H_INCLUDED 00002 #define IAP_H_INCLUDED 00003 00004 extern int HelloFromIAP(); 00005 extern int CopyPageToFlash(uint32_t,uint8_t*); 00006 extern char iaptest(); 00007 extern void IAPstacksave(); 00008 #define EEPROM_PROFILE 1 00009 extern void writeEEPROM( uint8_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount ); 00010 extern void readEEPROM( uint8_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount ); 00011 extern uint8_t eeprom_read_byte(uint8_t*); 00012 extern void eeprom_write_byte(uint8_t*,uint8_t); 00013 00014 /***************************************************************************** 00015 * $Id$ 00016 * 00017 * Project: NXP LPC1100 Secondary Bootloader Example 00018 * 00019 * Description: Provides access to In-Application Programming (IAP) routines 00020 * contained within the bootROM sector of LPC1100 devices. 00021 * 00022 * Copyright(C) 2010, NXP Semiconductor 00023 * All rights reserved. 00024 * 00025 ***************************************************************************** 00026 * Software that is described herein is for illustrative purposes only 00027 * which provides customers with programming information regarding the 00028 * products. This software is supplied "AS IS" without any warranties. 00029 * NXP Semiconductors assumes no responsibility or liability for the 00030 * use of the software, conveys no license or title under any patent, 00031 * copyright, or mask work right to the product. NXP Semiconductors 00032 * reserves the right to make changes in the software without 00033 * notification. NXP Semiconductors also make no representation or 00034 * warranty that such application will be suitable for the specified 00035 * use without further testing or modification. 00036 *****************************************************************************/ 00037 00038 #include <stdint.h> 00039 00040 /* IAP Command Status Codes */ 00041 #define IAP_STA_CMD_SUCCESS 0 00042 #define IAP_STA_INVALID_COMMAND 1 00043 #define IAP_STA_SRC_ADDR_ERROR 2 00044 #define IAP_STA_DST_ADDR_ERROR 3 00045 #define IAP_STA_SRC_ADDR_NOT_MAPPED 4 00046 #define IAP_STA_DST_ADDR_NOT_MAPPED 5 00047 #define IAP_STA_COUNT_ERROR 6 00048 #define IAP_STA_INVALID_SECTOR 7 00049 #define IAP_STA_SECTOR_NOT_BLANK 8 00050 #define IAP_STA_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION 9 00051 #define IAP_STA_COMPARE_ERROR 10 00052 #define IAP_STA_BUSY 11 00053 #define IAP_STA_INVALD_PARAM 12 00054 00055 /* Define the flash page size, this is the minimum amount of data can be written in one operation */ 00056 #define IAP_FLASH_PAGE_SIZE_BYTES 256 00057 #define IAP_FLASH_PAGE_SIZE_WORDS (IAP_FLASH_PAGE_SIZE_BYTES >> 2) 00058 00059 void vIAP_ReinvokeISP(void); 00060 uint32_t u32IAP_ReadPartID(uint32_t *pu32PartID); 00061 uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major, uint32_t *pu32Minor); 00062 //uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major); 00063 uint32_t u32IAP_EraseSectors(uint32_t u32StartSector, uint32_t u32EndSector); 00064 uint32_t u32IAP_PrepareSectors(uint32_t u32StartSector, uint32_t u32EndSector); 00065 uint32_t u32IAP_CopyRAMToFlash(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len); 00066 uint32_t u32IAP_BlankCheckSectors(uint32_t u32StartSector, uint32_t u32EndSector, uint32_t *pu32Result); 00067 uint32_t u32IAP_Compare(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len, uint32_t *pu32Offset); 00068 uint32_t u32IAP_ReadUID(uint32_t * pu32UID); 00069 uint32_t u32IAP_ErasePage(uint32_t u32StartPage, uint32_t u32EndPage); 00070 00071 /***************************************************************************** 00072 ** End Of File 00073 ******************************************************************************/ 00074 00075 00076 00077 #endif /* IAP_H_INCLUDED */ 00078
Generated on Tue Jul 12 2022 18:08:12 by 1.7.2