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

Dependents:   YATTT sd_map_test cPong SnowDemo ... more

PokittoLib

Library for programming Pokitto hardware

How to Use

  1. Import this library to online compiler (see button "import" on the right hand side
  2. DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
  3. Change My_settings.h according to your project
  4. Start coding!
Committer:
Pokitto
Date:
Fri Jan 05 02:19:51 2018 +0000
Revision:
28:958b71c4b92a
Parent:
0:e8b8f36b4505
Sound level stored in EEPROM, sound output improved

Who changed what in which revision?

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