PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

Committer:
Pokitto
Date:
Tue Jan 30 10:41:47 2018 +0000
Revision:
31:f4b9b85c7b62
Sound output improvements added:  louder, clearer, faster!

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pokitto 31:f4b9b85c7b62 1 #ifndef IAP_H_INCLUDED
Pokitto 31:f4b9b85c7b62 2 #define IAP_H_INCLUDED
Pokitto 31:f4b9b85c7b62 3
Pokitto 31:f4b9b85c7b62 4 extern int HelloFromIAP();
Pokitto 31:f4b9b85c7b62 5 extern int CopyPageToFlash(uint32_t,uint8_t*);
Pokitto 31:f4b9b85c7b62 6 extern char iaptest();
Pokitto 31:f4b9b85c7b62 7 extern void IAPstacksave();
Pokitto 31:f4b9b85c7b62 8 #define EEPROM_PROFILE 1
Pokitto 31:f4b9b85c7b62 9 extern void writeEEPROM( uint16_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount );
Pokitto 31:f4b9b85c7b62 10 extern void readEEPROM( uint16_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount );
Pokitto 31:f4b9b85c7b62 11 extern uint8_t eeprom_read_byte(uint16_t*);
Pokitto 31:f4b9b85c7b62 12 extern void eeprom_write_byte(uint16_t*,uint8_t);
Pokitto 31:f4b9b85c7b62 13
Pokitto 31:f4b9b85c7b62 14 /*****************************************************************************
Pokitto 31:f4b9b85c7b62 15 * $Id$
Pokitto 31:f4b9b85c7b62 16 *
Pokitto 31:f4b9b85c7b62 17 * Project: NXP LPC1100 Secondary Bootloader Example
Pokitto 31:f4b9b85c7b62 18 *
Pokitto 31:f4b9b85c7b62 19 * Description: Provides access to In-Application Programming (IAP) routines
Pokitto 31:f4b9b85c7b62 20 * contained within the bootROM sector of LPC1100 devices.
Pokitto 31:f4b9b85c7b62 21 *
Pokitto 31:f4b9b85c7b62 22 * Copyright(C) 2010, NXP Semiconductor
Pokitto 31:f4b9b85c7b62 23 * All rights reserved.
Pokitto 31:f4b9b85c7b62 24 *
Pokitto 31:f4b9b85c7b62 25 *****************************************************************************
Pokitto 31:f4b9b85c7b62 26 * Software that is described herein is for illustrative purposes only
Pokitto 31:f4b9b85c7b62 27 * which provides customers with programming information regarding the
Pokitto 31:f4b9b85c7b62 28 * products. This software is supplied "AS IS" without any warranties.
Pokitto 31:f4b9b85c7b62 29 * NXP Semiconductors assumes no responsibility or liability for the
Pokitto 31:f4b9b85c7b62 30 * use of the software, conveys no license or title under any patent,
Pokitto 31:f4b9b85c7b62 31 * copyright, or mask work right to the product. NXP Semiconductors
Pokitto 31:f4b9b85c7b62 32 * reserves the right to make changes in the software without
Pokitto 31:f4b9b85c7b62 33 * notification. NXP Semiconductors also make no representation or
Pokitto 31:f4b9b85c7b62 34 * warranty that such application will be suitable for the specified
Pokitto 31:f4b9b85c7b62 35 * use without further testing or modification.
Pokitto 31:f4b9b85c7b62 36 *****************************************************************************/
Pokitto 31:f4b9b85c7b62 37
Pokitto 31:f4b9b85c7b62 38 #include <stdint.h>
Pokitto 31:f4b9b85c7b62 39
Pokitto 31:f4b9b85c7b62 40 /* IAP Command Status Codes */
Pokitto 31:f4b9b85c7b62 41 #define IAP_STA_CMD_SUCCESS 0
Pokitto 31:f4b9b85c7b62 42 #define IAP_STA_INVALID_COMMAND 1
Pokitto 31:f4b9b85c7b62 43 #define IAP_STA_SRC_ADDR_ERROR 2
Pokitto 31:f4b9b85c7b62 44 #define IAP_STA_DST_ADDR_ERROR 3
Pokitto 31:f4b9b85c7b62 45 #define IAP_STA_SRC_ADDR_NOT_MAPPED 4
Pokitto 31:f4b9b85c7b62 46 #define IAP_STA_DST_ADDR_NOT_MAPPED 5
Pokitto 31:f4b9b85c7b62 47 #define IAP_STA_COUNT_ERROR 6
Pokitto 31:f4b9b85c7b62 48 #define IAP_STA_INVALID_SECTOR 7
Pokitto 31:f4b9b85c7b62 49 #define IAP_STA_SECTOR_NOT_BLANK 8
Pokitto 31:f4b9b85c7b62 50 #define IAP_STA_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION 9
Pokitto 31:f4b9b85c7b62 51 #define IAP_STA_COMPARE_ERROR 10
Pokitto 31:f4b9b85c7b62 52 #define IAP_STA_BUSY 11
Pokitto 31:f4b9b85c7b62 53 #define IAP_STA_INVALD_PARAM 12
Pokitto 31:f4b9b85c7b62 54
Pokitto 31:f4b9b85c7b62 55 /* Define the flash page size, this is the minimum amount of data can be written in one operation */
Pokitto 31:f4b9b85c7b62 56 #define IAP_FLASH_PAGE_SIZE_BYTES 256
Pokitto 31:f4b9b85c7b62 57 #define IAP_FLASH_PAGE_SIZE_WORDS (IAP_FLASH_PAGE_SIZE_BYTES >> 2)
Pokitto 31:f4b9b85c7b62 58
Pokitto 31:f4b9b85c7b62 59 void vIAP_ReinvokeISP(void);
Pokitto 31:f4b9b85c7b62 60 uint32_t u32IAP_ReadPartID(uint32_t *pu32PartID);
Pokitto 31:f4b9b85c7b62 61 uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major, uint32_t *pu32Minor);
Pokitto 31:f4b9b85c7b62 62 //uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major);
Pokitto 31:f4b9b85c7b62 63 uint32_t u32IAP_EraseSectors(uint32_t u32StartSector, uint32_t u32EndSector);
Pokitto 31:f4b9b85c7b62 64 uint32_t u32IAP_PrepareSectors(uint32_t u32StartSector, uint32_t u32EndSector);
Pokitto 31:f4b9b85c7b62 65 uint32_t u32IAP_CopyRAMToFlash(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len);
Pokitto 31:f4b9b85c7b62 66 uint32_t u32IAP_BlankCheckSectors(uint32_t u32StartSector, uint32_t u32EndSector, uint32_t *pu32Result);
Pokitto 31:f4b9b85c7b62 67 uint32_t u32IAP_Compare(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len, uint32_t *pu32Offset);
Pokitto 31:f4b9b85c7b62 68 uint32_t u32IAP_ReadUID(uint32_t * pu32UID);
Pokitto 31:f4b9b85c7b62 69 uint32_t u32IAP_ErasePage(uint32_t u32StartPage, uint32_t u32EndPage);
Pokitto 31:f4b9b85c7b62 70
Pokitto 31:f4b9b85c7b62 71 /*****************************************************************************
Pokitto 31:f4b9b85c7b62 72 ** End Of File
Pokitto 31:f4b9b85c7b62 73 ******************************************************************************/
Pokitto 31:f4b9b85c7b62 74
Pokitto 31:f4b9b85c7b62 75
Pokitto 31:f4b9b85c7b62 76
Pokitto 31:f4b9b85c7b62 77 #endif /* IAP_H_INCLUDED */
Pokitto 31:f4b9b85c7b62 78
Pokitto 31:f4b9b85c7b62 79