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

Committer:
spinal
Date:
Sun Nov 18 15:47:54 2018 +0000
Revision:
64:6e6c6c2b664e
Parent:
36:771321e70814
added fix for directrectangle()

Who changed what in which revision?

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