Dmitry Kovalev / Mbed 2 deprecated LGstaandart

Dependencies:   mbed

Fork of LG2 by Dmitry Kovalev

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IAP.h Source File

IAP.h

00001 /*****************************************************************************
00002  * $Id$
00003  *
00004  * Project:     NXP LPC1100 Secondary Bootloader Example
00005  *
00006  * Description: Provides access to In-Application Programming (IAP) routines
00007  *              contained within the bootROM sector of LPC1100 devices.
00008  *
00009  * Copyright(C) 2010, NXP Semiconductor
00010  * All rights reserved.
00011  *
00012  *****************************************************************************
00013  * Software that is described herein is for illustrative purposes only
00014  * which provides customers with programming information regarding the
00015  * products. This software is supplied "AS IS" without any warranties.
00016  * NXP Semiconductors assumes no responsibility or liability for the
00017  * use of the software, conveys no license or title under any patent,
00018  * copyright, or mask work right to the product. NXP Semiconductors
00019  * reserves the right to make changes in the software without
00020  * notification. NXP Semiconductors also make no representation or
00021  * warranty that such application will be suitable for the specified
00022  * use without further testing or modification.
00023  *****************************************************************************/
00024 #ifndef __IAP_H
00025 #define __IAP_H
00026 
00027 #include <stdint.h>
00028 
00029 /* IAP Command Status Codes */
00030 #define IAP_STA_CMD_SUCCESS                                 0
00031 #define IAP_STA_INVALID_COMMAND                             1
00032 #define IAP_STA_SRC_ADDR_ERROR                              2
00033 #define IAP_STA_DST_ADDR_ERROR                              3
00034 #define IAP_STA_SRC_ADDR_NOT_MAPPED                         4
00035 #define IAP_STA_DST_ADDR_NOT_MAPPED                         5
00036 #define IAP_STA_COUNT_ERROR                                 6
00037 #define IAP_STA_INVALID_SECTOR                              7
00038 #define IAP_STA_SECTOR_NOT_BLANK                            8
00039 #define IAP_STA_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION     9
00040 #define IAP_STA_COMPARE_ERROR                               10
00041 #define IAP_STA_BUSY                                        11
00042 #define IAP_STA_INVALD_PARAM                                12
00043 
00044 /* Define the flash page size, this is the minimum amount of data can be written in one operation */
00045 #define IAP_FLASH_PAGE_SIZE_BYTES                           256
00046 #define IAP_FLASH_PAGE_SIZE_WORDS                           (IAP_FLASH_PAGE_SIZE_BYTES >> 2)
00047 extern uint32_t u32Status;
00048 void vIAP_ReinvokeISP(void);
00049 uint32_t u32IAP_ReadPartID(uint32_t *pu32PartID);
00050 uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major, uint32_t *pu32Minor);
00051 uint32_t u32IAP_EraseSectors(uint32_t u32StartSector, uint32_t u32EndSector);
00052 uint32_t u32IAP_PrepareSectors(uint32_t u32StartSector, uint32_t u32EndSector);
00053 uint32_t u32IAP_CopyRAMToFlash(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len);
00054 uint32_t u32IAP_BlankCheckSectors(uint32_t u32StartSector, uint32_t u32EndSector, uint32_t *pu32Result);
00055 uint32_t u32IAP_Compare(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len, uint32_t *pu32Offset);
00056 void u32IAP_ReadSerialNumber(uint32_t *pu32byte0, uint32_t *pu32byte1, uint32_t *pu32byte2, uint32_t *pu32byte3);
00057 
00058 #endif /* end __IAP_H */
00059 /*****************************************************************************
00060 **                            End Of File
00061 ******************************************************************************/