supported LPC11U35

Fork of IAP by Tedd OKANO

Embed: (wiki syntax)

« Back to documentation index

IAP Class Reference

IAP Class Reference

IAP class. More...

#include <IAP.h>

Public Member Functions

 IAP ()
 Constructor for IAP.
int reinvoke_isp (void)
 Reinvoke ISP.
int read_ID (void)
 Read part identification number.
int * read_serial (void)
 Read device serial number.
int blank_check (int start, int end)
 Blank check sector(s)
int erase (int start, int end)
 Erase Sector(s)
int prepare (int start, int end)
 Prepare sector(s) for write operation.
int write (char *source_addr, char *target_addr, int size)
 Copy RAM to Flash.
int compare (char *source_addr, char *target_addr, int size)
 Compare <address1> <address2> <no of="" bytes>="">
int read_BootVer (void)
 Read Boot code version number.
char * reserved_flash_area_start (void)
 Get user reserved flash start address.
int reserved_flash_area_size (void)
 Get user reserved flash size.
int write_eeprom (char *source_addr, char *target_addr, int size)
 Copy RAM to EEPROM (LPC11U24)
int read_eeprom (char *source_addr, char *target_addr, int size)
 Copy EEPROM to RAM (LPC11U24)
int erase_page (int start, int end)
 Erase page(s) (LPC812, LPC824)

Detailed Description

IAP class.

Interface for internal flash memory access

Definition at line 406 of file IAP.h.


Constructor & Destructor Documentation

IAP (  )

Constructor for IAP.

Definition at line 413 of file IAP.h.


Member Function Documentation

int blank_check ( int  start,
int  end 
)

Blank check sector(s)

Parameters:
starta Start Sector Number
endan End Sector Number (should be greater than or equal to start sector number).
Returns:
error code: CMD_SUCCESS | BUSY | SECTOR_NOT_BLANK | INVALID_SECTOR

Definition at line 102 of file IAP.cpp.

int compare ( char *  source_addr,
char *  target_addr,
int  size 
)

Compare <address1> <address2> <no of="" bytes>="">

Parameters:
source_addrStarting flash or RAM address of data bytes to be compared. This address should be a word boundary.
target_addrStarting flash or RAM address of data bytes to be compared. This address should be a word boundary.
sizeNumber of bytes to be compared; should be a multiple of 4.
Returns:
error code: CMD_SUCCESS | COMPARE_ERROR | COUNT_ERROR (Byte count is not a multiple of 4) | ADDR_ERROR | ADDR_NOT_MAPPED

Definition at line 149 of file IAP.cpp.

int erase ( int  start,
int  end 
)

Erase Sector(s)

Parameters:
starta Start Sector Number
endan End Sector Number (should be greater than or equal to start sector number).
Returns:
error code: CMD_SUCCESS | BUSY | SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION | INVALID_SECTOR

Definition at line 113 of file IAP.cpp.

int erase_page ( int  start,
int  end 
)

Erase page(s) (LPC812, LPC824)

Parameters:
startStart page number.
endEnd page number (should be greater than or equal to start page).
Returns:
error code: CMD_SUCCESS | BUSY | SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION | INVALID_SECTOR

Definition at line 209 of file IAP.cpp.

int prepare ( int  start,
int  end 
)

Prepare sector(s) for write operation.

Parameters:
starta Start Sector Number
endan End Sector Number (should be greater than or equal to start sector number).
Returns:
error code: CMD_SUCCESS | BUSY | INVALID_SECTOR

Definition at line 125 of file IAP.cpp.

int read_BootVer ( void   )

Read Boot code version number.

Returns:
2 bytes of boot code version number

Definition at line 161 of file IAP.cpp.

int read_eeprom ( char *  source_addr,
char *  target_addr,
int  size 
)

Copy EEPROM to RAM (LPC11U24)

Parameters:
source_addrSource EEPROM address from which data bytes are to be read.
target_addrDestination RAM address where data bytes are to be written.
sizeNumber of bytes to be written.
Returns:
error code: CMD_SUCCESS | SRC_ADDR_NOT_MAPPED | DST_ADDR_NOT_MAPPED Remark: The top 64 bytes of the EEPROM memory are reserved and cannot be written to.

Definition at line 194 of file IAP.cpp.

int read_ID ( void   )

Read part identification number.

Returns:
device ID
See also:
read_serial()

Definition at line 83 of file IAP.cpp.

int * read_serial ( void   )

Read device serial number.

Returns:
device serial number
See also:
read_ID()

Definition at line 93 of file IAP.cpp.

int reinvoke_isp ( void   )

Reinvoke ISP.

Returns:
error code

Definition at line 68 of file IAP.cpp.

int reserved_flash_area_size ( void   )

Get user reserved flash size.

Returns:
size of user reserved flash memory
See also:
reserved_flash_area_start()

Definition at line 174 of file IAP.cpp.

char * reserved_flash_area_start ( void   )

Get user reserved flash start address.

Returns:
start address of user reserved flash memory
See also:
reserved_flash_area_size()

Definition at line 169 of file IAP.cpp.

int write ( char *  source_addr,
char *  target_addr,
int  size 
)

Copy RAM to Flash.

Parameters:
source_addrSource RAM address from which data bytes are to be read. This address should be a word boundary.
target_addrDestination flash address where data bytes are to be written. This address should be a 256 byte boundary.
sizeNumber of bytes to be written. Should be 256 | 512 | 1024 | 4096.
Returns:
error code: CMD_SUCCESS | SRC_ADDR_ERROR (Address not a word boundary) | DST_ADDR_ERROR (Address not on correct boundary) | SRC_ADDR_NOT_MAPPED | DST_ADDR_NOT_MAPPED | COUNT_ERROR (Byte count is not 256 | 512 | 1024 | 4096) | SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION | BUSY

Definition at line 136 of file IAP.cpp.

int write_eeprom ( char *  source_addr,
char *  target_addr,
int  size 
)

Copy RAM to EEPROM (LPC11U24)

Parameters:
source_addrSource RAM address from which data bytes are to be read.
target_addrDestination EEPROM address where data bytes are to be written.
sizeNumber of bytes to be written.
Returns:
error code: CMD_SUCCESS | SRC_ADDR_NOT_MAPPED | DST_ADDR_NOT_MAPPED Remark: The top 64 bytes of the EEPROM memory are reserved and cannot be written to.

Definition at line 181 of file IAP.cpp.