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