fork

Dependencies:   mbed

Fork of LG by igor Apu

Committer:
Kovalev_D
Date:
Mon Sep 04 12:55:13 2017 +0000
Revision:
217:15cd8752bb6c
Parent:
136:19b9e6abb86f
dd

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kovalev_D 132:2c7bec5cf6fe 1 /*****************************************************************************
Kovalev_D 132:2c7bec5cf6fe 2 * $Id$
Kovalev_D 130:1421dda4d7e7 3 *
Kovalev_D 132:2c7bec5cf6fe 4 * Project: NXP LPC1100 Secondary Bootloader Example
Kovalev_D 130:1421dda4d7e7 5 *
Kovalev_D 132:2c7bec5cf6fe 6 * Description: Provides access to In-Application Programming (IAP) routines
Kovalev_D 132:2c7bec5cf6fe 7 * contained within the bootROM sector of LPC1100 devices.
Kovalev_D 130:1421dda4d7e7 8 *
Kovalev_D 132:2c7bec5cf6fe 9 * Copyright(C) 2010, NXP Semiconductor
Kovalev_D 132:2c7bec5cf6fe 10 * All rights reserved.
Kovalev_D 130:1421dda4d7e7 11 *
Kovalev_D 132:2c7bec5cf6fe 12 *****************************************************************************
Kovalev_D 132:2c7bec5cf6fe 13 * Software that is described herein is for illustrative purposes only
Kovalev_D 132:2c7bec5cf6fe 14 * which provides customers with programming information regarding the
Kovalev_D 132:2c7bec5cf6fe 15 * products. This software is supplied "AS IS" without any warranties.
Kovalev_D 132:2c7bec5cf6fe 16 * NXP Semiconductors assumes no responsibility or liability for the
Kovalev_D 132:2c7bec5cf6fe 17 * use of the software, conveys no license or title under any patent,
Kovalev_D 132:2c7bec5cf6fe 18 * copyright, or mask work right to the product. NXP Semiconductors
Kovalev_D 132:2c7bec5cf6fe 19 * reserves the right to make changes in the software without
Kovalev_D 132:2c7bec5cf6fe 20 * notification. NXP Semiconductors also make no representation or
Kovalev_D 132:2c7bec5cf6fe 21 * warranty that such application will be suitable for the specified
Kovalev_D 132:2c7bec5cf6fe 22 * use without further testing or modification.
Kovalev_D 132:2c7bec5cf6fe 23 *****************************************************************************/
Kovalev_D 132:2c7bec5cf6fe 24 #ifndef __IAP_H
Kovalev_D 132:2c7bec5cf6fe 25 #define __IAP_H
Kovalev_D 130:1421dda4d7e7 26
Kovalev_D 132:2c7bec5cf6fe 27 #include <stdint.h>
Kovalev_D 130:1421dda4d7e7 28
Kovalev_D 132:2c7bec5cf6fe 29 /* IAP Command Status Codes */
Kovalev_D 132:2c7bec5cf6fe 30 #define IAP_STA_CMD_SUCCESS 0
Kovalev_D 132:2c7bec5cf6fe 31 #define IAP_STA_INVALID_COMMAND 1
Kovalev_D 132:2c7bec5cf6fe 32 #define IAP_STA_SRC_ADDR_ERROR 2
Kovalev_D 132:2c7bec5cf6fe 33 #define IAP_STA_DST_ADDR_ERROR 3
Kovalev_D 132:2c7bec5cf6fe 34 #define IAP_STA_SRC_ADDR_NOT_MAPPED 4
Kovalev_D 132:2c7bec5cf6fe 35 #define IAP_STA_DST_ADDR_NOT_MAPPED 5
Kovalev_D 132:2c7bec5cf6fe 36 #define IAP_STA_COUNT_ERROR 6
Kovalev_D 132:2c7bec5cf6fe 37 #define IAP_STA_INVALID_SECTOR 7
Kovalev_D 132:2c7bec5cf6fe 38 #define IAP_STA_SECTOR_NOT_BLANK 8
Kovalev_D 132:2c7bec5cf6fe 39 #define IAP_STA_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION 9
Kovalev_D 132:2c7bec5cf6fe 40 #define IAP_STA_COMPARE_ERROR 10
Kovalev_D 132:2c7bec5cf6fe 41 #define IAP_STA_BUSY 11
Kovalev_D 132:2c7bec5cf6fe 42 #define IAP_STA_INVALD_PARAM 12
Kovalev_D 130:1421dda4d7e7 43
Kovalev_D 132:2c7bec5cf6fe 44 /* Define the flash page size, this is the minimum amount of data can be written in one operation */
Kovalev_D 132:2c7bec5cf6fe 45 #define IAP_FLASH_PAGE_SIZE_BYTES 256
Kovalev_D 132:2c7bec5cf6fe 46 #define IAP_FLASH_PAGE_SIZE_WORDS (IAP_FLASH_PAGE_SIZE_BYTES >> 2)
Kovalev_D 136:19b9e6abb86f 47 extern uint32_t u32Status;
Kovalev_D 132:2c7bec5cf6fe 48 void vIAP_ReinvokeISP(void);
Kovalev_D 132:2c7bec5cf6fe 49 uint32_t u32IAP_ReadPartID(uint32_t *pu32PartID);
Kovalev_D 132:2c7bec5cf6fe 50 uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major, uint32_t *pu32Minor);
Kovalev_D 132:2c7bec5cf6fe 51 uint32_t u32IAP_EraseSectors(uint32_t u32StartSector, uint32_t u32EndSector);
Kovalev_D 132:2c7bec5cf6fe 52 uint32_t u32IAP_PrepareSectors(uint32_t u32StartSector, uint32_t u32EndSector);
Kovalev_D 132:2c7bec5cf6fe 53 uint32_t u32IAP_CopyRAMToFlash(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len);
Kovalev_D 132:2c7bec5cf6fe 54 uint32_t u32IAP_BlankCheckSectors(uint32_t u32StartSector, uint32_t u32EndSector, uint32_t *pu32Result);
Kovalev_D 132:2c7bec5cf6fe 55 uint32_t u32IAP_Compare(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len, uint32_t *pu32Offset);
Kovalev_D 132:2c7bec5cf6fe 56 void u32IAP_ReadSerialNumber(uint32_t *pu32byte0, uint32_t *pu32byte1, uint32_t *pu32byte2, uint32_t *pu32byte3);
Kovalev_D 130:1421dda4d7e7 57
Kovalev_D 132:2c7bec5cf6fe 58 #endif /* end __IAP_H */
Kovalev_D 132:2c7bec5cf6fe 59 /*****************************************************************************
Kovalev_D 132:2c7bec5cf6fe 60 ** End Of File
Kovalev_D 132:2c7bec5cf6fe 61 ******************************************************************************/